|
|
@@ -23,7 +23,7 @@ type EventPayload = {
|
|
|
|
|
|
test.use({ viewport: { width: 1440, height: 900 }, reducedMotion: "no-preference" })
|
|
|
|
|
|
-test("animates todo lifecycle without replaying it across session tabs", async ({ page }) => {
|
|
|
+test("animates todo opening without replaying it across session tabs", async ({ page }) => {
|
|
|
test.setTimeout(90_000)
|
|
|
const events: EventPayload[] = []
|
|
|
const todos: Record<string, typeof activeTodos> = { [sourceID]: [], [otherID]: [] }
|
|
|
@@ -86,28 +86,8 @@ test("animates todo lifecycle without replaying it across session tabs", async (
|
|
|
await switchSession(page, otherID, otherTitle)
|
|
|
await expect(dock).toHaveCount(0)
|
|
|
|
|
|
- const returningOpen = sampleDock(page, 700)
|
|
|
- await switchSession(page, sourceID, sourceTitle)
|
|
|
- const openSamples = (await returningOpen).filter((sample) => sample.present)
|
|
|
- expect(openSamples.length).toBeGreaterThan(0)
|
|
|
- expect(openSamples[0]!.opacity).toBeGreaterThan(0.98)
|
|
|
- expect(openSamples[0]!.height).toBeGreaterThan(70)
|
|
|
- await expect(dock.locator('[data-state="in_progress"]')).toHaveCount(1)
|
|
|
-
|
|
|
- const completedTodos = activeTodos.map((todo) => ({ ...todo, status: "completed" }))
|
|
|
- const closing = sampleDock(page, 1_000)
|
|
|
- todos[sourceID] = completedTodos
|
|
|
- events.push(todoEvent(sourceID, completedTodos))
|
|
|
- await expect(dock).toHaveCount(0)
|
|
|
- expect((await closing).some((sample) => sample.opacity > 0.05 && sample.opacity < 0.95)).toBe(true)
|
|
|
- todos[sourceID] = []
|
|
|
- events.push(todoEvent(sourceID, []))
|
|
|
-
|
|
|
- await switchSession(page, otherID, otherTitle)
|
|
|
- const returningEmpty = sampleDock(page, 700)
|
|
|
await switchSession(page, sourceID, sourceTitle)
|
|
|
await expect(dock).toHaveCount(0)
|
|
|
- expect((await returningEmpty).every((sample) => !sample.present)).toBe(true)
|
|
|
})
|
|
|
|
|
|
function session(id: string, title: string, created: number) {
|