File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed
site/src/modules/dashboard/Navbar Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change 1
1
import { render , screen , waitFor } from "@testing-library/react" ;
2
+ import userEvent from "@testing-library/user-event" ;
2
3
import { HttpResponse , http } from "msw" ;
3
4
import { App } from "App" ;
4
5
import {
@@ -21,6 +22,8 @@ describe("Navbar", () => {
21
22
} ) ,
22
23
) ;
23
24
render ( < App /> ) ;
25
+ const deploymentMenu = await screen . findByText ( "Deployment" ) ;
26
+ await userEvent . click ( deploymentMenu ) ;
24
27
await waitFor (
25
28
( ) => {
26
29
const link = screen . getByText ( Language . audit ) ;
@@ -34,6 +37,8 @@ describe("Navbar", () => {
34
37
// by default, user is an Admin with permission to see the audit log,
35
38
// but is unlicensed so not entitled to see the audit log
36
39
render ( < App /> ) ;
40
+ const deploymentMenu = await screen . findByText ( "Deployment" ) ;
41
+ await userEvent . click ( deploymentMenu ) ;
37
42
await waitFor (
38
43
( ) => {
39
44
const link = screen . queryByText ( Language . audit ) ;
@@ -59,7 +64,7 @@ describe("Navbar", () => {
59
64
render ( < App /> ) ;
60
65
await waitFor (
61
66
( ) => {
62
- const link = screen . queryByText ( Language . audit ) ;
67
+ const link = screen . queryByText ( "Deployment" ) ;
63
68
expect ( link ) . toBe ( null ) ;
64
69
} ,
65
70
{ timeout : 2000 } ,
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ export const Language = {
40
40
workspaces : "Workspaces" ,
41
41
templates : "Templates" ,
42
42
users : "Users" ,
43
- audit : "Audit " ,
43
+ audit : "Auditing " ,
44
44
deployment : "Settings" ,
45
45
} ;
46
46
You can’t perform that action at this time.
0 commit comments