Skip to content

Commit

Permalink
fix frontend tests after ray-project#32089 (ray-project#32097)
Browse files Browse the repository at this point in the history
Signed-off-by: Alan Guo <[email protected]>
  • Loading branch information
alanwguo authored Jan 31, 2023
1 parent dc974cb commit b477f4b
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions dashboard/client/src/pages/metrics/Metrics.component.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,30 +41,28 @@ const MetricsDisabledWrapper = ({ children }: PropsWithChildren<{}>) => {

describe("Metrics", () => {
it("renders", async () => {
expect.assertions(6);
expect.assertions(5);

render(<Metrics newIA />, { wrapper: Wrapper });
await screen.findByText(/View in Grafana/);
expect(screen.getByText(/5 minutes/)).toBeVisible();
expect(screen.getByText(/Tasks/)).toBeVisible();
expect(screen.getByText(/Actors/)).toBeVisible();
expect(screen.getByText(/Scheduler and autoscaler/)).toBeVisible();
expect(screen.getByText(/Node metrics/)).toBeVisible();
expect(screen.getByText(/Tasks and Actors/)).toBeVisible();
expect(screen.getByText(/Ray Resource Usage/)).toBeVisible();
expect(screen.getByText(/Hardware Utilization/)).toBeVisible();
expect(
screen.queryByText(/Grafana or prometheus server not detected./),
).toBeNull();
});

it("renders warning when ", async () => {
expect.assertions(6);
expect.assertions(5);

render(<Metrics newIA />, { wrapper: MetricsDisabledWrapper });
await screen.findByText(/Grafana or prometheus server not detected./);
expect(screen.queryByText(/View in Grafana/)).toBeNull();
expect(screen.queryByText(/5 minutes/)).toBeNull();
expect(screen.queryByText(/Tasks/)).toBeNull();
expect(screen.queryByText(/Actors/)).toBeNull();
expect(screen.queryByText(/Scheduler and autoscaler/)).toBeNull();
expect(screen.queryByText(/Node metrics/)).toBeNull();
expect(screen.queryByText(/Tasks and Actors/)).toBeNull();
expect(screen.queryByText(/Ray Resource Usage/)).toBeNull();
expect(screen.queryByText(/Hardware Utilization/)).toBeNull();
});
});

0 comments on commit b477f4b

Please sign in to comment.