diff --git a/src/components/App/App.test.js b/src/components/App/App.test.js index 44c1aba..b1e5178 100644 --- a/src/components/App/App.test.js +++ b/src/components/App/App.test.js @@ -5,6 +5,7 @@ jest.mock("../Contexts/UserContext"); jest.mock("../Contexts/ManifestsContext"); jest.mock("../Contexts/CarUpdatesContext"); jest.mock("../../services/monitoring"); +jest.mock("../../services/grafana"); import { render, screen, cleanup, waitFor, waitForElementToBeRemoved } from "@testing-library/react"; import { setToken } from "../Contexts/UserContext"; @@ -57,11 +58,11 @@ describe("App", () => { }); it("Route / unauthenticated", async () => { - await check("/", "span.MuiButton-label", "Sign In"); + await sleepAndCheck("/", "span.MuiButton-label", "Sign In"); }); it("Route /home unauthenticated", async () => { - await check("/home", "span.MuiButton-label", "Sign In"); + await sleepAndCheck("/home", "span.MuiButton-label", "Sign In"); }); it("Route /vehicle-add unauthenticated", async () => { @@ -85,7 +86,7 @@ describe("App", () => { }); it("Route /datascope unauthenticated", async () => { - await check("/datascope", "span.MuiButton-label", "Sign In"); + await sleepAndCheck("/datascope", "span.MuiButton-label", "Sign In"); }); it("Route /datascope/battery unauthenticated", async () => { @@ -110,12 +111,12 @@ describe("App", () => { it("Route / authenticated", async () => { setToken(TEST_AUTH_OBJECT); - await sleepAndCheck("/", "h1", "Welcome John!"); + await sleepAndCheck("/", "h6", "Home"); }); it("Route /home authenticated", async () => { setToken(TEST_AUTH_OBJECT); - await sleepAndCheck("/home", "h1", "Welcome John!"); + await sleepAndCheck("/home", "h6", "Home"); }); it("Route /vehicle-add authenticated", async () => { @@ -154,7 +155,7 @@ describe("App", () => { it("Route /datascope authenticated", async () => { setToken(TEST_AUTH_OBJECT); - await check("/datascope", "h6", "Datascope"); + await sleepAndCheck("/datascope", "h6", "Datascope"); }); it("Route /datascope/battery authenticated", async () => { diff --git a/src/components/App/__snapshots__/App.test.js.snap b/src/components/App/__snapshots__/App.test.js.snap index a11d353..3def351 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,11 +239,10 @@ exports[`App Route / authenticated 1`] = `
  • @@ -266,24 +265,17 @@ exports[`App Route / authenticated 1`] = `
  • -

    - Welcome - John - ! -

    @@ -422,7 +414,7 @@ exports[`App Route / unauthenticated 1`] = `

    0 Selected
    @@ -820,7 +810,7 @@ exports[`App Route /carupdate-deploy authenticated 1`] = ` style="text-align: right;" >
    VIN sorted ascending @@ -1173,10 +1162,10 @@ exports[`App Route /carupdate-deploy unauthenticated 1`] = ` data-testid="mocked-userprovider" >
    @@ -1747,10 +1732,10 @@ exports[`App Route /datascope authenticated 1`] = ` data-testid="mocked-userprovider" >

    500

    Cars

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

    1,234,567,890

    Signals Collected

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