Tests: End the About CSS slice at the next section, not a named one - #646
Merged
Conversation
The About theme contract test sliced os-settings.css between the About tab comment and "Apps & Icons section". #640 renamed that section while #631 was in flight, so the end index came back -1 and the slice was empty. One assertion failed on the empty slice; the rest of the file's assertions had nothing to inspect. Take the next top-level section comment instead, so a rename downstream of About cannot silently empty the slice again. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
mmtr
enabled auto-merge (squash)
August 21, 2026 12:27
Collaborator
|
Thank you Miguel! |
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.
Proposed changes
Ends the About CSS slice in
os-settings-about-theme.test.tsat the next top-level section comment instead of a named one.Why are these changes being made?
Trunk is red on this test. It slices
assets/css/os-settings.cssbetween the About tab comment and/* Apps & Icons section:That section no longer exists. #640 renamed it to "Navigation section" while #631 was in flight, so
aboutEndcomes back-1andcss.slice( aboutStart, -1 )yields an empty string.expect( aboutEnd ).toBeGreaterThan( aboutStart )fails.The empty slice also meant the second test in the file, the one checking the About block does not bypass theme tokens with raw brand meshes or hardcoded ink, was asserting against nothing and passing for free. It inspects the real block again now.
Naming the following section couples the test to whatever happens to sit after About, which is exactly how it broke. The next top-level comment is stable under a rename.
Testing instructions
trunkand runnpx vitest run tests/vitest/os-settings-about-theme.test.ts. Make sure it fails withexpected -1 to be greater than <n>.assets/css/os-settings.css, rename/* Navigation section — per-item placement chooser. */to anything else and run the test again. Make sure it still passes, which is the regression this guards against.color: #fff;inside the About block inassets/css/os-settings.cssand run the test. Make sure "does not bypass theme substitutions with a raw brand mesh or ink" now fails. Revert.