Skip to content

[HOTE-837] feat: unit test quality pass#324

Merged
TSeelig merged 2 commits intomainfrom
feature/hote-837/unit-test-review
Apr 8, 2026
Merged

[HOTE-837] feat: unit test quality pass#324
TSeelig merged 2 commits intomainfrom
feature/hote-837/unit-test-review

Conversation

@TSeelig
Copy link
Copy Markdown
Contributor

@TSeelig TSeelig commented Apr 7, 2026

Description

Context

Type of changes

  • Refactoring (non-breaking change)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would change existing functionality)
  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • I am familiar with the contributing guidelines
  • I have followed the code style of the project
  • I have added tests to cover my changes
  • I have updated the documentation accordingly
  • This PR is a result of pair or mob programming

Sensitive Information Declaration

To ensure the utmost confidentiality and protect your and others privacy, we kindly ask you to NOT including PII (Personal Identifiable Information) / PID (Personal Identifiable Data) or any other sensitive data in this PR (Pull Request) and the codebase changes. We will remove any PR that do contain any sensitive information. We really appreciate your cooperation in this matter.

  • I confirm that neither PII/PID nor sensitive data are included in this PR and the codebase changes.

Copilot AI review requested due to automatic review settings April 7, 2026 17:31
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 7, 2026

UI Coverage Report

Lines Statements Branches Functions
Coverage: 95%
95.5% (5585/5848) 87.26% (651/746) 87.5% (203/232)

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 focuses on improving unit test quality and consistency across the UI and Lambda packages by refactoring test structure, tightening assertions, and removing redundant/low-signal cases.

Changes:

  • Refactors multiple UI tests to use shared beforeEach setup (and reduces repeated render(...) calls), plus small assertion improvements.
  • Improves parameterised tests (it.each) for clarity/maintainability in both UI and Lambda test suites.
  • Adds/adjusts singleton-init assertions in Lambda init tests.

Reviewed changes

Copilot reviewed 20 out of 20 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
ui/src/tests/routes/OrderTrackingPage.test.tsx Import tidy + removes a low-signal “different test types” case.
ui/src/tests/routes/HomeTestTermsOfUsePage.test.tsx Centralises render/cleanup; removes repeated renders per test.
ui/src/tests/routes/HomeTestPrivacyPolicyPage.test.tsx Centralises render/cleanup; removes repeated renders per test.
ui/src/tests/routes/get-self-test-kit-for-HIV-journey/SelectDeliveryAddressPage.test.tsx Centralises render/cleanup; aligns mocked content/title and heading assertion.
ui/src/tests/routes/get-self-test-kit-for-HIV-journey/OrderSubmittedPage.test.tsx Removes a redundant timeline assertion.
ui/src/tests/routes/get-self-test-kit-for-HIV-journey/NoAddressFoundPage.test.tsx Centralises render/cleanup; removes repeated renders per test.
ui/src/tests/routes/get-self-test-kit-for-HIV-journey/EnterAddressManuallyPage.test.tsx Adds a “no error summary when valid” check; removes a redundant submission block.
ui/src/tests/routes/get-self-test-kit-for-HIV-journey/BloodSampleGuidePage.test.tsx Centralises render/cleanup; removes repeated renders per test.
ui/src/tests/lib/utils/base64url.test.ts Converts loops to it.each for clearer parametrised testing.
ui/src/tests/lib/services/la-lookup-service.test.ts Reorders mock setup and trims redundant fetch-call assertions.
ui/src/tests/lib/auth/AuthLoader.test.tsx Updates a helper call to use an InitialEntry object.
ui/src/tests/layouts/FormPageLayout.test.tsx Removes redundant “renders without crashing” test.
ui/src/tests/components/order-status/OrderStatusContent.test.tsx Simplifies it.each datasets for readability.
ui/src/tests/components/NegativeTestResult.test.tsx Centralises render/cleanup; removes repeated renders per test.
ui/src/tests/components/LegalDocumentContent.test.tsx Adds a missing assertion for external-link target behaviour.
ui/src/tests/components/FormBackLink.test.tsx Removes redundant conditional rendering tests; minor selector style tweak.
ui/src/tests/components/FindAnotherSexualHealthClinicLink.test.tsx Adds assertion that link opens in a new tab.
lambdas/src/order-service-lambda/init.test.ts Simplifies it.each usage for env-var coverage.
lambdas/src/lib/db/db-config.test.ts Improves formatting and simplifies it.each datasets.
lambdas/src/eligibility-lookup-lambda/init.test.ts Adds additional singleton reference assertions; adjusts “rejection retry” test (currently broken).

Comment thread lambdas/src/eligibility-lookup-lambda/init.test.ts
@TSeelig TSeelig force-pushed the feature/hote-837/unit-test-review branch from 9248552 to 9cd4972 Compare April 8, 2026 08:38
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 8, 2026

Lambdas Coverage Report

Lines Statements Branches Functions
Coverage: 98%
98.34% (1305/1327) 91.84% (394/429) 96.26% (206/214)

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Apr 8, 2026

@TSeelig TSeelig merged commit 8ac6e3f into main Apr 8, 2026
11 checks passed
@TSeelig TSeelig deleted the feature/hote-837/unit-test-review branch April 8, 2026 10:42
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.

3 participants