Skip to content

test(app): isolate component coverage with storybook - #45142

Merged
Brendonovich merged 10 commits into
v2from
app-component-tests
Aug 26, 2026
Merged

Brendonovich merged 10 commits into
v2from
app-component-tests

Conversation

@opencode-agent

@opencode-agent opencode-agent Bot commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Add package-owned Playwright component suites: 44 Session UI tests and 1 app Composer test.
  • Keep exactly five net-new Storybook entries: Conversation, AgentResearch, ChangingFiles, TerminalCommands, and InteractiveComments. Existing entries remain; variants use serializable args/globals and interactive controls.
  • Share test-only configuration and mounting in packages/storybook/playwright/. Component suites remain separately filterable from default unit/browser tests and required full-app E2E CI.
  • Preserve original source-path provenance comments and all new upstream tests.

Assertion Restoration

A case-by-case audit found that some earlier moves preserved visible outcomes but lost fixture or integration guarantees. This revision restores all 19 weakened cases without new Storybook entries:

  • Restore 30 complementary E2E cases, including the five live transport tests, production compaction/retry/lifecycle events, active collapsed edits, real app scrolling, empty-draft/single-variant Composer configuration, persisted locales, reasoning matrices, model catalog hydration, and whole-app owner warnings.
  • Keep useful isolated component and client-parser coverage alongside the restored integrations; local fixture state is not treated as proof of reducer or transport behavior.
  • Restore the exact modified/added/deleted three-file patch and deletion re-collapse sequence, real dismissed-question visibility, singleton read metadata, TypeScript write fixture, and URI attachment source.
  • Add a separate shell input-completion phase before execution, multiline output growth and independent sibling controls. Preserve busy/message-completion separation.
  • Strengthen app no-scroll coverage with actual overflow, a visible focused command away from the bottom, and the real app scroll owner.
  • Observe compaction partial summaries before failure/cancellation, then assert their removal through real event handling.

The independent re-audit covers all 132 expanded merged-v2 baseline contracts, cross-checked against the initial 124-case baseline. Final coverage is 113 full-app E2E contracts + 19 intentionally isolated rendering contracts. The full component suite remains 45 tests, including supplemental coverage. The earlier 19 assertion gaps were restored; the separately approved animation-sampling policy change below intentionally removes two animation-only assertions. Rendering and integration checks still have different execution boundaries.

Focused Animation Policy

At Brendan's request, remove only the flaky expectTerminalTopMotion requirement in terminal-hidden.spec.ts: more than six sampled positions and a maximum per-sample movement below 30% of the range. Remove its unused sample/reset helper code. 0 test cases removed; 1 mixed test retained; 2 animation-only assertion sites removed. All other 53 assertion sites in that file, including final geometry, alignment, visibility, caching and placement behavior, are unchanged. Other animation-event and performance-profiling checks were not swept. This is an intentional coverage-policy change, not a claim of identical animation coverage.

The focused terminal test passed 10 repetitions with 5 workers, including the parallel workload that previously reproduced the sampling failure.

Validation

  • packages/session-ui: systemd-run --user --scope --quiet -p TasksMax=768 bun run test:components -- --workers=2 — 44 passed.
  • packages/app: same component command — 1 passed.
  • packages/app: PATH=/tmp/opencode/node-bun:$PATH systemd-run --user --scope --quiet -p TasksMax=768 --setenv=PATH=/tmp/opencode/node-bun:$PATH bun run test:e2e -- --workers=5 — 113 passed.
  • App unit/browser suites — 540 + 45 passed.
  • Session UI unit suite — 112 passed.
  • Client unit suite — 83 passed, including supplemental parser checks.
  • App, app-E2E, Session UI and client typechecks — passed.
  • Storybook production build — passed.
  • Prettier and git diff --check — passed.
  • Merge-base export audit — exactly 5 net-new Storybook entries.

Requested by: @Brendonovich (Brendan via Slack)

@opencode-agent
opencode-agent Bot force-pushed the app-component-tests branch from cbbfd34 to ed48277 Compare August 26, 2026 18:28
@Brendonovich
Brendonovich merged commit 1aa4046 into v2 Aug 26, 2026
8 checks passed
@Brendonovich
Brendonovich deleted the app-component-tests branch August 26, 2026 18:42
jinhuang712 pushed a commit to jinhuang712/opencode that referenced this pull request Sep 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant