Skip to content

test: cover the not assessed numbers in the assessment HTML reports - #47

Merged
royklo merged 1 commit into
mainfrom
test/assessment-report-coverage
Oct 22, 2026
Merged

royklo merged 1 commit into
mainfrom
test/assessment-report-coverage

Conversation

@royklo

@royklo royklo commented Oct 22, 2026

Copy link
Copy Markdown
Owner

Summary of changes

Test-only. Closes the gaps a mutation run found in the #46 coverage: five mutations to the assessment report code passed the suite.

  • New test in Invoke-InforcerAssessment not assessed checks: runs the cmdlet single-tenant with -OutputPath and checks the rendered HTML for Passed (2), Failed (2), Not Assessed (2), score 50%, and the Entra category's 50% and 2/4 badge.
  • The existing single-tenant and matrix renderer tests now also check that the JS is present: the na filter line, the matrix ? cell (st st-u) and the (t.passed+t.failed) header. These confirm the code is there, not how it behaves in a browser.

All 8 mutations in the run are now caught, including the five that got through before:

  • single-tenant HTML given Failed = TotalChecks - Passed
  • category percentage computed over all checks
  • single-report na filter line removed
  • matrix ? cell branch removed
  • matrix header reverted to t.total

No module code changes, no version bump, no CHANGELOG entry.

Related issue

None. Follow-up to #46.

Checklist

  • Tests pass locally (Invoke-Pester ./Tests: 476 passed, 0 failed, 2 skipped)
  • Comment-based help is complete for any cmdlet I changed (n/a, no cmdlet changes)
  • I followed the consistency contract (n/a, tests only)
  • If I added or changed a cmdlet, I updated docs/CMDLET-REFERENCE.md (n/a)

🤖 Generated with Claude Code

Adds a behavioural test that runs Invoke-InforcerAssessment single-tenant
with -OutputPath and checks the rendered filter counts, score, and the
category percentage and badge. Adds presence checks for the single-report
'na' filter branch and the matrix "?" cell and passed/assessed header.

Mutations now caught that previously survived:
- single-tenant HTML given Failed = TotalChecks - Passed
- category percentage computed over all checks
- single-report 'na' filter line removed
- matrix st-u "?" cell branch removed
- matrix header reverted to t.total

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 22, 2026 19:13

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.

🟢 Approval recommended

The focused test-only changes cover the stated regression gaps without identified blocking issues; tests were not executed during this review.

No open issues 🎉

What changed in this PR

This test-only follow-up to #46 strengthens regression coverage for assessment reports, checking that unassessed checks remain separate from failures and are excluded from scoring.

Changes:

  • Adds a single-tenant HTML test for assessment counts, overall score, and category percentage and badge.
  • Adds source-presence assertions for the Not Assessed filter, matrix ? cell, and assessed-only matrix denominator.
File Description
Tests/​Consistency.Tests.ps1 Adds report-output and JavaScript source assertions for not-assessed handling.

Review effort: Balanced

@royklo
royklo merged commit 45c3d56 into main Oct 22, 2026
4 checks passed
@royklo
royklo deleted the test/assessment-report-coverage branch October 22, 2026 19:28
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.

2 participants