Skip to content

Fix test assertions and mock cleanup per code review#31

Merged
AccessiT3ch merged 3 commits intotest/phase1.5-test-coveragefrom
copilot/sub-pr-26-again
Feb 1, 2026
Merged

Fix test assertions and mock cleanup per code review#31
AccessiT3ch merged 3 commits intotest/phase1.5-test-coveragefrom
copilot/sub-pr-26-again

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 1, 2026

Addresses code review feedback on test quality and configuration safety from PR #26.

Test Assertions

Replaced toBeDefined() with not.toBeNull() for querySelector() results (12 instances across 3 files). toBeDefined() passes for null, creating false positives:

// Before: passes even when modal doesn't exist
const modal = document.querySelector('.modal.show');
expect(modal).toBeDefined();  // ✗ null is defined

// After: correctly fails when element missing
expect(modal).not.toBeNull();  // ✓ fails on null

Mock Hygiene

Saved and restored window.open in 4 errorBoundary.test.jsx tests to prevent leakage between test runs.

Code Cleanup

  • Removed .vscode/settings.json (auto-approved git push/git commit - unsafe for contributors/CI)
  • Removed unused NavigatableRights helper and imports from rights.test.jsx
  • Removed tautological test checking for non-existent modal element

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits February 1, 2026 21:03
…Null and fix window.open mocking

Co-authored-by: AccessiT3ch <95449364+AccessiT3ch@users.noreply.github.com>
…undant test

Co-authored-by: AccessiT3ch <95449364+AccessiT3ch@users.noreply.github.com>
Copilot AI changed the title [WIP] Establish test coverage baseline for RedCards application Fix test assertions and mock cleanup per code review Feb 1, 2026
Copilot AI requested a review from AccessiT3ch February 1, 2026 21:08
@AccessiT3ch AccessiT3ch marked this pull request as ready for review February 1, 2026 21:08
@AccessiT3ch AccessiT3ch merged commit 02c0b96 into test/phase1.5-test-coverage Feb 1, 2026
1 check passed
@AccessiT3ch AccessiT3ch deleted the copilot/sub-pr-26-again branch February 1, 2026 21:09
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