diff --git a/.env.dev b/.env.dev index add2ed2..ce1b79c 100644 --- a/.env.dev +++ b/.env.dev @@ -2,4 +2,4 @@ REACT_APP_CERT_SERVICE_URL=https://dev-gw.cloud.fiskerinc.com/certificate REACT_APP_AUTH_SERVICE_URL=https://dev-gw.cloud.fiskerinc.com/compute_auth REACT_APP_UPLOAD_SERVICE_URL=https://dev-gw.cloud.fiskerinc.com/ota_update REACT_APP_AUTH_CALLBACK_URL=https://dev-ota-admin.cloud.fiskerinc.com -REACT_APP_SUPERSET_URL=https://dev-superset.cloud.fiskerinc.com +REACT_APP_SUPERSET_URL=http://superset-dev.fiskercloud.internal/superset/dashboard/8/?native_filters_key=KPnPthpLQ8rT--6PUdsPzQAcwnleRGHk_3dg0PVYfrXc3SE6zZ2x0p7JuerAZ0Pg diff --git a/.env.local b/.env.local index e8d2226..7a58b1b 100644 --- a/.env.local +++ b/.env.local @@ -2,4 +2,4 @@ REACT_APP_AUTH_SERVICE_URL=http://localhost/compute_auth REACT_APP_CERT_SERVICE_URL=http://localhost/certificate REACT_APP_UPLOAD_SERVICE_URL=http://localhost/ota_update REACT_APP_AUTH_CALLBACK_URL=http://localhost:3000 -REACT_APP_SUPERSET_URL=https://dev-superset.cloud.fiskerinc.com +REACT_APP_SUPERSET_URL=http://superset-dev.fiskercloud.internal/superset/dashboard/8/?native_filters_key=KPnPthpLQ8rT--6PUdsPzQAcwnleRGHk_3dg0PVYfrXc3SE6zZ2x0p7JuerAZ0Pg diff --git a/.env.stg b/.env.stg index 70fac71..ae036f3 100644 --- a/.env.stg +++ b/.env.stg @@ -2,4 +2,4 @@ REACT_APP_AUTH_SERVICE_URL=https://stg-gw.cloud.fiskerinc.com/compute_auth REACT_APP_CERT_SERVICE_URL=https://stg-gw.cloud.fiskerinc.com/certificate REACT_APP_UPLOAD_SERVICE_URL=https://stg-gw.cloud.fiskerinc.com/ota_update REACT_APP_AUTH_CALLBACK_URL=https://stg-ota-admin.cloud.fiskerinc.com -REACT_APP_SUPERSET_URL=https://stg-superset.cloud.fiskerinc.com +REACT_APP_SUPERSET_URL=http://superset-dev.fiskercloud.internal/superset/dashboard/8/?native_filters_key=KPnPthpLQ8rT--6PUdsPzQAcwnleRGHk_3dg0PVYfrXc3SE6zZ2x0p7JuerAZ0Pg diff --git a/src/components/App/App.test.js b/src/components/App/App.test.js index e92f442..1c40617 100644 --- a/src/components/App/App.test.js +++ b/src/components/App/App.test.js @@ -17,6 +17,7 @@ import { import { setToken } from "../Contexts/UserContext"; import { TEST_AUTH_OBJECT } from "../../utils/testing"; import App from "."; +import addSnapshotSerializer from "../../utils/snapshot"; const LOADING_STATUS = "Loading..."; @@ -43,32 +44,8 @@ const sleepAndCheck = async (path, selector, compare) => { }; describe("App", () => { - const rxMakeStyles = /makeStyles-(\w+)-(\d+)/gi; - beforeAll(() => { - // Stablize Table Pagination control ids - expect.addSnapshotSerializer({ - test: function (val) { - return val && typeof val === "string" && val.indexOf("mui-") > -1; - }, - print: function (val) { - let str = val; - str = str.replace(/mui-\d*/g, "mui-00000"); - - return `"${str}"`; - }, - }); - expect.addSnapshotSerializer({ - test: (val) => { - return val && typeof val === "string" && val.search(rxMakeStyles) > -1; - }, - print: function (val) { - let str = val; - str = str.replace(rxMakeStyles, "makeStyles-$1-0000"); - - return `"${str}"`; - }, - }); + addSnapshotSerializer(expect); }, 60000); afterEach(() => { @@ -134,7 +111,7 @@ describe("App", () => { it("Route /tools/sms/send unauthenticated", async () => { await check("/tools/sms/send", "span.MuiButton-label", "Sign In"); - }) + }); it("Route /page-not-found unauthenticated", async () => { await check("/page-not-found", "h1", "Page Not Found"); diff --git a/src/components/App/__snapshots__/App.test.js.snap b/src/components/App/__snapshots__/App.test.js.snap index ebc871d..57bb2d5 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" >