Merged
Conversation
Contributor
There was a problem hiding this comment.
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
beforeEachsetup (and reduces repeatedrender(...)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). |
9248552 to
9cd4972
Compare
|
cptiv2020
approved these changes
Apr 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Description
Context
Type of changes
Checklist
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.