Skip to content

fix(e2e): escape test values in locator patterns with one helper - #732

Merged
catinspace-au merged 2 commits into
mainfrom
fix/e2e-literal-regex
Nov 13, 2026
Merged

catinspace-au merged 2 commits into
mainfrom
fix/e2e-literal-regex

Conversation

@catinspace-au

Copy link
Copy Markdown
Contributor

Six e2e specs built a RegExp straight from a test value. semgrep flags these as non-literal patterns on every main run. A value holding ., ( or + would also have matched more than its own row.

The rx tagged template in e2e/config/regex.helpers.ts escapes every interpolation and keeps the template's raw backslashes. The one RegExp call left has a semgrep marker explaining that the values are the test's own data.

Six e2e specs built a RegExp straight from a test value. semgrep flags these as non-literal patterns on every main run. A value holding `.`, `(` or `+` would also have matched more than its own row.

The rx tagged template in e2e/config/regex.helpers.ts escapes every interpolation and keeps the template's raw backslashes. The one RegExp call left has a semgrep marker explaining that the values are the test's own data.
The marker dropped the trailing segment of the rule id reported by the scan. A suppression under the wrong id is not honoured. oidcLogin.spec.ts has the full id. The helper's marker now matches it.
@catinspace-au
catinspace-au merged commit 1d89a6c into main Nov 13, 2026
18 checks passed
@catinspace-au
catinspace-au deleted the fix/e2e-literal-regex branch November 13, 2026 18:40
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