test(gui): assert destructive menu items are marked at rest, not on hover - #379
Merged
Conversation
…over The e2e suite failed on a run of the current app: "Exit icon should be neutral before hover", actual rgb(244, 117, 130). The app is right and the assertion was stale. #296 moved the red to rest deliberately, on the reasoning that a warning arriving once you have already aimed at the item is too late to redirect you. That PR changed four source files and no e2e file, so the assertion kept encoding the behaviour it replaced. Renamed from assertExitMenuItemNeutralUntilHover, since the old name asserted the old rule. The expectation now reads `--red` through a probe element rather than a hardcoded hex, so it holds in both themes (#f47582 dark, #c6293d light) and getComputedStyle normalises it to the same rgb() form the icon reports. The probe goes inside `.container`: tokens.css declares the palette there and not on :root, and a first attempt appended it to document.body, where var(--red) resolved to nothing and inherited white. `rawRed` is asserted non-empty so that failure mode reports itself instead of surfacing as a colour mismatch. Hover is still checked, but now asserts the marking STAYS rather than appears. menu.css covers hover as "a subset" of at-rest, so a rule that reverted there would be a regression the at-rest check alone would miss. Verified by running the suite against the built app: exit 0, no assertion errors, and all 12 screenshots rewritten through to tauri-render-narrow.png, which is the last one the run produces. eslint clean.
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 e2e suite failed on a run of the current app:
The app is right; the assertion was stale. #296 moved the red to rest deliberately — a warning that arrives once you have already aimed at the item is too late to redirect you. That PR changed four source files and no e2e file, so
assertExitMenuItemNeutralUntilHoverkept encoding the behaviour it replaced. Renamed, since the old name asserted the old rule.What the new assertion pins
menu.csscovers hover as "a subset" of at-rest, so a rule that reverted there would be a regression the at-rest check alone would missThe expected colour is read from
--redthrough a probe element rather than a hardcoded hex, so it holds in both themes (#f47582dark,#c6293dlight) andgetComputedStylenormalises it to the samergb()form the icon reports.The probe goes inside
.container.tokens.cssdeclares the palette there, not on:root— a first attempt appended it todocument.body, wherevar(--red)resolved to nothing and inherited white.rawRedis now asserted non-empty so that failure reports itself instead of surfacing as a confusing colour mismatch.Verification
Ran the suite against the built app: exit 0, no assertion errors, and all 12 screenshots rewritten through to
tauri-render-narrow.png, which is the last one the run produces.eslintclean.Note the suite is silent on success — it prints only on failure, so a passing run's log is just the build output.