test(detect-view): pin the card clamps and the feed flag - #693
Merged
Merged
Conversation
A stored rail, gradient, size, or delta precision past its cap was unchecked, and so was which group actually asked for chart-routed detects. Each new test fails when that one boundary moves.
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.
What & why
crates/moon-core/src/config/detect_view.rsdecides how a detection card is drawn and whether chart-routed detects join a group's feed. The round-trip tests never called the clamps or the per-group flag, so a cap that moved by one pixel or one size would stay green.Tests, and the mutation that proved each one
All six went red on an assertion, then green again after the production file was restored.
git diffondetect_view.rswas empty.slot_count_follows_the_card_grid— medium's slot count changed from 6 to 5. The test reportedleft: 5,right: 6.rail_width_clamps_to_five_pixels—rail_w_clampedreturned the stored width. A stored 6 came back as 6, not 5.rail_gradient_clamps_to_the_card_width— the gradient clamp was removed. A stored 101 on a card 100 wide came back as 101.card_size_clamps_to_large—size_clampedreturned the stored size. Size 3 came back as 3, not large (2).delta_decimals_clamp_to_two_places— the cap moved from 2 places to 3. A stored 3 came back as 3.add_to_chart_follows_only_the_named_group— the flag was read from any group, not the named one."beta"came back true after only"alpha"had opted in.Review
One clean-context pass asked whether the tests check behaviour or are shaped to pass. It kept all six. Nothing was dropped.
Still untested in this file
size_cfg,size_cfg_mut,active,load, andsave. The first three are pure routing;loadandsaveare file I/O. The existing round-trip tests already exerciseDefault,to_share_string,parse_share,group, andset_group.How to verify
cargo test -p moon-core --lib detect_viewcargo fmt --all,cargo clippy --workspace --all-targets, andcargo test --workspacewere green locally before push. Clippy still warns in other crates; this diff adds none.