adoptium / adoptium/aqa-test-tools
Create Fixtures and Intercepts for Unit Tests
- Dominant language
- Jupyter Notebook
- Stars
- 33
- Forks
- 97
- Avg merge
- 7h 9m
- Merged PRs (30d)
- 5
Description
Related to #588, we should mock endpoints and payloads to our Cypress unit tests so that we can test component rendering independent from relying on network calls from a functioning service.
- Look at [Cypress intercept](https://docs.cypress.io/api/commands/intercept#Syntax) to mock endpoints
- Look at [Cypress fixtures](https://docs.cypress.io/api/commands/fixture#Usage) to mock payload objects
We should be mocking endpoints so that Cypress can independently test if the front-end renders and handles network requests appropriately. We should also be mocking our payload so that it mimics a subset of an actual dataset.
TODO:
1. Intercept calls to: `getParents`, `getAllTestsWithHistory` with a buildId of choice
2. Create a fixture that reflects the payload structure of the network calls.
Contributor guide
Research direction
Start with the existing Cypress unit tests and inspect how they call getParents and getAllTestsWithHistory, then review the linked Cypress intercept and fixture documentation. Done means both endpoints are intercepted with a chosen buildId and a fixture reflects the network payload structure so rendering and request handling can be tested without a live service.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cypress
- Domain
- frontend, testing
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100