test(integration): add consumer-perspective DataAppWorkflow story#100
test(integration): add consumer-perspective DataAppWorkflow story#100ts-ithomas wants to merge 3 commits into
Conversation
Adds a Storybook play-function story that exercises the UI kit from the outside — importing exclusively from the public package surface (@tetrascience-npm/tetrascience-react-ui) and building a realistic compound-registry data app on top of it. Five scenarios are covered: initial render, sort, filter, pagination, and row action callback. If any of these break for a downstream consumer, CI will catch it here first. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Pull request overview
Adds a new Storybook story file that exercises the UI kit from a consumer's perspective — importing components only via the public package entry point (@tetrascience-npm/tetrascience-react-ui, aliased to local src/index.ts by vite.config.ts) and walking through a realistic compound‑registry data‑app workflow. Five play() functions assert rendering, sorting, filtering, pagination, and a row‑action callback to act as an end‑to‑end consumer regression harness. The story is not tied to a Jira ticket, no production code is modified, and Zephyr IDs are intentionally left empty for the sync workflow to populate.
Changes:
- Adds
CompoundRegistryconsumer-style component usingDataTable,DataTableFilter,DataTablePagination,TableToolbar,Badge, andButtonfrom the package's public entry. - Adds five Storybook stories under the new
Integration/DataAppWorkflowtitle withplay()functions covering rendering, sort, filter, pagination, and row-action callback flows. - Uses the package self-import path so a break in any of the re-exported components surfaces as a failing CI test.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
The import from |
|
This file lives in |
- Move file from src/components/composed/ to src/stories/integration/ (composed/ is for real components, not test fixtures) - Remove unused React namespace import flagged by Copilot - Fix filter assertion: toHaveLength(3) instead of toBeLessThanOrEqual(3) - Update file header to accurately describe what is tested (source tree, not compiled dist/) and note the gap a consumer build test would fill - Add "Integration" to storybook preview.ts sort order so the section is positioned deliberately rather than falling into the wildcard bucket Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The sort onClick handler is attached to the inner div inside the th (data-table.tsx:233), not the th itself. Clicking the columnheader role element never triggered sorting. Fix mirrors the pattern used in the existing ReorderWithSorting story. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Hey Brennon — updated the PR description to reflect the correct file path (src/stories/integration/). All of Copilot's feedback has been addressed across the last few commits. Totally happy for you to merge, adjust, or discard this. The follow-up idea of running tests against dist/ post-pack is definitely worth a separate ticket. Will be good to have one test like that. Thanks again for the thorough review! |
blee-tetrascience
left a comment
There was a problem hiding this comment.
CI is red for build, Storybook, and title check. Please fix the failing play step below and put the Jira ticket in the required PR field so the title check passes.
| await step("Select Category column in the filter", async () => { | ||
| const columnSelects = body.getAllByRole("combobox") | ||
| await userEvent.click(columnSelects[0]) | ||
| await userEvent.click(body.getByRole("option", { name: "Category" })) |
There was a problem hiding this comment.
CI opens this select and only sees page size options, so the test is clicking the wrong combobox. Please scope the query to the filter popover or choose the combobox by its accessible name before selecting Category.
Summary
This PR adds a single Storybook story file that tests the UI kit from a consumer's perspective — the way a developer who has installed the package and built a data app on top of it would experience it.
It came out of a QE review of SW-1288 (v0.5.0). The existing test suite is strong on component internals and design tokens, but there were no tests that import from the public package surface and exercise a realistic end-to-end workflow. This is a first pass at filling that gap.
Not tied to any sprint or epic — sharing for the team to adopt if it's useful.
What's in the file
src/components/composed/DataAppWorkflow.stories.tsxA
CompoundRegistrycomponent built using only public imports:Five stories, each with a
play:function that runs in Playwright via the existing CI:RendersWithDataSortByNameFilterByCategoryPaginationRowActionCallbackonViewcallback with the correct row objectWhy this matters
If a breaking change lands in
DataTable,Badge,Button, or the filter/pagination components, these tests will fail in CI before any downstream app is affected. It's essentially a consumer regression harness baked into the repo.Notes for the team
""— the sync workflow will assign them on merge.storybook/__fixtures__/or adjust assertions to match your conventionsonViewcallback pattern (custom cell with a Button) is a stand-in foronRowClick— if that prop gets added toDataTablein future, this story is a natural place to test itHappy to adjust anything before this merges. Thanks for the great work on v0.5.0!