mirror of
https://github.com/coder/coder.git
synced 2025-07-15 22:20:27 +00:00
fix: Show audit log in production if allowed (#3960)
This commit is contained in:
@ -69,17 +69,6 @@ describe("NavbarView", () => {
|
||||
expect((auditLink as HTMLAnchorElement).href).toContain("/audit")
|
||||
})
|
||||
|
||||
it("audit nav link is only visible in development", async () => {
|
||||
process.env = {
|
||||
...env,
|
||||
NODE_ENV: "production",
|
||||
}
|
||||
|
||||
render(<NavbarView user={MockUser} onSignOut={noop} canViewAuditLog />)
|
||||
const auditLink = screen.queryByText(navLanguage.audit)
|
||||
expect(auditLink).not.toBeInTheDocument()
|
||||
})
|
||||
|
||||
it("audit nav link is hidden for members", async () => {
|
||||
render(<NavbarView user={MockUser2} onSignOut={noop} canViewAuditLog={false} />)
|
||||
const auditLink = screen.queryByText(navLanguage.audit)
|
||||
|
@ -52,8 +52,7 @@ const NavItems: React.FC<
|
||||
{Language.users}
|
||||
</NavLink>
|
||||
</ListItem>
|
||||
{/* REMARK: the below link is under-construction */}
|
||||
{process.env.NODE_ENV !== "production" && canViewAuditLog && (
|
||||
{canViewAuditLog && (
|
||||
<ListItem button className={styles.item}>
|
||||
<NavLink className={styles.link} to="/audit">
|
||||
{Language.audit}
|
||||
|
Reference in New Issue
Block a user