fix(components): fix annotation symbol check in MutationWithPerMutationInfoOverride story - #1132
Conversation
…onInfoOverride story The play function reused getAnnotationIndicator() which always queries for the '*' symbol, but this story uses 'c'. The check always failed because '*' was never in the DOM. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Now it looks like other tests are flaky? |
|
Weird, now there are other tests that seem to fail/be flaky. I've asked Claude again. |
…GrowthAdvantage story The story was relying on the real network call to cov-spectrum.org returning a non-ok response, making the test flaky in CI. Add an explicit 422 mock so the NotEnoughDataToComputeFitError path is triggered deterministically. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Ok, added a mock response, the endpoint was throwing with 500 - not enough data. IMO the mock response here is a good way to fix that. |
There was a problem hiding this comment.
Pull request overview
Fixes Storybook interaction tests by aligning story assertions and fetch mocks with the actual rendered annotation symbol / network behavior, preventing a regression where the play function looked for an annotation indicator that never appeared.
Changes:
- Updates
MutationWithPerMutationInfoOverridestory play function to assert against the correct annotation symbol (c) instead of reusing a helper hardcoded to*. - Adds a missing fetch mock for the
chen2021FitnessPOST request in the “TooFewDataToComputeGrowthAdvantage” story so the “not enough data” path is exercised deterministically.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| components/src/preact/relativeGrowthAdvantage/relative-growth-advantage.stories.tsx | Adds a missing computed-model fetch mock to support the “too few data” error scenario reliably. |
| components/src/preact/components/annotated-mutation.stories.tsx | Fixes the story’s play-function assertion to check for the actual annotation symbol used by that story. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
The play function reused getAnnotationIndicator() which always queries for the '*' symbol, but this story uses 'c'. The check always failed because '*' was never in the DOM.
regression in bccd701