Repository navigation
fix(tests): guard missing image releases data in catalog test - #1570
Merged
Merged
Conversation
Handle unpopulated static data gracefully when loading ImageProductSection in scripts/catalog-components.test.js during clean CI checkouts. Assisted-by: Gemini 3.8 Flash via GitHub Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
In clean CI checkouts (e.g., job 119610999752), gitignored
static/data/image-releases.jsonis not present on disk before test execution, causingscripts/catalog-components.test.jsto fail withCannot find module .../static/data/image-releases.json.Solution
scripts/catalog-components.test.js, fallback to{ unavailable: true }when@site/static/data/*.jsonis missing on disk, following the standard indocs/skills/component-testing.md.ImageProductSectionfor the unit test.src/components/ImageProductSection.tsx, safely accessreleasesFile?.products?.[product]when the data file is unavailable.Verification
npm testpassed in full (all 1308 tests pass).npm run test:coveragepassed all thresholds.npm run lintpassed.