Skip to content

Fix QrCodeBlurTests and scenario to match independent QR toggles (follow-up to #194)#199

Merged
PureWeen merged 2 commits intomainfrom
fix-pr194-review-issues
Feb 23, 2026
Merged

Fix QrCodeBlurTests and scenario to match independent QR toggles (follow-up to #194)#199
PureWeen merged 2 commits intomainfrom
fix-pr194-review-issues

Conversation

@PureWeen
Copy link
Copy Markdown
Owner

Problem

PR #194 introduced QR code blur using showToken. PR #197 subsequently replaced that with independent showQrCode/showDirectQrCode variables and dedicated qr-reveal-btn buttons. The tests added in #194 were left asserting the old showToken-based behaviour, causing them to fail against current main.

Fixes

  • QrCodeImages_UseBlurredClassFromShowTokenToggle → renamed to QrCodeImages_UseBlurredClassFromIndependentQrToggles: replaces the count-based regex with two specific patterns matching showQrCode and showDirectQrCode per their respective src attributes
  • TokenValue_UsesBlurredClassFromShowTokenToggle: changed from Assert.Contains anywhere in the file to Assert.Matches scoped to the token-value element — prevents false positives now that QR <img> tags also contain blur expressions
  • ShowToken_DefaultsFalse: extended to also assert showQrCode and showDirectQrCode default to false
  • settings-qr-code-blur scenario: 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)

PureWeen and others added 2 commits February 23, 2026 10:10
…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>
@PureWeen PureWeen merged commit 2dfaa59 into main Feb 23, 2026
@PureWeen PureWeen deleted the fix-pr194-review-issues branch February 23, 2026 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant