Skip to content

Commit 2c41343

Browse files
authored
fix: Show audit log in production if allowed (#3960)
1 parent 7dc73ed commit 2c41343

File tree

2 files changed

+1
-13
lines changed

2 files changed

+1
-13
lines changed

site/src/components/NavbarView/NavbarView.test.tsx

-11
Original file line numberDiff line numberDiff line change
@@ -69,17 +69,6 @@ describe("NavbarView", () => {
6969
expect((auditLink as HTMLAnchorElement).href).toContain("/audit")
7070
})
7171

72-
it("audit nav link is only visible in development", async () => {
73-
process.env = {
74-
...env,
75-
NODE_ENV: "production",
76-
}
77-
78-
render(<NavbarView user={MockUser} onSignOut={noop} canViewAuditLog />)
79-
const auditLink = screen.queryByText(navLanguage.audit)
80-
expect(auditLink).not.toBeInTheDocument()
81-
})
82-
8372
it("audit nav link is hidden for members", async () => {
8473
render(<NavbarView user={MockUser2} onSignOut={noop} canViewAuditLog={false} />)
8574
const auditLink = screen.queryByText(navLanguage.audit)

site/src/components/NavbarView/NavbarView.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,7 @@ const NavItems: React.FC<
5252
{Language.users}
5353
</NavLink>
5454
</ListItem>
55-
{/* REMARK: the below link is under-construction */}
56-
{process.env.NODE_ENV !== "production" && canViewAuditLog && (
55+
{canViewAuditLog && (
5756
<ListItem button className={styles.item}>
5857
<NavLink className={styles.link} to="/audit">
5958
{Language.audit}

0 commit comments

Comments
 (0)