Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix tests
  • Loading branch information
aslilac committed Jun 3, 2024
commit c3d8207a68af53cba5bdee6937b946d1cf3adcab
7 changes: 6 additions & 1 deletion site/src/modules/dashboard/Navbar/Navbar.test.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { render, screen, waitFor } from "@testing-library/react";
import userEvent from "@testing-library/user-event";
import { HttpResponse, http } from "msw";
import { App } from "App";
import {
Expand All @@ -21,6 +22,8 @@ describe("Navbar", () => {
}),
);
render(<App />);
const deploymentMenu = await screen.findByText("Deployment");
await userEvent.click(deploymentMenu);
await waitFor(
() => {
const link = screen.getByText(Language.audit);
Expand All @@ -34,6 +37,8 @@ describe("Navbar", () => {
// by default, user is an Admin with permission to see the audit log,
// but is unlicensed so not entitled to see the audit log
render(<App />);
const deploymentMenu = await screen.findByText("Deployment");
await userEvent.click(deploymentMenu);
await waitFor(
() => {
const link = screen.queryByText(Language.audit);
Expand All @@ -59,7 +64,7 @@ describe("Navbar", () => {
render(<App />);
await waitFor(
() => {
const link = screen.queryByText(Language.audit);
const link = screen.queryByText("Deployment");
expect(link).toBe(null);
},
{ timeout: 2000 },
Expand Down
2 changes: 1 addition & 1 deletion site/src/modules/dashboard/Navbar/NavbarView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export const Language = {
workspaces: "Workspaces",
templates: "Templates",
users: "Users",
audit: "Audit",
audit: "Auditing",
deployment: "Settings",
};

Expand Down