Download packages/app/e2e/regression/session-timeline-context-state.spec.ts from SaylorTwift/opencode: direct link, hf CLI and curl.
- Browser
- Download file 1.21 kB
-
https://huggingface.co/SaylorTwift/opencode/resolve/main/packages/app/e2e/regression/session-timeline-context-state.spec.ts
- Command line
-
hf download hf://SaylorTwift/opencode/packages/app/e2e/regression/session-timeline-context-state.spec.ts
-
curl -L -o session-timeline-context-state.spec.ts https://huggingface.co/SaylorTwift/opencode/resolve/main/packages/app/e2e/regression/session-timeline-context-state.spec.ts
1.21 kB
| import { expect, test } from "@playwright/test" | |
| import { | |
| assistantMessage, | |
| partUpdated, | |
| setupTimeline, | |
| toolPart, | |
| userMessage, | |
| } from "../performance/timeline-stability/fixture" | |
| test("preserves a collapsed context group through count and status updates", async ({ page }) => { | |
| const ids = ["prt_closed_01_read", "prt_closed_02_glob"] | |
| const inputs = { | |
| read: { filePath: "src/a.ts", offset: 0, limit: 120 }, | |
| glob: { path: ".", pattern: "**/*.ts" }, | |
| } | |
| const timeline = await setupTimeline(page, { | |
| messages: [ | |
| userMessage(), | |
| assistantMessage( | |
| [toolPart(ids[0]!, "read", "running", inputs.read), toolPart(ids[1]!, "glob", "running", inputs.glob)], | |
| { completed: false }, | |
| ), | |
| ], | |
| }) | |
| const group = page.locator(`[data-timeline-part-ids="${ids.join(",")}"]`) | |
| const trigger = group.locator('[data-slot="collapsible-trigger"]') | |
| await expect(trigger).toHaveAttribute("aria-expanded", "false") | |
| await timeline.send(partUpdated(toolPart(ids[0]!, "read", "completed", inputs.read)), 100) | |
| await timeline.send(partUpdated(toolPart(ids[1]!, "glob", "completed", inputs.glob)), 300) | |
| await expect(trigger).toHaveAttribute("aria-expanded", "false") | |
| }) | |