adoptium / adoptium/aqa-test-tools

Create Fixtures and Intercepts for Unit Tests

Open
#590 0 comments 0 reactions 0 assignees View on GitHub
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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.