Repository navigation
Conversation
|
@askov is attempting to deploy a commit to the Solana Foundation Team on Vercel. A member of the Team first needs to authorize it. |
React logs each DOM nesting warning once per page, so a check built on the warning misses later stories. The preview parses each story's DOM again and fails the story when the parser builds a different tree. Moves the valid RawAccountRows stories into BaseRawAccountRows.
Stories repeated the `appDirectory` and `INITIAL_VIEWPORTS` parameters. The preview sets them once, and Storybook deep-merges story parameters over the preview's.
Specs built the same RPC errors, idle SWR module and fetch stubs inline. Adds `rpc-errors`, `swr-idle` and `address-stub` to `app/__tests__`, and `stubFetch` to `rpc-fetch`.
Specs and stories encoded instruction data, messages and accounts by hand. Adds `makeInstruction`, `compileV0Message` and `makeAccount`, and moves the parsed transaction builders to the transaction-data entity.
Fifteen mock files repeated the same parsed transaction shape with random keys. `__fixtures__/transactions.ts` builds them from seeded keys, so every run uses the same addresses.
Specs and stories in several slices built the same data inline. Exports `groupVerificationSources` so the badge stories group sources with the hook's own logic.
Stories wrapped instruction cards and OG images in the same providers by hand. Adds `instructionCardDecorators`, `withOgImageFrame` and `withTransaction`, and moves repeated args to the story meta.
Responsive stories copied the args of their base stories. They import the base file and spread its args, so both render the same data.
b892a5f to
4b9459b
Compare
[Medium impact] The changes mainly reach the shared specs and Storybook workflow across Explorer features. The PR appears safe to merge, with a non-blocking improvement to how markup errors are reported. Findings
SummaryShares builders, fixtures, and decorators across specs and stories.
Reviews (1) · Last reviewed commit: "test(storybook): reuse base story args i..." · Reviewed by Greptile |
| if (reparsed.innerHTML === rendered) return; | ||
|
|
||
| let at = 0; | ||
| while (rendered[at] === reparsed.innerHTML[at]) at++; |
There was a problem hiding this comment.
On a markup mismatch, the loop reads reparsed.innerHTML once for every matching character. Each read serializes the whole body again. An invalid element near the end of a large story can therefore make the check disproportionately slow. Save reparsed.innerHTML once and reuse that string for the comparison, loop, and error message.
Description
Moves fixtures and mocks that specs and stories rebuilt by hand into shared builders, and fails a story whose markup is not valid HTML.
Changes
nextjsparameters once in the Storybook preview, and removes the per-storynextjsandviewportparameters.rpc-errors,swr-idle,address-stubandstubFetchtoapp/__tests__for specs to share.makeInstruction,compileV0MessageandmakeAccountbuilders, and moves the parsed transaction builders to the transaction-data entity.app/features/receipt/__fixtures__/transactions.ts, so every spec run uses the same addresses.__fixtures__module.instructionCardDecorators,withOgImageFrameandwithTransactionstory decorators.groupVerificationSourcesfromuse-verification-sources.ts, so the badge stories use the hook's grouping.BaseRawAccountRowsstory file into the shared one, and removes unused fixtures and decorators.Behavior Changes
Type of change
Screenshots
Testing
<div>inside a<tbody>to any story, and runpnpm exec vitest --project storybook run <story file>. Expect the story to fail withThe HTML parser builds a different DOM from the story markup.Onmaster, the story passes.Related Issues
Closes HOO-2279
Closes HOO-1659
Checklist
pnpm test,pnpm lint,pnpm typecheck)build:infoscript to update build informationAdditional Notes
use-verification-sources.ts,receipt-page.tsx,app/features/metadata/mocks.tsandeslint.config.mjs.bench/BUILD.mddoes not change.