merging dev into branch

This commit is contained in:
Drew Taylor
2021-07-22 09:53:32 -07:00
26 changed files with 3619 additions and 240 deletions

View File

@@ -2,6 +2,8 @@ jest.mock("../Contexts/FileUploadContext");
jest.mock("../Contexts/VehicleContext");
jest.mock("../Contexts/UpdatesContext");
jest.mock("../Contexts/UserContext");
jest.mock("../Contexts/ManifestsContext");
jest.mock("../Contexts/CarUpdatesContext");
jest.mock("../../services/monitoring");
import { render, screen, cleanup, waitFor, waitForElementToBeRemoved } from "@testing-library/react";
@@ -98,6 +100,18 @@ describe("App", () => {
await check("/dashboard", "span.MuiButton-label", "Sign In");
});
it("Route /manifests unauthenticated", async () => {
await check("/manifests", "span.MuiButton-label", "Sign In");
});
it("Route /manifest-status unauthenticated", async () => {
await check("/manifest-status/1", "span.MuiButton-label", "Sign In");
});
it("Route /manifest-deploy unauthenticated", async () => {
await check("/manifest-deploy/1", "span.MuiButton-label", "Sign In");
});
it("Route / authenticated", async () => {
setToken(TEST_AUTH_OBJECT);
await sleepAndCheck("/", "h1", "Welcome John!");
@@ -162,4 +176,18 @@ describe("App", () => {
await check("/dashboard", "h6", "Dashboard");
});
it("Route /manifests authenticated", async () => {
setToken(TEST_AUTH_OBJECT);
await check("/manifests", "h6", "Deploy Manifest");
});
it("Route /manifest-status authenticated", async () => {
setToken(TEST_AUTH_OBJECT);
await check("/manifest-status/1", "h6", "Manifest Test Manifest 1.0");
});
it("Route /manifest-deploy authenticated", async () => {
setToken(TEST_AUTH_OBJECT);
await check("/manifest-deploy/1", "h6", "Deploy Test Manifest 1.0");
});
});