Revert "CEC-2977 Filter portal access based on auth provider (#231)"
This reverts commit f2f046968e.
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
jest.mock("../Contexts/UserContext");
|
||||
jest.mock("../../services/superset");
|
||||
jest.mock("../../services/superset")
|
||||
|
||||
import { render, screen, waitFor } from "@testing-library/react";
|
||||
import { render, waitFor, screen } from "@testing-library/react";
|
||||
import { BrowserRouter } from "react-router-dom";
|
||||
import addSnapshotSerializer from "../../utils/snapshot";
|
||||
import { TEST_AUTH_OBJECT_FISKER } from "../../utils/testing";
|
||||
import { setToken, UserProvider } from "../Contexts/UserContext";
|
||||
import { UserProvider, setToken } from "../Contexts/UserContext";
|
||||
import { TEST_AUTH_OBJECT } from "../../utils/testing";
|
||||
import SideMenu from "./SideMenu";
|
||||
import addSnapshotSerializer from "../../utils/snapshot";
|
||||
|
||||
const renderMenu = async () => {
|
||||
const { container } = render(
|
||||
@@ -23,20 +23,15 @@ const renderMenu = async () => {
|
||||
describe("SideMenu", () => {
|
||||
beforeAll(() => {
|
||||
addSnapshotSerializer(expect);
|
||||
});
|
||||
|
||||
it("Unauthenticated", async () => {
|
||||
setToken({ idToken: { jwtToken: null } });
|
||||
const container = await renderMenu();
|
||||
expect(container).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it("Authenticated", async () => {
|
||||
setToken(TEST_AUTH_OBJECT_FISKER);
|
||||
setToken(TEST_AUTH_OBJECT);
|
||||
const container = await renderMenu();
|
||||
await waitFor(() => {
|
||||
expect(screen.getByText("Datascope")).toBeInTheDocument();
|
||||
});
|
||||
expect(screen.getByText('Datascope')).toBeInTheDocument()
|
||||
})
|
||||
expect(container).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user