Altinn / Altinn/app-frontend-react

Some Cypress tests are failing with dev server, but not prod

Open
#3,073 0 comments 0 reactions 0 assignees View on GitHub
kind/bug
Dominant language
TypeScript
Stars
21
Forks
33
Avg merge
6d 23h
Merged PRs (30d)
3

Description

### Description of the bug

Two tests in `frontend-test/components.ts` are failing when running them locally with a dev server for the frontend. That is, they fail when using `yarn start`, but succeed when using `yarn build & yarn serve 8080`.

The failing tests are:
1. 'should display alert on changing dropdown'
2. 'should display alert on changing multiple-select'

### Steps To Reproduce

1. Start the dev frontend server with
`yarn start`
2. Run the Cypress tests for the specific file in question with
`yarn cy:run --spec test/e2e/integration/frontend-test/components.ts`
3. See that 2 tests fail
4. Shut down the dev server
5. Start a prod server with
`yarn build && yarn serve 8080`
6. Run the Cypress tests again with
`yarn cy:run --spec test/e2e/integration/frontend-test/components.ts`
7. See that the previously failing tests succeed

### Additional Information

_No response_

Contributor guide

Open the contributing guide

Research direction

Start the frontend dev server with `yarn start` and run `yarn cy:run --spec test/e2e/integration/frontend-test/components.ts`. Compare the two failing tests, “should display alert on changing dropdown” and “should display alert on changing multiple-select,” with their behavior after `yarn build && yarn serve 8080`; done means both tests pass in both environments.

Written by the indexing model from the issue text.

Assessment

Tech stack
cypress, typescript
Domain
frontend, testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.