diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index a5b3a0f..d7ac0fa 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,8 +1,8 @@ # default codeowners -* jwu@fiskerinc.com dtaylor@fiskerinc.com ggetsin@fiskerinc.com +* jwu@fiskerinc.com dtaylor@fiskerinc.com ggetsin@fiskerinc.com bbaker@fiskerinc.com # devops -.github rgreenberg@fiskerinc.com jwu@fiskerinc.com dtaylor@fiskerinc.com ggetsin@fiskerinc.com -Jenkinsfile rgreenberg@fiskerinc.com jwu@fiskerinc.com dtaylor@fiskerinc.com ggetsin@fiskerinc.com -k8s rgreenberg@fiskerinc.com jwu@fiskerinc.com dtaylor@fiskerinc.com ggetsin@fiskerinc.com -Dockerfile rgreenberg@fiskerinc.com jwu@fiskerinc.com dtaylor@fiskerinc.com ggetsin@fiskerinc.com +.github rgreenberg@fiskerinc.com jwu@fiskerinc.com dtaylor@fiskerinc.com ggetsin@fiskerinc.com bbaker@fiskerinc.com +Jenkinsfile rgreenberg@fiskerinc.com jwu@fiskerinc.com dtaylor@fiskerinc.com ggetsin@fiskerinc.com bbaker@fiskerinc.com +k8s rgreenberg@fiskerinc.com jwu@fiskerinc.com dtaylor@fiskerinc.com ggetsin@fiskerinc.com bbaker@fiskerinc.com +Dockerfile rgreenberg@fiskerinc.com jwu@fiskerinc.com dtaylor@fiskerinc.com ggetsin@fiskerinc.com bbaker@fiskerinc.com diff --git a/src/components/App/App.test.js b/src/components/App/App.test.js index cfa8333..2e024cf 100644 --- a/src/components/App/App.test.js +++ b/src/components/App/App.test.js @@ -1,14 +1,22 @@ +jest.mock("../Contexts/CarUpdatesContext"); jest.mock("../Contexts/FileUploadContext"); jest.mock("../Contexts/VehicleContext"); -jest.mock("../Contexts/UserContext"); +jest.mock("../Contexts/ManifestCreateContext"); jest.mock("../Contexts/ManifestsContext"); -jest.mock("../Contexts/CarUpdatesContext"); -jest.mock("../../services/monitoring"); +jest.mock("../Contexts/UserContext"); jest.mock("../../services/grafanaAPI"); +jest.mock("../../services/monitoring"); +jest.mock("../../services/vehiclesAPI"); -import { render, screen, cleanup, waitFor, waitForElementToBeRemoved } from "@testing-library/react"; +import { + render, + screen, + cleanup, + waitFor, + waitForElementToBeRemoved, +} from "@testing-library/react"; import { setToken } from "../Contexts/UserContext"; -import { TEST_AUTH_OBJECT } from "../../utils/testing" +import { TEST_AUTH_OBJECT } from "../../utils/testing"; import App from "."; const LOADING_STATUS = "Loading..."; @@ -30,26 +38,26 @@ const check = async (path, selector, compare) => { const sleepAndCheck = async (path, selector, compare) => { const container = await renderRoute(path); - await waitFor(() => { }); + await waitFor(() => {}); expect(container.querySelector(selector).innerHTML).toEqual(compare); expect(container).toMatchSnapshot(); }; describe("App", () => { beforeAll(() => { - // Stablize Table Pagination control ids + // Stablize Table Pagination control ids expect.addSnapshotSerializer({ test: function (val) { return val && typeof val === "string" && val.indexOf("mui-") >= 0; }, print: function (val) { let str = val; - str = str.replace(/mui-[0-9]*/g, "mui-00000"); + str = str.replace(/mui-\d*/g, "mui-00000"); return `"${str}"`; - } + }, }); - }); + }, 30000); afterEach(() => { setToken(null); @@ -101,9 +109,13 @@ describe("App", () => { }); it("Route /vehicle-status/vin/carupdateid unauthenticated", async () => { - await check("/vehicle-status/1G1FP87S3GN100062/283", "span.MuiButton-label", "Sign In"); + await check( + "/vehicle-status/1G1FP87S3GN100062/283", + "span.MuiButton-label", + "Sign In" + ); }); - + it("Route /page-not-found unauthenticated", async () => { await check("/page-not-found", "h1", "Page Not Found"); }); @@ -169,6 +181,10 @@ describe("App", () => { it("Route /vehicle-status/vin/carupdateid authenticated", async () => { setToken(TEST_AUTH_OBJECT); - await sleepAndCheck("/vehicle-status/1G1FP87S3GN100062/283", "h6", "Vehicle 1G1FP87S3GN100062, Update TEST UPDATE"); + await sleepAndCheck( + "/vehicle-status/1G1FP87S3GN100062/283", + "h6", + "Vehicle 1G1FP87S3GN100062, Update TEST UPDATE" + ); }); }); diff --git a/src/components/App/__snapshots__/App.test.js.snap b/src/components/App/__snapshots__/App.test.js.snap index c76947c..7f14267 100644 --- a/src/components/App/__snapshots__/App.test.js.snap +++ b/src/components/App/__snapshots__/App.test.js.snap @@ -6,10 +6,10 @@ exports[`App Route / authenticated 1`] = ` data-testid="mocked-userprovider" >
Fisker Admin Portal
@@ -239,7 +239,7 @@ exports[`App Route / authenticated 1`] = `
  • 500

    Cars

    @@ -750,16 +750,16 @@ exports[`App Route /datascope authenticated 1`] = ` class="MuiGrid-root MuiGrid-item MuiGrid-grid-md-6" >

    1,234,567,890

    Signals Collected

    @@ -769,10 +769,10 @@ exports[`App Route /datascope authenticated 1`] = ` class="MuiGrid-root MuiGrid-item MuiGrid-grid-md-12" >