CEC-2970: Multiple Superset Dashboards (#229)
Co-authored-by: Alexander Andrews <aandrews@fiskerinc.com>
This commit is contained in:
committed by
GitHub
parent
843fddd0b7
commit
2d298368c5
@@ -1,6 +1,7 @@
|
||||
jest.mock("../Contexts/UserContext");
|
||||
jest.mock("../../services/superset")
|
||||
|
||||
import { render, waitFor } from "@testing-library/react";
|
||||
import { render, waitFor, screen } from "@testing-library/react";
|
||||
import { BrowserRouter } from "react-router-dom";
|
||||
import { UserProvider, setToken } from "../Contexts/UserContext";
|
||||
import { TEST_AUTH_OBJECT } from "../../utils/testing";
|
||||
@@ -22,17 +23,15 @@ const renderMenu = async () => {
|
||||
describe("SideMenu", () => {
|
||||
beforeAll(() => {
|
||||
addSnapshotSerializer(expect);
|
||||
});
|
||||
|
||||
it("Unauthenticated", async () => {
|
||||
setToken(null);
|
||||
const container = await renderMenu();
|
||||
expect(container).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it("Authenticated", async () => {
|
||||
setToken(TEST_AUTH_OBJECT);
|
||||
const container = await renderMenu();
|
||||
await waitFor(() => {
|
||||
expect(screen.getByText('Datascope')).toBeInTheDocument()
|
||||
})
|
||||
expect(container).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user