Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit861f521

Browse files
committed
fix test
1 parent03c975c commit861f521

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

‎site/src/modules/dashboard/Navbar/Navbar.test.tsx‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@ import {
33
MockEntitlementsWithAuditLog,
44
MockMemberPermissions,
55
}from"testHelpers/entities";
6+
import{renderWithAuth}from"testHelpers/renderHelpers";
67
import{server}from"testHelpers/server";
7-
import{render,screen,waitFor}from"@testing-library/react";
8+
import{screen,waitFor}from"@testing-library/react";
89
importuserEventfrom"@testing-library/user-event";
910
import{HttpResponse,http}from"msw";
11+
import{Navbar}from"./Navbar";
1012

1113
/**
1214
* The LicenseBanner, mounted above the AppRouter, fetches entitlements. Thus, to test their
@@ -20,7 +22,7 @@ describe("Navbar", () => {
2022
returnHttpResponse.json(MockEntitlementsWithAuditLog);
2123
}),
2224
);
23-
render(<App/>);
25+
renderWithAuth(<Navbar/>);
2426
constdeploymentMenu=awaitscreen.findByText("Admin settings");
2527
awaituserEvent.click(deploymentMenu);
2628
awaitscreen.findByText("Audit Logs");
@@ -29,7 +31,7 @@ describe("Navbar", () => {
2931
it("does not show Audit Log link when not entitled",async()=>{
3032
// by default, user is an Admin with permission to see the audit log,
3133
// but is unlicensed so not entitled to see the audit log
32-
render(<App/>);
34+
renderWithAuth(<Navbar/>);
3335
constdeploymentMenu=awaitscreen.findByText("Admin settings");
3436
awaituserEvent.click(deploymentMenu);
3537
awaitwaitFor(
@@ -53,7 +55,7 @@ describe("Navbar", () => {
5355
returnHttpResponse.json(MockEntitlementsWithAuditLog);
5456
}),
5557
);
56-
render(<App/>);
58+
renderWithAuth(<Navbar/>);
5759
awaitwaitFor(
5860
()=>{
5961
expect(screen.queryByText("Deployment")).not.toBeInTheDocument();

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp