Fix QrCodeBlurTests and scenario to match independent QR toggles (follow-up to #194)#199
Merged
Fix QrCodeBlurTests and scenario to match independent QR toggles (follow-up to #194)#199
Conversation
…wQrCode/showDirectQrCode) PR #194 introduced QR blur using showToken, but PR #197 subsequently replaced that with independent showQrCode/showDirectQrCode variables and dedicated qr-reveal-btn buttons. The tests were left asserting the old showToken-based behaviour, causing them to fail against current main. - Update QrCodeImages_UseBlurredClassFromShowTokenToggle to match the two independent variables (showQrCode, showDirectQrCode) with specific patterns per img src, replacing the fragile count-based regex check - Update TokenValue_UsesBlurredClassFromShowTokenToggle to assert the blur expression is specifically on the token-value element (not just anywhere in the file), preventing false positives from QR img tags - Extend ShowToken_DefaultsFalse to also verify showQrCode and showDirectQrCode default to false - Fix settings-qr-code-blur scenario: click .qr-code .qr-reveal-btn (not .tunnel-token .copy-btn) and assert QR+token are independent Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ex tolerance - Update class docstring to reflect independent toggles (showQrCode, showDirectQrCode, showToken) rather than the old 'when showToken is false' - Rename ShowToken_DefaultsFalse -> AllBlurToggles_DefaultFalse to match its expanded scope (tests all three bool fields) - Replace rigid positional regex patterns with <img\b[^>]*src=...[^>]*class=...> so adding/reordering attributes on the img element doesn't break the test Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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
PR #194 introduced QR code blur using
showToken. PR #197 subsequently replaced that with independentshowQrCode/showDirectQrCodevariables and dedicatedqr-reveal-btnbuttons. The tests added in #194 were left asserting the oldshowToken-based behaviour, causing them to fail against currentmain.Fixes
QrCodeImages_UseBlurredClassFromShowTokenToggle→ renamed toQrCodeImages_UseBlurredClassFromIndependentQrToggles: replaces the count-based regex with two specific patterns matchingshowQrCodeandshowDirectQrCodeper their respectivesrcattributesTokenValue_UsesBlurredClassFromShowTokenToggle: changed fromAssert.Containsanywhere in the file toAssert.Matchesscoped to thetoken-valueelement — prevents false positives now that QR<img>tags also contain blur expressionsShowToken_DefaultsFalse: extended to also assertshowQrCodeandshowDirectQrCodedefault to falsesettings-qr-code-blurscenario: updated to click.qr-code .qr-reveal-btn(not.tunnel-token .copy-btn) and to verify QR and token toggles are independent (QR revealed, token still blurred)