sillsdev / sillsdev/TheCombine

[frontend testing] Some tests exceed timeout when run locally

Open
#3,557 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug frontend test
Dominant language
TypeScript
Stars
22
Forks
10
Avg merge
2d 2h
Merged PRs (30d)
9

Description

Run npm run test-frontend, then press a to run tests on all the files. Even though all the tests pass in our GHA workflow, running locally often results in errors like this:

Summary of all failing tests
 FAIL  src/components/WordCard/tests/SenseCard.test.tsx (29.532 s)
  ● SenseCard › has an icon for part of speech (if not GramCatGroup.Unspecified)

    thrown: "Exceeded timeout of 5000 ms for a test.
    Add a timeout value to this test to increase the timeout, if this is a long-running test. See https://jestjs.io/docs/api#testname-fn-timeout."

      35 |
      36 | describe("SenseCard", () => {
    > 37 |   it("has an icon for part of speech (if not GramCatGroup.Unspecified)", async () => {
         |   ^
      38 |     const sense = newSense("gloss");
      39 |     await renderSenseCard(sense);
      40 |     expect(() => renderer.root.findByType(PartOfSpeechButton)).toThrow();

      at it (src/components/WordCard/tests/SenseCard.test.tsx:37:3)
      at Object.describe (src/components/WordCard/tests/SenseCard.test.tsx:36:1)

 FAIL  src/components/Login/tests/Signup.test.tsx (30.165 s)
  ● Signup › submit button › errors when email blank

    thrown: "Exceeded timeout of 5000 ms for a test.
    Add a timeout value to this test to increase the timeout, if this is a long-running test. See https://jestjs.io/docs/api#testname-fn-timeout."

      92 | describe("Signup", () => {
      93 |   describe("submit button", () => {
    > 94 |     it("errors when email blank", async () => {
         |     ^
      95 |       await renderSignup();
      96 |       await typeInField(SignupId.FieldEmail, "");
      97 |       await typeInField(SignupId.FieldName, nameValid);

      at it (src/components/Login/tests/Signup.test.tsx:94:5)
      at describe (src/components/Login/tests/Signup.test.tsx:93:3)
      at Object.describe (src/components/Login/tests/Signup.test.tsx:92:1)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Run npm run test-frontend, then press a to reproduce the local failures. Start with src/components/WordCard/tests/SenseCard.test.tsx and src/components/Login/tests/Signup.test.tsx, focusing on the tests named in the timeout output. Done means the frontend test suite passes locally when all files are run.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.