CCM-18631: stabilise component tests#602
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR aims to stabilise the Playwright component tests by making test data creation deterministic (returning created letter IDs) and waiting for expected DynamoDB state before exercising API operations, reducing reliance on pre-seeded/global test data.
Changes:
- Update the test-data CLI helper to capture and return created letter IDs from command output.
- Refactor component tests to create their own letters and wait for the expected status instead of querying “any pending letters”.
- Adjust queue visibility timestamp assertions and update internal-dev mTLS secret configuration.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/helpers/pnpm-helpers.ts | Capture CLI stdout and return created LETTER_IDS to callers. |
| tests/helpers/generate-fetch-test-data.ts | Make createTestData return IDs; expand DynamoDB projection for waitForLetterStatus. |
| tests/config/global-setup.ts | Remove global creation of test letters during setup. |
| tests/component-tests/letterQueue-tests/queue-operations.spec.ts | Make visibility timeout assertion less timing-sensitive. |
| tests/component-tests/apiGateway-tests/update-multiple-letter-status.spec.ts | Use created IDs + waitForLetterStatus instead of querying by supplier. |
| tests/component-tests/apiGateway-tests/update-letter-status.spec.ts | Create and wait for letters per-test instead of shared beforeAll query. |
| tests/component-tests/apiGateway-tests/get-letter-status.spec.ts | Create a letter and wait for status before GET-by-id assertions. |
| tests/component-tests/apiGateway-tests/get-letter-pdf.spec.ts | Switch to deterministic creation/wait flow; remove a brittle 404 test. |
| specification/api/components/environments/internal-dev/target.yml | Update internal-dev mTLS secret name. |
Namitha-Prabhu
previously approved these changes
Jun 1, 2026
bbffbd3 to
68852ef
Compare
masl2
approved these changes
Jun 1, 2026
|
|
||
| logger.info( | ||
| `Supplier ${supplierId} allocated for domainId ${domainId} in supplier allocator lambda`, | ||
| `Supplier ${supplierId} allocated to letter ${domainId} in supplier allocator lambda`, |
Contributor
There was a problem hiding this comment.
why do we call it letter, but the variable is called domainId?
| supplierAllocatorLog.msg?.allocationDetails?.supplierSpec?.supplierId; | ||
|
|
||
| logger.info( | ||
| `Supplier ${supplierId} allocated for domainId ${domainId} in supplier allocator lambda`, |
Contributor
There was a problem hiding this comment.
same as above comment
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
Removes global setup letter creation.
Uses the letterIds sent by the utility.
Each test creates its own letters.
Context
Type of changes
Checklist
DT3-Specific 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.