feat: feinschliff für iphone und ipad
- Safe Areas: Header unter Statusleiste/Notch, Ränder im Querformat
- Touch: alle Buttons mind. 44 px, kein Doppeltipp-Zoom-Verzug
- ab 1024 px Breite zwei Spalten für die Clip-Karten
- relative Zeitangaben ('vor 5 Min.'), genaues Datum als Tooltip
- kurze Einblendungen für Speichern, Löschen, Anheften und Fehler
- nach über 60 s im Hintergrund wird die Liste neu geladen
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
6d58a697e3
commit
57eaede300
19 files changed
+301
-50
No files matched your search
@@ -0,0 +1,31 @@
|
||||
import { createPinia, setActivePinia } from 'pinia'
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
|
||||
|
||||
import { useToastStore } from './toast'
|
||||
|
||||
describe('toast store', () => {
|
||||
beforeEach(() => {
|
||||
setActivePinia(createPinia())
|
||||
vi.useFakeTimers()
|
||||
})
|
||||
afterEach(() => vi.useRealTimers())
|
||||
|
||||
it('dismisses info toasts after 2.5 s and errors after 5 s', () => {
|
||||
const toast = useToastStore()
|
||||
toast.show('Gespeichert')
|
||||
toast.error(new Error('Kaputt'))
|
||||
expect(toast.toasts.map((t) => t.text)).toEqual(['Gespeichert', 'Kaputt'])
|
||||
|
||||
vi.advanceTimersByTime(2500)
|
||||
expect(toast.toasts.map((t) => t.kind)).toEqual(['error'])
|
||||
vi.advanceTimersByTime(2500)
|
||||
expect(toast.toasts).toEqual([])
|
||||
})
|
||||
|
||||
it('can be dismissed early', () => {
|
||||
const toast = useToastStore()
|
||||
toast.show('Hallo')
|
||||
toast.dismiss(toast.toasts[0]!.id)
|
||||
expect(toast.toasts).toEqual([])
|
||||
})
|
||||
})
|
||||
Reference in new issue
Block a user