-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cleanup: Remove checks for KeycloakSso test group in frontend code (#…
- Loading branch information
1 parent
a9a862e
commit 44c33ec
Showing
7 changed files
with
46 additions
and
126 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,8 +7,6 @@ import * as browser from "../../../src/models/browser" | |
import { openDrift } from "../../../src/helpers/drift" | ||
import NavMenu from "../../../src/components/nav/navMenu" | ||
import { BrowserRouter } from "react-router-dom" | ||
import getTestGroups from "../../../src/userTestGroups" | ||
import { TestGroups } from "../../../src/userInTestGroup" | ||
import getEmailAddress from "../../../src/userEmailAddress" | ||
|
||
jest.mock("../../../src/helpers/drift", () => ({ | ||
|
@@ -81,7 +79,6 @@ describe("NavMenu", () => { | |
}) | ||
|
||
test("shows who is logged in", async () => { | ||
jest.mocked(getTestGroups).mockReturnValue([TestGroups.KeycloakSso]) | ||
jest.mocked(getEmailAddress).mockReturnValue("[email protected]") | ||
|
||
render( | ||
|
@@ -93,20 +90,7 @@ describe("NavMenu", () => { | |
expect(await screen.findByText("Logged in as")).toBeVisible() | ||
}) | ||
|
||
test("does not show who is logged in if the user isn't in the Keycloak test group", () => { | ||
jest.mocked(getTestGroups).mockReturnValue([]) | ||
|
||
render( | ||
<BrowserRouter> | ||
<NavMenu toggleMobileMenu={jest.fn()} mobileMenuIsOpen={true} /> | ||
</BrowserRouter> | ||
) | ||
|
||
expect(screen.queryByText("Logged in as")).not.toBeInTheDocument() | ||
}) | ||
|
||
test("shows logout button", async () => { | ||
jest.mocked(getTestGroups).mockReturnValue([TestGroups.KeycloakSso]) | ||
jest.mocked(getEmailAddress).mockReturnValue("[email protected]") | ||
|
||
render( | ||
|
@@ -118,20 +102,6 @@ describe("NavMenu", () => { | |
expect(screen.getByRole("link", { name: "Logout" })).toBeVisible() | ||
}) | ||
|
||
test("doesn't show logout button if the user isn't in the Keycloak test group", async () => { | ||
jest.mocked(getTestGroups).mockReturnValue([]) | ||
|
||
render( | ||
<BrowserRouter> | ||
<NavMenu toggleMobileMenu={jest.fn()} mobileMenuIsOpen={true} /> | ||
</BrowserRouter> | ||
) | ||
|
||
expect( | ||
screen.queryByRole("link", { name: "Logout" }) | ||
).not.toBeInTheDocument() | ||
}) | ||
|
||
test("refresh button reloads the page", async () => { | ||
const reloadSpy = jest | ||
.spyOn(browser, "reload") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters