CEC-247, CEC-261 Manifest and ECU display (#65)

* CEC-261 Add ECU list control

* CEC-261 Update vehicle service mock

* CEC-247 Manifest screens

* Fix test

* Remove dynamic dates from mocks

* Remove timezone from mock dates

* Fix test for date string timezone difference
This commit is contained in:
John Wu
2021-07-16 10:49:10 -07:00
committed by GitHub
parent ab37cd598f
commit 83105fb7ca
26 changed files with 3626 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, waitForElementToBeRemoved } from "@testing-library/react";
@@ -91,6 +93,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 check("/", "h1", "Welcome John!");
@@ -155,4 +169,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");
});
});

File diff suppressed because it is too large Load Diff