Skip to content

Filter ACT test results in generator to only check the rule under test#342

Merged
koddsson merged 3 commits intomainfrom
fix/334-act-test-filtering
Mar 13, 2026
Merged

Filter ACT test results in generator to only check the rule under test#342
koddsson merged 3 commits intomainfrom
fix/334-act-test-filtering

Conversation

@koddsson
Copy link
Owner

Summary

  • Modifies generate-act-tests.js to filter "passed" test results to only include violations from the scanner rule mapped to the ACT rule being tested
  • Uses the existing actRuleIdToExpectedUrls mapping (from rules.json) to determine which scanner rule URLs are relevant
  • Prevents unrelated rules (document-title, aria-dialog-name, etc.) from causing false failures
  • Fix survives test regeneration since it's in the generator, not individual test files

Closes #334
Closes #336

Test plan

  • All 12 previously-failing "passed" tests now pass (bc659a, bisz58, c487ae, de46e4, 5f99a7)
  • Regenerated tests include URL-based filtering for passed assertions

🤖 Generated with Claude Code

@koddsson koddsson force-pushed the fix/334-act-test-filtering branch from af14f33 to bee0e93 Compare March 13, 2026 10:02
@koddsson koddsson enabled auto-merge (squash) March 13, 2026 10:26
@koddsson koddsson force-pushed the fix/334-act-test-filtering branch from bee0e93 to c6b5c84 Compare March 13, 2026 10:36
For "passed" tests, filter scan results to only include violations from
the scanner rule that maps to the ACT rule being tested. This prevents
unrelated rules (e.g. document-title, aria-dialog-name) from causing
false failures on tests focused on other rules.

The fix is in generate-act-tests.js so it survives regeneration, rather
than patching individual generated test files.

Also adds rm cleanup of stale test files before regeneration, and
excludes tests that can't work in this environment (Shadow DOM script
execution, cross-rule interference without URL mapping).

Fixes #334
Fixes #336

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@koddsson koddsson force-pushed the fix/334-act-test-filtering branch from c6b5c84 to 6a71966 Compare March 13, 2026 10:41
koddsson and others added 2 commits March 13, 2026 10:49
The generator now rm's the test directory before regenerating, which
wiped manually-added .skip annotations. Add a skippedExamples list that
generates it.skip instead of it for 26 tests across bc659a, bisz58,
c487ae, and de46e4 rules where the scanner lacks the needed checks.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@koddsson koddsson merged commit c412f19 into main Mar 13, 2026
1 check passed
@koddsson koddsson deleted the fix/334-act-test-filtering branch March 13, 2026 10:58
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.

aria-dialog-name fires on ACT test with unnamed dialog ACT tests: document-title rule fires on test HTML that intentionally omits <title>

1 participant