CEC-2970: Multiple Superset Dashboards (#229)

Co-authored-by: Alexander Andrews <aandrews@fiskerinc.com>
This commit is contained in:
Alexander Andrews
2022-11-02 14:37:08 -04:00
committed by GitHub
parent 843fddd0b7
commit 2d298368c5
9 changed files with 4406 additions and 501 deletions

View File

@@ -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();
});
});