Test the bucket header's beta gate - #5246
Open
QuiltSimon wants to merge 2 commits into
Open
Conversation
Header.spec covers the Header component; nothing covered BucketLayout's `settings?.beta` gate, which is the line that drops the bucket name from the Packages and Workflows tabs on a default stack. The two bucket-name-when-beta-off cases are `it.fails`: they assert the desired behavior against the current gate, so they flip red once the gate narrows to stats only (#5235).
Codecov Report✅ All modified and coverable lines are covered by tests.
Additional details and impacted files@@ Coverage Diff @@
## master #5246 +/- ##
===========================================
- Coverage 55.20% 35.05% -20.16%
===========================================
Files 872 741 -131
Lines 36766 23803 -12963
Branches 6429 6429
===========================================
- Hits 20298 8344 -11954
+ Misses 14724 13715 -1009
Partials 1744 1744
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
|
||
| ## Changes | ||
|
|
||
| - [Added] Bucket: the header card's beta gate is covered by tests, so the bucket name cannot silently disappear from the tabs again ([#PRNUM](https://github.com/quiltdata/quilt/pull/PRNUM)) |
Contributor
There was a problem hiding this comment.
The new entry displays #PRNUM and links to /pull/PRNUM, leaving readers with a broken changelog link instead of PR #5246.
Suggested change
| - [Added] Bucket: the header card's beta gate is covered by tests, so the bucket name cannot silently disappear from the tabs again ([#PRNUM](https://github.com/quiltdata/quilt/pull/PRNUM)) | |
| - [Added] Bucket: the header card's beta gate is covered by tests, so the bucket name cannot silently disappear from the tabs again ([#5246](https://github.com/quiltdata/quilt/pull/5246)) |
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
…-gate # Conflicts: # catalog/CHANGELOG.md
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.
The catalog shell moved the bucket name into a header card gated behind
settings?.beta, so on a default stack the Packages and Workflows tabs name the bucket nowhere. #5235 fixes that — but every test in it exercisesHeaderdirectly. None exercisesBucketLayout's gate, which is the line that actually regressed.This adds that test. There is no
Bucket.spec.tsx; the template followed isOverview/index.spec.tsx, which mocksutils/CatalogSettingswith a mutable settings object and asserts the beta/non-beta/null branches.Written against master's shape, not #5235's
#5235 is still open, so this branches off master and targets the gate master actually has (the whole header card behind
beta). Consequence: "beta off → bucket name present" is false today — that is the bug — so those two assertions are written asit.fails, following theRoutes.spec.tsprecedent already in this repo.When #5235 lands, those two flip to plain
it. The spec says so in a comment, and the transition was verified in both directions:it.failscases now fail because they passThe four stats-gate assertions (beta on → stats present; beta off and null → stats absent) stay green under both shapes, so they pin the surviving half of the gate under either spelling.
If you'd rather this land only after #5235, it rebases to a two-line change.
Harness notes
BucketLayoutis not exported, so the spec renders the defaultBucketexport insideMemoryRouter+ aRoute path="/b/:bucket"(what feedsuseBucketStrict). Two things keep it fast:components/Layoutis mocked down to itspreslot, and every route path in theNamedRoutesstub is set to an unreachable/never/*so theSwitchlands on the catch-all and noRT.mkLazychunk is ever imported.useBucketExistenceis mocked to its tagged-union shape.TZ=UTC npx vitest run app/containers/Bucket— 350 passed / 49 files (was 344 / 48)Bucket.spec.tsxalone: 39ms, well inside the 5s budgetnpx tsc --noEmit -p .andnpx oxfmt --check— cleanAlso verified the
it.failscases fail on the assertion rather than a broken harness: flipping one to plainitgivesAssertionError: expected null to be truthy, so the harness mounts andqueryByTextgenuinely returns null.🤖 Generated with Claude Code
Greptile Summary
This PR adds coverage for the bucket header’s beta and missing-settings branches, including expected-failure assertions that document the existing bucket-name regression.
Buckettest harness with focused mocks for layout, settings, preferences, stats, and lazy routes.Confidence Score: 4/5
The PR appears safe to merge after replacing the malformed changelog pull-request placeholder.
The test harness matches the currently exercised Bucket and Header contracts, while the only accepted issue is a broken changelog label and link.
Files Needing Attention: catalog/CHANGELOG.md
Important Files Changed
Reviews (1): Last reviewed commit: "Test the bucket header card's beta gate ..." | Re-trigger Greptile