CEC-3301, CEC-3317 Magna security dll and remote commands (#249)

* CEC-3301, CEC-3317 Magna security dll and remote commands

* Fix test
This commit is contained in:
John Wu
2022-12-12 10:59:30 -08:00
committed by GitHub
parent 8e1b01b651
commit 2ec340efc5
28 changed files with 644 additions and 71 deletions

View File

@@ -8,17 +8,14 @@ jest.mock("../../services/vehiclesAPI");
jest.mock("../../services/superset")
import {
act,
render,
screen,
cleanup,
waitFor,
waitForElementToBeRemoved,
act, cleanup, render,
screen, waitFor,
waitForElementToBeRemoved
} from "@testing-library/react";
import { setToken } from "../Contexts/UserContext";
import {TEST_AUTH_OBJECT, TEST_AUTH_OBJECT_FISKER} from "../../utils/testing";
import App from ".";
import addSnapshotSerializer from "../../utils/snapshot";
import { TEST_AUTH_OBJECT_FISKER, TEST_AUTH_OBJECT_MAGNA } from "../../utils/testing";
import { setToken } from "../Contexts/UserContext";
const LOADING_STATUS = "Loading...";
@@ -113,9 +110,14 @@ describe("App", () => {
await check("/tools/sms/send", "span.MuiButton-label", "Sign In");
});
it("Route /tools/security-dll unauthenticated", async () => {
await check("/tools/security-dll", "span.MuiButton-label", "Sign In");
});
it("Route /page-not-found unauthenticated", async () => {
await check("/page-not-found", "h1", "Page Not Found");
});
it("Route / authenticated", async () => {
setToken(TEST_AUTH_OBJECT_FISKER);
await sleepAndCheck("/", "h6", "Home");
@@ -170,4 +172,9 @@ describe("App", () => {
setToken(TEST_AUTH_OBJECT_FISKER);
await sleepAndCheck("/tools/sms/send", "h6", "Send SMS");
});
it("Route /tools/security-dll authenticated", async () => {
setToken(TEST_AUTH_OBJECT_MAGNA);
await sleepAndCheck("/tools/security-dll", "h6", "Security.dll Download");
});
});