opencode/packages/session-ui/component-tests/timeline-subagent-rows.spec.ts
Dax 5d55571d8d
Some checks are pending
check-nix / nix-eval (push) Waiting to run
check / typecheck (push) Waiting to run
deploy-files / files-build (push) Waiting to run
deploy-files / files-deploy (push) Blocked by required conditions
deploy-site / site-build (push) Waiting to run
deploy-site / site-deploy (push) Blocked by required conditions
deploy / legacy-build (push) Waiting to run
deploy / legacy-deploy (push) Blocked by required conditions
deploy / data-build (push) Waiting to run
deploy / data-deploy (push) Blocked by required conditions
fix(app): no spinner on subagent rows in the new timeline (#64132)
2026-11-15 18:00:39 -05:00

32 lines
1.4 KiB
TypeScript

import { expect, story } from "../../stories/playwright/story"
const playground = "timeline-playground--playground"
story("a subagent row leads with its status chip", async ({ mount }) => {
const timeline = await mount(playground, { args: { scenario: "Background work", activity: true } })
const rows = timeline.locator('[data-component="timeline-subagent"] > [data-slot="timeline-event-item"]')
await expect(rows.locator('[data-slot="timeline-event-item-status"]')).toHaveText([
"Started",
"Started",
"Updated",
"Completed",
"Failed",
"Started",
"Started",
"Completed",
"Stopped",
])
// Agent names are capitalized by CSS, so their text is as configured.
await expect(rows.nth(3).locator("> *")).toHaveText(["Completed", "review Agent", "Review the theme store"])
})
// The timeline is a list of events: a start keeps its ring even while its subagent has not reported back.
story("a started subagent never spins", async ({ mount }) => {
const timeline = await mount(playground, { args: { scenario: "Subagent between tools", activity: true } })
const status = timeline.locator('[data-component="timeline-subagent"] [data-slot="timeline-event-item-status"]')
await expect(status).toHaveText("Started")
await expect(status.locator('svg[data-slot="timeline-event-item-glyph"] circle')).toHaveCount(1)
await expect(status.locator('[data-component="session-progress-indicator-v2"]')).toHaveCount(0)
})