Skip to content

test(frontend): venue picker test can fail on a page 2 request with no answer #432

Closed

Description

@pdevito3

Problem

A component test in venue-picker.test.tsx failed once in a full pnpm test run, on a change that does not touch it:

FAIL src/examples/venues/components/venue-picker.test.tsx > finds a venue by a search on the Server, and keeps the pick when the search goes
Error: No answer for these requests: GET /api/v1/venues?pageNumber=2&pageSize=10. Answer them with commands.answerRequests.

renderPicker answers this request, so the test's own answers are not the fault.

Evidence

Likely cause (inferred, not proven)

The previous test can end with the list open, so its load-more row can send the page 2 request late. beforeEach in src/test/browser-setup.ts unmounts the page, clears the answers, and drains the unanswered list. Then the next test sets its answers. A request that reaches the dev server after the clear and before those answers gets no answer, and it counts against the next test.

To reproduce

Run pnpm test in frontend/ many times on a loaded machine, and look for the error above. A pause between the clear in beforeEach and the answers of renderPicker may make the failure more frequent. This has not been tried.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions