Skip to content

Commit

Permalink
Fix failing test in metricChooser component #3456
Browse files Browse the repository at this point in the history
  • Loading branch information
Nereboss committed Jun 10, 2024
1 parent 0111d73 commit a08ecc1
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ describe("metricChooserComponent", () => {
{ name: "bMetric", maxValue: 2 },
{ name: "cMetric", maxValue: 3 },
{ name: "fullMetric", maxValue: 42 },
{ name: "mcc", maxValue: 55 }
{ name: "complexity", maxValue: 55 }
]
}
},
Expand Down Expand Up @@ -61,7 +61,7 @@ describe("metricChooserComponent", () => {
"FullTestTitle (fullMetric):\nFullTestDescription\nHigh Values: FullTestHigh\nLow Values: FullLowValue"
)
)
await waitFor(() => expect(screen.queryAllByRole("option")[4].textContent).toMatch("mcc (55)"))
await waitFor(() => expect(screen.queryAllByRole("option")[4].textContent).toMatch("complexity (55)"))
await waitFor(() => expect(screen.queryAllByRole("option")[4].getAttribute("title")).toMatch("Cyclomatic Complexity"))

await userEvent.click(screen.queryAllByRole("option")[1])
Expand Down Expand Up @@ -127,7 +127,7 @@ describe("metricChooserComponent", () => {
await waitFor(() => expect(screen.getByPlaceholderText("search metric (max value)")).toBeTruthy())
expect(document.activeElement).toBe(getSearchBox())

await userEvent.type(getSearchBox(), "l")
await userEvent.type(getSearchBox(), "ll")
await waitFor(() => expect(screen.queryAllByRole("option").length).toBe(1))
await waitFor(() => expect(screen.queryAllByRole("option")[0].textContent).toMatch(" fullMetric (42) FullTestDescription "))
await waitFor(() => expect(setActiveItemSpy).toHaveBeenCalledWith(0))
Expand Down

0 comments on commit a08ecc1

Please sign in to comment.