Skip to content

fix: correct bugs in testaro targetsNear test - #136

Open
jrpool wants to merge 2 commits into
mainfrom
targetsNearBugs
Open

fix: correct bugs in testaro targetsNear test#136
jrpool wants to merge 2 commits into
mainfrom
targetsNearBugs

Conversation

@jrpool

@jrpool jrpool commented Aug 24, 2026

Copy link
Copy Markdown
Member

Correct bugs in the test of targetsNear rule of the testaro rule engine:

  1. Reporting of incorrect ordinal severities.
  2. Incrementing of totals of incorrect ordinal severities.
  3. Attempts to read a property of undefined instance XPaths.

This revision resolves issue #108.

@jrpool jrpool added the bug Something isn't working label Aug 24, 2026
@jrpool
jrpool requested a lite review from Copilot August 24, 2026 03:29

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes correctness issues in the targetsNear Testaro rule’s reported severities/totals and prevents a crash in summary mode (withItems: false) when instances don’t carry an xPath, addressing issue #108.

Changes:

  • Align summary-instance ordinalSeverity values with the itemized-path severities (2 for <44px, 3 for <24px).
  • Fix totals ordering so counts land in the correct severity slots ([0, 0, minorCount, majorCount]).
  • Guard the XPath→catalog-index conversion so instances without xPath no longer throw in summary mode.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
testaro/targetsNear.ts Corrects summary-mode severities/totals and guards XPath conversion to prevent summary-mode crashes.
testaro/targetsNear.js Updates the emitted JS to match the TypeScript fixes (severity/totals alignment + XPath guard).

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@jrpool
jrpool requested a review from wittjeff August 24, 2026 03:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants