Skip to content

Commit

Permalink
Deflake TypeScript test (#4100)
Browse files Browse the repository at this point in the history
  • Loading branch information
mauriceyap authored Dec 18, 2024
1 parent 3824bcd commit 9967a86
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
4 changes: 2 additions & 2 deletions internal/lookout/ui/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ yarn dev
Unit tests are run using [Vitest](https://vitest.dev/).

```bash
yarn test --watch=false
yarn test --run
```

If you are actively changing unit tests or code covered by unit tests, you may
find it useful to omit `--watch=false` to continuously run affected tests.
find it useful to omit `--run` to continuously run affected tests.

### Lint

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -551,12 +551,16 @@ describe("JobsTableContainer", () => {

await expandRow("job-set-1")

await clickOnJobRow(jobs[0].jobId)

expect(router.state.location.search).toContain("g[0]=jobSet")
expect(router.state.location.search).not.toContain("g[1]")
expect(router.state.location.search).toContain(`sb=${jobs[0].jobId}`)
expect(router.state.location.search).toContain("e[0]=jobSet%3Ajob-set-1")
await waitFor(
async () => {
await clickOnJobRow(jobs[0].jobId)
expect(router.state.location.search).toContain("g[0]=jobSet")
expect(router.state.location.search).not.toContain("g[1]")
expect(router.state.location.search).toContain(`sb=${jobs[0].jobId}`)
expect(router.state.location.search).toContain("e[0]=jobSet%3Ajob-set-1")
},
{ timeout: 3000 },
)
})

it("should populate table state from query params", async () => {
Expand Down

0 comments on commit 9967a86

Please sign in to comment.