CEC-1230 Datascope opens iframe dashboard (#174)
* CEC-1230 Datascope opens iframe dashboard * Clean up
This commit is contained in:
@@ -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");
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -15,11 +15,11 @@ exports[`CANFiltersAdd Render 1`] = `
|
||||
data-testid="mocked-canfiltersprovider"
|
||||
>
|
||||
<div
|
||||
class="makeStyles-paper-3"
|
||||
class="makeStyles-paper-0"
|
||||
>
|
||||
<form
|
||||
action="{onSubmit}"
|
||||
class="makeStyles-form-5"
|
||||
class="makeStyles-form-0"
|
||||
novalidate=""
|
||||
>
|
||||
<div
|
||||
@@ -56,10 +56,10 @@ exports[`CANFiltersAdd Render 1`] = `
|
||||
/>
|
||||
<fieldset
|
||||
aria-hidden="true"
|
||||
class="PrivateNotchedOutline-root-62 MuiOutlinedInput-notchedOutline"
|
||||
class="PrivateNotchedOutline-root-63 MuiOutlinedInput-notchedOutline"
|
||||
>
|
||||
<legend
|
||||
class="PrivateNotchedOutline-legendLabelled-64"
|
||||
class="PrivateNotchedOutline-legendLabelled-65"
|
||||
>
|
||||
<span>
|
||||
VIN
|
||||
@@ -102,10 +102,10 @@ exports[`CANFiltersAdd Render 1`] = `
|
||||
/>
|
||||
<fieldset
|
||||
aria-hidden="true"
|
||||
class="PrivateNotchedOutline-root-62 MuiOutlinedInput-notchedOutline"
|
||||
class="PrivateNotchedOutline-root-63 MuiOutlinedInput-notchedOutline"
|
||||
>
|
||||
<legend
|
||||
class="PrivateNotchedOutline-legendLabelled-64"
|
||||
class="PrivateNotchedOutline-legendLabelled-65"
|
||||
>
|
||||
<span>
|
||||
CAN ID
|
||||
@@ -140,10 +140,10 @@ exports[`CANFiltersAdd Render 1`] = `
|
||||
/>
|
||||
<fieldset
|
||||
aria-hidden="true"
|
||||
class="PrivateNotchedOutline-root-62 MuiOutlinedInput-notchedOutline"
|
||||
class="PrivateNotchedOutline-root-63 MuiOutlinedInput-notchedOutline"
|
||||
>
|
||||
<legend
|
||||
class="PrivateNotchedOutline-legendLabelled-64"
|
||||
class="PrivateNotchedOutline-legendLabelled-65"
|
||||
>
|
||||
<span>
|
||||
Interval
|
||||
@@ -153,7 +153,7 @@ exports[`CANFiltersAdd Render 1`] = `
|
||||
</div>
|
||||
</div>
|
||||
<button
|
||||
class="MuiButtonBase-root MuiButton-root MuiButton-contained makeStyles-submit-6 MuiButton-containedPrimary MuiButton-fullWidth"
|
||||
class="MuiButtonBase-root MuiButton-root MuiButton-contained makeStyles-submit-0 MuiButton-containedPrimary MuiButton-fullWidth"
|
||||
tabindex="0"
|
||||
type="submit"
|
||||
>
|
||||
|
||||
@@ -9,7 +9,8 @@ import { CANFiltersProvider } from "../../Contexts/CANFiltersContext";
|
||||
import { StatusProvider } from "../../Contexts/StatusContext";
|
||||
import { UserProvider, setToken } from "../../Contexts/UserContext";
|
||||
import { TEST_AUTH_OBJECT } from "../../../utils/testing";
|
||||
import MainForm from "./index"
|
||||
import MainForm from "./index";
|
||||
import addSnapshotSerializer from "../../../utils/snapshot";
|
||||
|
||||
const renderCANFiltersAdd = async () => {
|
||||
const { container } = render(
|
||||
@@ -20,14 +21,19 @@ const renderCANFiltersAdd = async () => {
|
||||
<MainForm />
|
||||
</BrowserRouter>
|
||||
</UserProvider>
|
||||
</StatusProvider>f
|
||||
</StatusProvider>
|
||||
f
|
||||
</CANFiltersProvider>
|
||||
);
|
||||
await waitFor(() => { });
|
||||
await waitFor(() => {});
|
||||
return container;
|
||||
};
|
||||
|
||||
describe("CANFiltersAdd", () => {
|
||||
beforeAll(() => {
|
||||
addSnapshotSerializer(expect);
|
||||
});
|
||||
|
||||
it("Render", async () => {
|
||||
setToken(TEST_AUTH_OBJECT);
|
||||
const container = await renderCANFiltersAdd();
|
||||
|
||||
@@ -15,16 +15,16 @@ exports[`CANFiltersTable Render 1`] = `
|
||||
data-testid="mocked-canfiltersprovider"
|
||||
>
|
||||
<div
|
||||
class="makeStyles-paper-3 makeStyles-tableSize-53"
|
||||
class="makeStyles-paper-0 makeStyles-tableSize-0"
|
||||
>
|
||||
<div
|
||||
class="MuiGrid-root makeStyles-root-14 MuiGrid-container MuiGrid-spacing-xs-2"
|
||||
class="MuiGrid-root makeStyles-root-0 MuiGrid-container MuiGrid-spacing-xs-2"
|
||||
>
|
||||
<div
|
||||
class="MuiGrid-root makeStyles-textJustifyAlign-47 MuiGrid-item MuiGrid-grid-md-4"
|
||||
class="MuiGrid-root makeStyles-textJustifyAlign-0 MuiGrid-item MuiGrid-grid-md-4"
|
||||
>
|
||||
<a
|
||||
class="makeStyles-labelInline-9"
|
||||
class="makeStyles-labelInline-0"
|
||||
href="/filter-add?vin=undefined"
|
||||
>
|
||||
<svg
|
||||
@@ -40,10 +40,10 @@ exports[`CANFiltersTable Render 1`] = `
|
||||
</a>
|
||||
</div>
|
||||
<div
|
||||
class="MuiGrid-root makeStyles-textCenterAlign-48 MuiGrid-item MuiGrid-grid-md-8"
|
||||
class="MuiGrid-root makeStyles-textCenterAlign-0 MuiGrid-item MuiGrid-grid-md-8"
|
||||
>
|
||||
<div
|
||||
class="MuiFormControl-root makeStyles-margin-28 makeStyles-fullWidth-50"
|
||||
class="MuiFormControl-root makeStyles-margin-0 makeStyles-fullWidth-0"
|
||||
>
|
||||
<label
|
||||
class="MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated"
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
jest.mock("../../Contexts/CANFiltersContext");
|
||||
jest.mock("../../Contexts/StatusContext");
|
||||
jest.mock("../../Contexts/UserContext");
|
||||
jest.mock('@material-ui/core/utils/unstable_useId', () =>
|
||||
jest.fn().mockReturnValue('mui-test-id'),
|
||||
jest.mock("@material-ui/core/utils/unstable_useId", () =>
|
||||
jest.fn().mockReturnValue("mui-test-id")
|
||||
);
|
||||
|
||||
import { render, waitFor } from "@testing-library/react";
|
||||
@@ -12,7 +12,8 @@ import { CANFiltersProvider } from "../../Contexts/CANFiltersContext";
|
||||
import { StatusProvider } from "../../Contexts/StatusContext";
|
||||
import { UserProvider, setToken } from "../../Contexts/UserContext";
|
||||
import { TEST_AUTH_OBJECT } from "../../../utils/testing";
|
||||
import MainForm from "./index"
|
||||
import MainForm from "./index";
|
||||
import addSnapshotSerializer from "../../../utils/snapshot";
|
||||
|
||||
const renderCANFiltersTable = async () => {
|
||||
const { container } = render(
|
||||
@@ -26,11 +27,15 @@ const renderCANFiltersTable = async () => {
|
||||
</StatusProvider>
|
||||
</CANFiltersProvider>
|
||||
);
|
||||
await waitFor(() => { });
|
||||
await waitFor(() => {});
|
||||
return container;
|
||||
};
|
||||
|
||||
describe("CANFiltersTable", () => {
|
||||
beforeAll(() => {
|
||||
addSnapshotSerializer(expect);
|
||||
});
|
||||
|
||||
it("Render", async () => {
|
||||
setToken(TEST_AUTH_OBJECT);
|
||||
const container = await renderCANFiltersTable();
|
||||
|
||||
@@ -15,11 +15,11 @@ exports[`CANFiltersUpdate Render 1`] = `
|
||||
data-testid="mocked-canfiltersprovider"
|
||||
>
|
||||
<div
|
||||
class="makeStyles-paper-3"
|
||||
class="makeStyles-paper-0"
|
||||
>
|
||||
<form
|
||||
action="{onSubmit}"
|
||||
class="makeStyles-form-5"
|
||||
class="makeStyles-form-0"
|
||||
novalidate=""
|
||||
>
|
||||
<div
|
||||
@@ -56,10 +56,10 @@ exports[`CANFiltersUpdate Render 1`] = `
|
||||
/>
|
||||
<fieldset
|
||||
aria-hidden="true"
|
||||
class="PrivateNotchedOutline-root-62 MuiOutlinedInput-notchedOutline"
|
||||
class="PrivateNotchedOutline-root-63 MuiOutlinedInput-notchedOutline"
|
||||
>
|
||||
<legend
|
||||
class="PrivateNotchedOutline-legendLabelled-64"
|
||||
class="PrivateNotchedOutline-legendLabelled-65"
|
||||
>
|
||||
<span>
|
||||
VIN
|
||||
@@ -103,10 +103,10 @@ exports[`CANFiltersUpdate Render 1`] = `
|
||||
/>
|
||||
<fieldset
|
||||
aria-hidden="true"
|
||||
class="PrivateNotchedOutline-root-62 MuiOutlinedInput-notchedOutline"
|
||||
class="PrivateNotchedOutline-root-63 MuiOutlinedInput-notchedOutline"
|
||||
>
|
||||
<legend
|
||||
class="PrivateNotchedOutline-legendLabelled-64"
|
||||
class="PrivateNotchedOutline-legendLabelled-65"
|
||||
>
|
||||
<span>
|
||||
CAN ID
|
||||
@@ -149,10 +149,10 @@ exports[`CANFiltersUpdate Render 1`] = `
|
||||
/>
|
||||
<fieldset
|
||||
aria-hidden="true"
|
||||
class="PrivateNotchedOutline-root-62 MuiOutlinedInput-notchedOutline"
|
||||
class="PrivateNotchedOutline-root-63 MuiOutlinedInput-notchedOutline"
|
||||
>
|
||||
<legend
|
||||
class="PrivateNotchedOutline-legendLabelled-64"
|
||||
class="PrivateNotchedOutline-legendLabelled-65"
|
||||
>
|
||||
<span>
|
||||
Interval
|
||||
@@ -163,7 +163,7 @@ exports[`CANFiltersUpdate Render 1`] = `
|
||||
</div>
|
||||
</div>
|
||||
<button
|
||||
class="MuiButtonBase-root MuiButton-root MuiButton-contained makeStyles-submit-6 MuiButton-containedPrimary MuiButton-fullWidth"
|
||||
class="MuiButtonBase-root MuiButton-root MuiButton-contained makeStyles-submit-0 MuiButton-containedPrimary MuiButton-fullWidth"
|
||||
tabindex="0"
|
||||
type="submit"
|
||||
>
|
||||
|
||||
@@ -9,7 +9,8 @@ import { CANFiltersProvider } from "../../Contexts/CANFiltersContext";
|
||||
import { StatusProvider } from "../../Contexts/StatusContext";
|
||||
import { UserProvider, setToken } from "../../Contexts/UserContext";
|
||||
import { TEST_AUTH_OBJECT } from "../../../utils/testing";
|
||||
import MainForm from "./index"
|
||||
import MainForm from "./index";
|
||||
import addSnapshotSerializer from "../../../utils/snapshot";
|
||||
|
||||
const renderCANFiltersUpdate = async () => {
|
||||
const { container } = render(
|
||||
@@ -23,11 +24,15 @@ const renderCANFiltersUpdate = async () => {
|
||||
</StatusProvider>
|
||||
</CANFiltersProvider>
|
||||
);
|
||||
await waitFor(() => { });
|
||||
await waitFor(() => {});
|
||||
return container;
|
||||
};
|
||||
|
||||
describe("CANFiltersUpdate", () => {
|
||||
beforeAll(() => {
|
||||
addSnapshotSerializer(expect);
|
||||
});
|
||||
|
||||
it("Render", async () => {
|
||||
setToken(TEST_AUTH_OBJECT);
|
||||
const container = await renderCANFiltersUpdate();
|
||||
|
||||
@@ -15,11 +15,11 @@ exports[`VehicleAddForm Render 1`] = `
|
||||
data-testid="mocked-vehicleprovider"
|
||||
>
|
||||
<div
|
||||
class="makeStyles-paper-3"
|
||||
class="makeStyles-paper-0"
|
||||
>
|
||||
<form
|
||||
action="{onSubmit}"
|
||||
class="makeStyles-form-5"
|
||||
class="makeStyles-form-0"
|
||||
novalidate=""
|
||||
>
|
||||
<div
|
||||
@@ -55,10 +55,10 @@ exports[`VehicleAddForm Render 1`] = `
|
||||
/>
|
||||
<fieldset
|
||||
aria-hidden="true"
|
||||
class="PrivateNotchedOutline-root-62 MuiOutlinedInput-notchedOutline"
|
||||
class="PrivateNotchedOutline-root-63 MuiOutlinedInput-notchedOutline"
|
||||
>
|
||||
<legend
|
||||
class="PrivateNotchedOutline-legendLabelled-64"
|
||||
class="PrivateNotchedOutline-legendLabelled-65"
|
||||
>
|
||||
<span>
|
||||
VIN
|
||||
@@ -101,10 +101,10 @@ exports[`VehicleAddForm Render 1`] = `
|
||||
/>
|
||||
<fieldset
|
||||
aria-hidden="true"
|
||||
class="PrivateNotchedOutline-root-62 MuiOutlinedInput-notchedOutline"
|
||||
class="PrivateNotchedOutline-root-63 MuiOutlinedInput-notchedOutline"
|
||||
>
|
||||
<legend
|
||||
class="PrivateNotchedOutline-legendLabelled-64 PrivateNotchedOutline-legendNotched-65"
|
||||
class="PrivateNotchedOutline-legendLabelled-65 PrivateNotchedOutline-legendNotched-66"
|
||||
>
|
||||
<span>
|
||||
Model
|
||||
@@ -148,10 +148,10 @@ exports[`VehicleAddForm Render 1`] = `
|
||||
/>
|
||||
<fieldset
|
||||
aria-hidden="true"
|
||||
class="PrivateNotchedOutline-root-62 MuiOutlinedInput-notchedOutline"
|
||||
class="PrivateNotchedOutline-root-63 MuiOutlinedInput-notchedOutline"
|
||||
>
|
||||
<legend
|
||||
class="PrivateNotchedOutline-legendLabelled-64 PrivateNotchedOutline-legendNotched-65"
|
||||
class="PrivateNotchedOutline-legendLabelled-65 PrivateNotchedOutline-legendNotched-66"
|
||||
>
|
||||
<span>
|
||||
Year
|
||||
@@ -195,10 +195,10 @@ exports[`VehicleAddForm Render 1`] = `
|
||||
/>
|
||||
<fieldset
|
||||
aria-hidden="true"
|
||||
class="PrivateNotchedOutline-root-62 MuiOutlinedInput-notchedOutline"
|
||||
class="PrivateNotchedOutline-root-63 MuiOutlinedInput-notchedOutline"
|
||||
>
|
||||
<legend
|
||||
class="PrivateNotchedOutline-legendLabelled-64 PrivateNotchedOutline-legendNotched-65"
|
||||
class="PrivateNotchedOutline-legendLabelled-65 PrivateNotchedOutline-legendNotched-66"
|
||||
>
|
||||
<span>
|
||||
Trim
|
||||
@@ -225,19 +225,19 @@ exports[`VehicleAddForm Render 1`] = `
|
||||
>
|
||||
<span
|
||||
aria-disabled="false"
|
||||
class="MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-66 MuiRadio-root MuiRadio-colorSecondary MuiIconButton-colorSecondary"
|
||||
class="MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-67 MuiRadio-root MuiRadio-colorSecondary MuiIconButton-colorSecondary"
|
||||
>
|
||||
<span
|
||||
class="MuiIconButton-label"
|
||||
>
|
||||
<input
|
||||
class="PrivateSwitchBase-input-69"
|
||||
class="PrivateSwitchBase-input-70"
|
||||
name="log-level-group"
|
||||
type="radio"
|
||||
value="trace"
|
||||
/>
|
||||
<div
|
||||
class="PrivateRadioButtonIcon-root-70"
|
||||
class="PrivateRadioButtonIcon-root-71"
|
||||
>
|
||||
<svg
|
||||
aria-hidden="true"
|
||||
@@ -251,7 +251,7 @@ exports[`VehicleAddForm Render 1`] = `
|
||||
</svg>
|
||||
<svg
|
||||
aria-hidden="true"
|
||||
class="MuiSvgIcon-root PrivateRadioButtonIcon-layer-71"
|
||||
class="MuiSvgIcon-root PrivateRadioButtonIcon-layer-72"
|
||||
focusable="false"
|
||||
viewBox="0 0 24 24"
|
||||
>
|
||||
@@ -276,19 +276,19 @@ exports[`VehicleAddForm Render 1`] = `
|
||||
>
|
||||
<span
|
||||
aria-disabled="false"
|
||||
class="MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-66 MuiRadio-root MuiRadio-colorSecondary MuiIconButton-colorSecondary"
|
||||
class="MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-67 MuiRadio-root MuiRadio-colorSecondary MuiIconButton-colorSecondary"
|
||||
>
|
||||
<span
|
||||
class="MuiIconButton-label"
|
||||
>
|
||||
<input
|
||||
class="PrivateSwitchBase-input-69"
|
||||
class="PrivateSwitchBase-input-70"
|
||||
name="log-level-group"
|
||||
type="radio"
|
||||
value="debug"
|
||||
/>
|
||||
<div
|
||||
class="PrivateRadioButtonIcon-root-70"
|
||||
class="PrivateRadioButtonIcon-root-71"
|
||||
>
|
||||
<svg
|
||||
aria-hidden="true"
|
||||
@@ -302,7 +302,7 @@ exports[`VehicleAddForm Render 1`] = `
|
||||
</svg>
|
||||
<svg
|
||||
aria-hidden="true"
|
||||
class="MuiSvgIcon-root PrivateRadioButtonIcon-layer-71"
|
||||
class="MuiSvgIcon-root PrivateRadioButtonIcon-layer-72"
|
||||
focusable="false"
|
||||
viewBox="0 0 24 24"
|
||||
>
|
||||
@@ -327,20 +327,20 @@ exports[`VehicleAddForm Render 1`] = `
|
||||
>
|
||||
<span
|
||||
aria-disabled="false"
|
||||
class="MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-66 MuiRadio-root MuiRadio-colorSecondary PrivateSwitchBase-checked-67 Mui-checked MuiIconButton-colorSecondary"
|
||||
class="MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-67 MuiRadio-root MuiRadio-colorSecondary PrivateSwitchBase-checked-68 Mui-checked MuiIconButton-colorSecondary"
|
||||
>
|
||||
<span
|
||||
class="MuiIconButton-label"
|
||||
>
|
||||
<input
|
||||
checked=""
|
||||
class="PrivateSwitchBase-input-69"
|
||||
class="PrivateSwitchBase-input-70"
|
||||
name="log-level-group"
|
||||
type="radio"
|
||||
value="info"
|
||||
/>
|
||||
<div
|
||||
class="PrivateRadioButtonIcon-root-70 PrivateRadioButtonIcon-checked-72"
|
||||
class="PrivateRadioButtonIcon-root-71 PrivateRadioButtonIcon-checked-73"
|
||||
>
|
||||
<svg
|
||||
aria-hidden="true"
|
||||
@@ -354,7 +354,7 @@ exports[`VehicleAddForm Render 1`] = `
|
||||
</svg>
|
||||
<svg
|
||||
aria-hidden="true"
|
||||
class="MuiSvgIcon-root PrivateRadioButtonIcon-layer-71"
|
||||
class="MuiSvgIcon-root PrivateRadioButtonIcon-layer-72"
|
||||
focusable="false"
|
||||
viewBox="0 0 24 24"
|
||||
>
|
||||
@@ -379,19 +379,19 @@ exports[`VehicleAddForm Render 1`] = `
|
||||
>
|
||||
<span
|
||||
aria-disabled="false"
|
||||
class="MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-66 MuiRadio-root MuiRadio-colorSecondary MuiIconButton-colorSecondary"
|
||||
class="MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-67 MuiRadio-root MuiRadio-colorSecondary MuiIconButton-colorSecondary"
|
||||
>
|
||||
<span
|
||||
class="MuiIconButton-label"
|
||||
>
|
||||
<input
|
||||
class="PrivateSwitchBase-input-69"
|
||||
class="PrivateSwitchBase-input-70"
|
||||
name="log-level-group"
|
||||
type="radio"
|
||||
value="warn"
|
||||
/>
|
||||
<div
|
||||
class="PrivateRadioButtonIcon-root-70"
|
||||
class="PrivateRadioButtonIcon-root-71"
|
||||
>
|
||||
<svg
|
||||
aria-hidden="true"
|
||||
@@ -405,7 +405,7 @@ exports[`VehicleAddForm Render 1`] = `
|
||||
</svg>
|
||||
<svg
|
||||
aria-hidden="true"
|
||||
class="MuiSvgIcon-root PrivateRadioButtonIcon-layer-71"
|
||||
class="MuiSvgIcon-root PrivateRadioButtonIcon-layer-72"
|
||||
focusable="false"
|
||||
viewBox="0 0 24 24"
|
||||
>
|
||||
@@ -430,19 +430,19 @@ exports[`VehicleAddForm Render 1`] = `
|
||||
>
|
||||
<span
|
||||
aria-disabled="false"
|
||||
class="MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-66 MuiRadio-root MuiRadio-colorSecondary MuiIconButton-colorSecondary"
|
||||
class="MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-67 MuiRadio-root MuiRadio-colorSecondary MuiIconButton-colorSecondary"
|
||||
>
|
||||
<span
|
||||
class="MuiIconButton-label"
|
||||
>
|
||||
<input
|
||||
class="PrivateSwitchBase-input-69"
|
||||
class="PrivateSwitchBase-input-70"
|
||||
name="log-level-group"
|
||||
type="radio"
|
||||
value="error"
|
||||
/>
|
||||
<div
|
||||
class="PrivateRadioButtonIcon-root-70"
|
||||
class="PrivateRadioButtonIcon-root-71"
|
||||
>
|
||||
<svg
|
||||
aria-hidden="true"
|
||||
@@ -456,7 +456,7 @@ exports[`VehicleAddForm Render 1`] = `
|
||||
</svg>
|
||||
<svg
|
||||
aria-hidden="true"
|
||||
class="MuiSvgIcon-root PrivateRadioButtonIcon-layer-71"
|
||||
class="MuiSvgIcon-root PrivateRadioButtonIcon-layer-72"
|
||||
focusable="false"
|
||||
viewBox="0 0 24 24"
|
||||
>
|
||||
@@ -481,19 +481,19 @@ exports[`VehicleAddForm Render 1`] = `
|
||||
>
|
||||
<span
|
||||
aria-disabled="false"
|
||||
class="MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-66 MuiRadio-root MuiRadio-colorSecondary MuiIconButton-colorSecondary"
|
||||
class="MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-67 MuiRadio-root MuiRadio-colorSecondary MuiIconButton-colorSecondary"
|
||||
>
|
||||
<span
|
||||
class="MuiIconButton-label"
|
||||
>
|
||||
<input
|
||||
class="PrivateSwitchBase-input-69"
|
||||
class="PrivateSwitchBase-input-70"
|
||||
name="log-level-group"
|
||||
type="radio"
|
||||
value="critical"
|
||||
/>
|
||||
<div
|
||||
class="PrivateRadioButtonIcon-root-70"
|
||||
class="PrivateRadioButtonIcon-root-71"
|
||||
>
|
||||
<svg
|
||||
aria-hidden="true"
|
||||
@@ -507,7 +507,7 @@ exports[`VehicleAddForm Render 1`] = `
|
||||
</svg>
|
||||
<svg
|
||||
aria-hidden="true"
|
||||
class="MuiSvgIcon-root PrivateRadioButtonIcon-layer-71"
|
||||
class="MuiSvgIcon-root PrivateRadioButtonIcon-layer-72"
|
||||
focusable="false"
|
||||
viewBox="0 0 24 24"
|
||||
>
|
||||
@@ -542,14 +542,14 @@ exports[`VehicleAddForm Render 1`] = `
|
||||
>
|
||||
<span
|
||||
aria-disabled="false"
|
||||
class="MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-66 MuiCheckbox-root MuiCheckbox-colorSecondary PrivateSwitchBase-checked-67 Mui-checked MuiIconButton-colorSecondary"
|
||||
class="MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-67 MuiCheckbox-root MuiCheckbox-colorSecondary PrivateSwitchBase-checked-68 Mui-checked MuiIconButton-colorSecondary"
|
||||
>
|
||||
<span
|
||||
class="MuiIconButton-label"
|
||||
>
|
||||
<input
|
||||
checked=""
|
||||
class="PrivateSwitchBase-input-69"
|
||||
class="PrivateSwitchBase-input-70"
|
||||
data-indeterminate="false"
|
||||
type="checkbox"
|
||||
value=""
|
||||
@@ -608,10 +608,10 @@ exports[`VehicleAddForm Render 1`] = `
|
||||
/>
|
||||
<fieldset
|
||||
aria-hidden="true"
|
||||
class="PrivateNotchedOutline-root-62 MuiOutlinedInput-notchedOutline"
|
||||
class="PrivateNotchedOutline-root-63 MuiOutlinedInput-notchedOutline"
|
||||
>
|
||||
<legend
|
||||
class="PrivateNotchedOutline-legendLabelled-64 PrivateNotchedOutline-legendNotched-65"
|
||||
class="PrivateNotchedOutline-legendLabelled-65 PrivateNotchedOutline-legendNotched-66"
|
||||
>
|
||||
<span>
|
||||
Max Memory Buffer Size (0 uses default size)
|
||||
@@ -626,13 +626,13 @@ exports[`VehicleAddForm Render 1`] = `
|
||||
>
|
||||
<span
|
||||
aria-disabled="false"
|
||||
class="MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-66 MuiCheckbox-root MuiCheckbox-colorSecondary MuiIconButton-colorSecondary"
|
||||
class="MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-67 MuiCheckbox-root MuiCheckbox-colorSecondary MuiIconButton-colorSecondary"
|
||||
>
|
||||
<span
|
||||
class="MuiIconButton-label"
|
||||
>
|
||||
<input
|
||||
class="PrivateSwitchBase-input-69"
|
||||
class="PrivateSwitchBase-input-70"
|
||||
data-indeterminate="false"
|
||||
type="checkbox"
|
||||
value=""
|
||||
@@ -693,10 +693,10 @@ exports[`VehicleAddForm Render 1`] = `
|
||||
/>
|
||||
<fieldset
|
||||
aria-hidden="true"
|
||||
class="PrivateNotchedOutline-root-62 MuiOutlinedInput-notchedOutline"
|
||||
class="PrivateNotchedOutline-root-63 MuiOutlinedInput-notchedOutline"
|
||||
>
|
||||
<legend
|
||||
class="PrivateNotchedOutline-legendLabelled-64 PrivateNotchedOutline-legendNotched-65"
|
||||
class="PrivateNotchedOutline-legendLabelled-65 PrivateNotchedOutline-legendNotched-66"
|
||||
>
|
||||
<span>
|
||||
Max Disk Buffer Size (0 uses default size)
|
||||
@@ -707,7 +707,7 @@ exports[`VehicleAddForm Render 1`] = `
|
||||
</div>
|
||||
</div>
|
||||
<button
|
||||
class="MuiButtonBase-root MuiButton-root MuiButton-contained makeStyles-submit-6 MuiButton-containedPrimary MuiButton-fullWidth"
|
||||
class="MuiButtonBase-root MuiButton-root MuiButton-contained makeStyles-submit-0 MuiButton-containedPrimary MuiButton-fullWidth"
|
||||
tabindex="0"
|
||||
type="submit"
|
||||
>
|
||||
|
||||
@@ -9,7 +9,8 @@ import { VehicleProvider } from "../../Contexts/VehicleContext";
|
||||
import { StatusProvider } from "../../Contexts/StatusContext";
|
||||
import { UserProvider, setToken } from "../../Contexts/UserContext";
|
||||
import { TEST_AUTH_OBJECT } from "../../../utils/testing";
|
||||
import MainForm from "./index"
|
||||
import MainForm from "./index";
|
||||
import addSnapshotSerializer from "../../../utils/snapshot";
|
||||
|
||||
const renderVehicleAdd = async () => {
|
||||
const { container } = render(
|
||||
@@ -23,11 +24,17 @@ const renderVehicleAdd = async () => {
|
||||
</StatusProvider>
|
||||
</VehicleProvider>
|
||||
);
|
||||
await waitFor(() => { /* render */ });
|
||||
await waitFor(() => {
|
||||
/* render */
|
||||
});
|
||||
return container;
|
||||
};
|
||||
|
||||
describe("VehicleAddForm", () => {
|
||||
beforeAll(() => {
|
||||
addSnapshotSerializer(expect);
|
||||
});
|
||||
|
||||
it("Render", async () => {
|
||||
setToken(TEST_AUTH_OBJECT);
|
||||
const container = await renderVehicleAdd();
|
||||
|
||||
@@ -15,13 +15,13 @@ exports[`VehicleTable Render 1`] = `
|
||||
data-testid="mocked-vehicleprovider"
|
||||
>
|
||||
<div
|
||||
class="makeStyles-paper-3 makeStyles-tableSize-53"
|
||||
class="makeStyles-paper-0 makeStyles-tableSize-0"
|
||||
>
|
||||
<div
|
||||
class="MuiGrid-root makeStyles-root-14 MuiGrid-container MuiGrid-spacing-xs-2"
|
||||
class="MuiGrid-root makeStyles-root-0 MuiGrid-container MuiGrid-spacing-xs-2"
|
||||
>
|
||||
<div
|
||||
class="MuiGrid-root makeStyles-textJustifyAlign-47 MuiGrid-item MuiGrid-grid-md-4"
|
||||
class="MuiGrid-root makeStyles-textJustifyAlign-0 MuiGrid-item MuiGrid-grid-md-4"
|
||||
>
|
||||
<a
|
||||
href="/vehicle-add"
|
||||
@@ -39,10 +39,10 @@ exports[`VehicleTable Render 1`] = `
|
||||
</a>
|
||||
</div>
|
||||
<div
|
||||
class="MuiGrid-root makeStyles-textCenterAlign-48 MuiGrid-item MuiGrid-grid-md-4"
|
||||
class="MuiGrid-root makeStyles-textCenterAlign-0 MuiGrid-item MuiGrid-grid-md-4"
|
||||
>
|
||||
<div
|
||||
class="MuiFormControl-root makeStyles-margin-28 makeStyles-fullWidth-50"
|
||||
class="MuiFormControl-root makeStyles-margin-0 makeStyles-fullWidth-0"
|
||||
>
|
||||
<label
|
||||
class="MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated"
|
||||
@@ -93,11 +93,11 @@ exports[`VehicleTable Render 1`] = `
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="MuiGrid-root makeStyles-textRightAlign-49 MuiGrid-item MuiGrid-grid-md-4"
|
||||
class="MuiGrid-root makeStyles-textRightAlign-0 MuiGrid-item MuiGrid-grid-md-4"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
class="makeStyles-paper-3 makeStyles-tableSize-53"
|
||||
class="makeStyles-paper-0 makeStyles-tableSize-0"
|
||||
>
|
||||
<table
|
||||
class="MuiTable-root"
|
||||
@@ -121,7 +121,7 @@ exports[`VehicleTable Render 1`] = `
|
||||
>
|
||||
VIN
|
||||
<span
|
||||
class="makeStyles-hiddenSortSpan-27"
|
||||
class="makeStyles-hiddenSortSpan-0"
|
||||
>
|
||||
sorted ascending
|
||||
</span>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
jest.mock("../../Contexts/VehicleContext");
|
||||
jest.mock("../../Contexts/StatusContext");
|
||||
jest.mock("../../Contexts/UserContext");
|
||||
jest.mock('@material-ui/core/utils/unstable_useId', () =>
|
||||
jest.fn().mockReturnValue('mui-test-id'),
|
||||
jest.mock("@material-ui/core/utils/unstable_useId", () =>
|
||||
jest.fn().mockReturnValue("mui-test-id")
|
||||
);
|
||||
|
||||
import { render, waitFor } from "@testing-library/react";
|
||||
@@ -12,7 +12,8 @@ import { VehicleProvider } from "../../Contexts/VehicleContext";
|
||||
import { StatusProvider } from "../../Contexts/StatusContext";
|
||||
import { UserProvider, setToken } from "../../Contexts/UserContext";
|
||||
import { TEST_AUTH_OBJECT } from "../../../utils/testing";
|
||||
import MainForm from "./index"
|
||||
import MainForm from "./index";
|
||||
import addSnapshotSerializer from "../../../utils/snapshot";
|
||||
|
||||
const renderVehicleTable = async () => {
|
||||
const { container } = render(
|
||||
@@ -26,11 +27,17 @@ const renderVehicleTable = async () => {
|
||||
</StatusProvider>
|
||||
</VehicleProvider>
|
||||
);
|
||||
await waitFor(() => { /* render */ });
|
||||
await waitFor(() => {
|
||||
/* render */
|
||||
});
|
||||
return container;
|
||||
};
|
||||
|
||||
describe("VehicleTable", () => {
|
||||
beforeAll(() => {
|
||||
addSnapshotSerializer(expect);
|
||||
});
|
||||
|
||||
it("Render", async () => {
|
||||
setToken(TEST_AUTH_OBJECT);
|
||||
const container = await renderVehicleTable();
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
jest.mock("../../Contexts/CANFiltersContext");
|
||||
jest.mock("../../Contexts/StatusContext");
|
||||
jest.mock("../../Contexts/UserContext");
|
||||
jest.mock('@material-ui/core/utils/unstable_useId', () =>
|
||||
jest.fn().mockReturnValue('mui-test-id'),
|
||||
jest.mock("@material-ui/core/utils/unstable_useId", () =>
|
||||
jest.fn().mockReturnValue("mui-test-id")
|
||||
);
|
||||
|
||||
import { render, waitFor } from "@testing-library/react";
|
||||
@@ -10,7 +10,8 @@ import { BrowserRouter } from "react-router-dom";
|
||||
|
||||
import { setToken } from "../../Contexts/UserContext";
|
||||
import { TEST_AUTH_OBJECT } from "../../../utils/testing";
|
||||
import CANFiltersTab from "./CANFiltersTab"
|
||||
import CANFiltersTab from "./CANFiltersTab";
|
||||
import addSnapshotSerializer from "../../../utils/snapshot";
|
||||
|
||||
const renderCANFiltersTab = async () => {
|
||||
const { container } = render(
|
||||
@@ -18,11 +19,17 @@ const renderCANFiltersTab = async () => {
|
||||
<CANFiltersTab vin="TESTVIN1234567890" />
|
||||
</BrowserRouter>
|
||||
);
|
||||
await waitFor(() => { /* render */ });
|
||||
await waitFor(() => {
|
||||
/* render */
|
||||
});
|
||||
return container;
|
||||
};
|
||||
|
||||
describe("CANFiltersTab", () => {
|
||||
beforeAll(() => {
|
||||
addSnapshotSerializer(expect);
|
||||
});
|
||||
|
||||
it("Render", async () => {
|
||||
setToken(TEST_AUTH_OBJECT);
|
||||
const container = await renderCANFiltersTab();
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
jest.mock("../../Contexts/CANFiltersContext");
|
||||
jest.mock("../../Contexts/StatusContext");
|
||||
jest.mock("../../Contexts/UserContext");
|
||||
jest.mock('@material-ui/core/utils/unstable_useId', () =>
|
||||
jest.fn().mockReturnValue('mui-test-id'),
|
||||
jest.mock("@material-ui/core/utils/unstable_useId", () =>
|
||||
jest.fn().mockReturnValue("mui-test-id")
|
||||
);
|
||||
|
||||
import { render, waitFor } from "@testing-library/react";
|
||||
@@ -12,7 +12,8 @@ import { CANFiltersProvider } from "../../Contexts/CANFiltersContext";
|
||||
import { StatusProvider } from "../../Contexts/StatusContext";
|
||||
import { UserProvider, setToken } from "../../Contexts/UserContext";
|
||||
import { TEST_AUTH_OBJECT } from "../../../utils/testing";
|
||||
import MainForm from "./CarUpdatesTab"
|
||||
import MainForm from "./CarUpdatesTab";
|
||||
import addSnapshotSerializer from "../../../utils/snapshot";
|
||||
|
||||
const renderCarUpdatesTab = async () => {
|
||||
const { container } = render(
|
||||
@@ -26,11 +27,17 @@ const renderCarUpdatesTab = async () => {
|
||||
</StatusProvider>
|
||||
</CANFiltersProvider>
|
||||
);
|
||||
await waitFor(() => { /* render */ });
|
||||
await waitFor(() => {
|
||||
/* render */
|
||||
});
|
||||
return container;
|
||||
};
|
||||
|
||||
describe("CarUpdatesTab", () => {
|
||||
beforeAll(() => {
|
||||
addSnapshotSerializer(expect);
|
||||
});
|
||||
|
||||
it("Render", async () => {
|
||||
setToken(TEST_AUTH_OBJECT);
|
||||
const container = await renderCarUpdatesTab();
|
||||
|
||||
@@ -15,13 +15,13 @@ exports[`VehicleDetailsTab Render 1`] = `
|
||||
data-testid="mocked-vehicleprovider"
|
||||
>
|
||||
<div
|
||||
class="makeStyles-paper-3 makeStyles-tableSize-53"
|
||||
class="makeStyles-paper-0 makeStyles-tableSize-0"
|
||||
>
|
||||
<div
|
||||
class="MuiGrid-root makeStyles-root-14 MuiGrid-container MuiGrid-spacing-xs-2"
|
||||
class="MuiGrid-root makeStyles-root-0 MuiGrid-container MuiGrid-spacing-xs-2"
|
||||
>
|
||||
<div
|
||||
class="MuiGrid-root makeStyles-textCenterAlign-48 MuiGrid-item MuiGrid-grid-md-12"
|
||||
class="MuiGrid-root makeStyles-textCenterAlign-0 MuiGrid-item MuiGrid-grid-md-12"
|
||||
>
|
||||
<p>
|
||||
<b>
|
||||
@@ -38,7 +38,7 @@ exports[`VehicleDetailsTab Render 1`] = `
|
||||
</p>
|
||||
</div>
|
||||
<div
|
||||
class="MuiGrid-root makeStyles-textCenterAlign-48 MuiGrid-item MuiGrid-grid-md-12"
|
||||
class="MuiGrid-root makeStyles-textCenterAlign-0 MuiGrid-item MuiGrid-grid-md-12"
|
||||
>
|
||||
<b>
|
||||
CANBus
|
||||
@@ -80,7 +80,7 @@ exports[`VehicleDetailsTab Render 1`] = `
|
||||
</p>
|
||||
</div>
|
||||
<div
|
||||
class="MuiGrid-root makeStyles-textCenterAlign-48 MuiGrid-item MuiGrid-grid-md-12"
|
||||
class="MuiGrid-root makeStyles-textCenterAlign-0 MuiGrid-item MuiGrid-grid-md-12"
|
||||
>
|
||||
<a
|
||||
class=""
|
||||
|
||||
@@ -9,7 +9,8 @@ import { VehicleProvider } from "../../../Contexts/VehicleContext";
|
||||
import { StatusProvider } from "../../../Contexts/StatusContext";
|
||||
import { UserProvider, setToken } from "../../../Contexts/UserContext";
|
||||
import { TEST_AUTH_OBJECT } from "../../../../utils/testing";
|
||||
import MainForm from "./index"
|
||||
import MainForm from "./index";
|
||||
import addSnapshotSerializer from "../../../../utils/snapshot";
|
||||
|
||||
const renderVehicleDetailsTab = async () => {
|
||||
const { container } = render(
|
||||
@@ -23,11 +24,17 @@ const renderVehicleDetailsTab = async () => {
|
||||
</StatusProvider>
|
||||
</VehicleProvider>
|
||||
);
|
||||
await waitFor(() => { /* render */ });
|
||||
await waitFor(() => {
|
||||
/* render */
|
||||
});
|
||||
return container;
|
||||
};
|
||||
|
||||
describe("VehicleDetailsTab", () => {
|
||||
beforeAll(() => {
|
||||
addSnapshotSerializer(expect);
|
||||
});
|
||||
|
||||
it("Render", async () => {
|
||||
setToken(TEST_AUTH_OBJECT);
|
||||
const container = await renderVehicleDetailsTab();
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
jest.mock("../../Contexts/VehicleContext");
|
||||
jest.mock("../../Contexts/StatusContext");
|
||||
jest.mock("../../Contexts/UserContext");
|
||||
jest.mock('@material-ui/core/utils/unstable_useId', () =>
|
||||
jest.fn().mockReturnValue('mui-test-id'),
|
||||
jest.mock("@material-ui/core/utils/unstable_useId", () =>
|
||||
jest.fn().mockReturnValue("mui-test-id")
|
||||
);
|
||||
|
||||
import { render, waitFor } from "@testing-library/react";
|
||||
@@ -12,27 +12,34 @@ import { VehicleProvider } from "../../Contexts/VehicleContext";
|
||||
import { StatusProvider } from "../../Contexts/StatusContext";
|
||||
import { UserProvider, setToken } from "../../Contexts/UserContext";
|
||||
import { TEST_AUTH_OBJECT } from "../../../utils/testing";
|
||||
import MainForm from "./DetailsTab"
|
||||
import MainForm from "./DetailsTab";
|
||||
import addSnapshotSerializer from "../../../utils/snapshot";
|
||||
|
||||
const renderDetailsTab = async () => {
|
||||
const { container } = render(
|
||||
<VehicleProvider>
|
||||
<StatusProvider>
|
||||
<UserProvider>
|
||||
<MemoryRouter initialEntries={['/testroute/TESTVIN1234567890']}>
|
||||
<MemoryRouter initialEntries={["/testroute/TESTVIN1234567890"]}>
|
||||
<Route path="/testroute/:vin">
|
||||
<MainForm vin="TESTVIN1234567890" />
|
||||
</Route>
|
||||
</MemoryRouter>
|
||||
</UserProvider>
|
||||
</StatusProvider>
|
||||
</VehicleProvider >
|
||||
</VehicleProvider>
|
||||
);
|
||||
await waitFor(() => { /* render */ });
|
||||
await waitFor(() => {
|
||||
/* render */
|
||||
});
|
||||
return container;
|
||||
};
|
||||
|
||||
describe("DetailsTab", () => {
|
||||
beforeAll(() => {
|
||||
addSnapshotSerializer(expect);
|
||||
});
|
||||
|
||||
it("Render", async () => {
|
||||
setToken(TEST_AUTH_OBJECT);
|
||||
const container = await renderDetailsTab();
|
||||
|
||||
@@ -12,6 +12,7 @@ import { StatusProvider } from "../../Contexts/StatusContext";
|
||||
import { UserProvider, setToken } from "../../Contexts/UserContext";
|
||||
import { TEST_AUTH_OBJECT } from "../../../utils/testing";
|
||||
import DigitalTwinTab from "./DigitalTwinTab";
|
||||
import addSnapshotSerializer from "../../../utils/snapshot";
|
||||
|
||||
const renderDetailsTab = async () => {
|
||||
const { container } = render(
|
||||
@@ -28,6 +29,10 @@ const renderDetailsTab = async () => {
|
||||
};
|
||||
|
||||
describe("DigitalTwinTab", () => {
|
||||
beforeAll(() => {
|
||||
addSnapshotSerializer(expect);
|
||||
});
|
||||
|
||||
it("Render", async () => {
|
||||
setToken(TEST_AUTH_OBJECT);
|
||||
const container = await renderDetailsTab();
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
exports[`CANFiltersTab Render 1`] = `
|
||||
<div>
|
||||
<div
|
||||
class="makeStyles-paper-3 makeStyles-tableSize-53"
|
||||
class="makeStyles-paper-0 makeStyles-tableSize-0"
|
||||
>
|
||||
<h6
|
||||
class="MuiTypography-root MuiTypography-h6"
|
||||
@@ -14,16 +14,16 @@ exports[`CANFiltersTab Render 1`] = `
|
||||
data-testid="mocked-canfiltersprovider"
|
||||
>
|
||||
<div
|
||||
class="makeStyles-paper-3 makeStyles-tableSize-53"
|
||||
class="makeStyles-paper-0 makeStyles-tableSize-0"
|
||||
>
|
||||
<div
|
||||
class="MuiGrid-root makeStyles-root-14 MuiGrid-container MuiGrid-spacing-xs-2"
|
||||
class="MuiGrid-root makeStyles-root-0 MuiGrid-container MuiGrid-spacing-xs-2"
|
||||
>
|
||||
<div
|
||||
class="MuiGrid-root makeStyles-textJustifyAlign-47 MuiGrid-item MuiGrid-grid-md-4"
|
||||
class="MuiGrid-root makeStyles-textJustifyAlign-0 MuiGrid-item MuiGrid-grid-md-4"
|
||||
>
|
||||
<a
|
||||
class="makeStyles-labelInline-9"
|
||||
class="makeStyles-labelInline-0"
|
||||
href="/filter-add?vin=undefined"
|
||||
>
|
||||
<svg
|
||||
@@ -39,10 +39,10 @@ exports[`CANFiltersTab Render 1`] = `
|
||||
</a>
|
||||
</div>
|
||||
<div
|
||||
class="MuiGrid-root makeStyles-textCenterAlign-48 MuiGrid-item MuiGrid-grid-md-8"
|
||||
class="MuiGrid-root makeStyles-textCenterAlign-0 MuiGrid-item MuiGrid-grid-md-8"
|
||||
>
|
||||
<div
|
||||
class="MuiFormControl-root makeStyles-margin-28 makeStyles-fullWidth-50"
|
||||
class="MuiFormControl-root makeStyles-margin-0 makeStyles-fullWidth-0"
|
||||
>
|
||||
<label
|
||||
class="MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated"
|
||||
|
||||
@@ -12,7 +12,7 @@ exports[`CarUpdatesTab Render 1`] = `
|
||||
data-testid="mocked-userprovider"
|
||||
>
|
||||
<div
|
||||
class="makeStyles-paper-3 makeStyles-tableSize-53"
|
||||
class="makeStyles-paper-0 makeStyles-tableSize-0"
|
||||
>
|
||||
<h6
|
||||
class="MuiTypography-root MuiTypography-h6"
|
||||
@@ -41,7 +41,7 @@ exports[`CarUpdatesTab Render 1`] = `
|
||||
>
|
||||
ID
|
||||
<span
|
||||
class="makeStyles-hiddenSortSpan-27"
|
||||
class="makeStyles-hiddenSortSpan-0"
|
||||
>
|
||||
sorted descending
|
||||
</span>
|
||||
@@ -279,12 +279,12 @@ exports[`CarUpdatesTab Render 1`] = `
|
||||
</tfoot>
|
||||
</table>
|
||||
<h6
|
||||
class="MuiTypography-root makeStyles-labelInline-9 MuiTypography-h6"
|
||||
class="MuiTypography-root makeStyles-labelInline-0 MuiTypography-h6"
|
||||
>
|
||||
Car ECUs
|
||||
</h6>
|
||||
<div
|
||||
class="makeStyles-paper-3 makeStyles-tableSize-53"
|
||||
class="makeStyles-paper-0 makeStyles-tableSize-0"
|
||||
>
|
||||
<table
|
||||
class="MuiTable-root"
|
||||
@@ -308,7 +308,7 @@ exports[`CarUpdatesTab Render 1`] = `
|
||||
>
|
||||
ECU
|
||||
<span
|
||||
class="makeStyles-hiddenSortSpan-27"
|
||||
class="makeStyles-hiddenSortSpan-0"
|
||||
>
|
||||
sorted descending
|
||||
</span>
|
||||
|
||||
@@ -12,7 +12,7 @@ exports[`DetailsTab Render 1`] = `
|
||||
data-testid="mocked-userprovider"
|
||||
>
|
||||
<div
|
||||
class="makeStyles-paper-3 makeStyles-tableSize-53"
|
||||
class="makeStyles-paper-0 makeStyles-tableSize-0"
|
||||
>
|
||||
<h6
|
||||
class="MuiTypography-root MuiTypography-h6"
|
||||
@@ -23,13 +23,13 @@ exports[`DetailsTab Render 1`] = `
|
||||
data-testid="mocked-vehicleprovider"
|
||||
>
|
||||
<div
|
||||
class="makeStyles-paper-3 makeStyles-tableSize-53"
|
||||
class="makeStyles-paper-0 makeStyles-tableSize-0"
|
||||
>
|
||||
<div
|
||||
class="MuiGrid-root makeStyles-root-14 MuiGrid-container MuiGrid-spacing-xs-2"
|
||||
class="MuiGrid-root makeStyles-root-0 MuiGrid-container MuiGrid-spacing-xs-2"
|
||||
>
|
||||
<div
|
||||
class="MuiGrid-root makeStyles-textCenterAlign-48 MuiGrid-item MuiGrid-grid-md-12"
|
||||
class="MuiGrid-root makeStyles-textCenterAlign-0 MuiGrid-item MuiGrid-grid-md-12"
|
||||
>
|
||||
<p>
|
||||
<b>
|
||||
@@ -47,7 +47,7 @@ exports[`DetailsTab Render 1`] = `
|
||||
</p>
|
||||
</div>
|
||||
<div
|
||||
class="MuiGrid-root makeStyles-textCenterAlign-48 MuiGrid-item MuiGrid-grid-md-12"
|
||||
class="MuiGrid-root makeStyles-textCenterAlign-0 MuiGrid-item MuiGrid-grid-md-12"
|
||||
>
|
||||
<b>
|
||||
CANBus
|
||||
@@ -89,7 +89,7 @@ exports[`DetailsTab Render 1`] = `
|
||||
</p>
|
||||
</div>
|
||||
<div
|
||||
class="MuiGrid-root makeStyles-textCenterAlign-48 MuiGrid-item MuiGrid-grid-md-12"
|
||||
class="MuiGrid-root makeStyles-textCenterAlign-0 MuiGrid-item MuiGrid-grid-md-12"
|
||||
>
|
||||
<a
|
||||
class=""
|
||||
|
||||
@@ -12,7 +12,7 @@ exports[`DigitalTwinTab Render 1`] = `
|
||||
data-testid="mocked-vehicleprovider"
|
||||
>
|
||||
<div
|
||||
class="makeStyles-paper-3 makeStyles-tableSize-53"
|
||||
class="makeStyles-paper-0 makeStyles-tableSize-0"
|
||||
>
|
||||
<h6
|
||||
class="MuiTypography-root MuiTypography-h6"
|
||||
@@ -36,7 +36,7 @@ exports[`DigitalTwinTab Render 1`] = `
|
||||
95%
|
||||
</p>
|
||||
<div
|
||||
class="makeStyles-popupSection-40"
|
||||
class="makeStyles-popupSection-0"
|
||||
>
|
||||
<h3>
|
||||
Doors
|
||||
@@ -85,7 +85,7 @@ exports[`DigitalTwinTab Render 1`] = `
|
||||
</p>
|
||||
</div>
|
||||
<div
|
||||
class="makeStyles-popupSection-40"
|
||||
class="makeStyles-popupSection-0"
|
||||
>
|
||||
<h3>
|
||||
Location
|
||||
@@ -113,7 +113,7 @@ exports[`DigitalTwinTab Render 1`] = `
|
||||
</p>
|
||||
</div>
|
||||
<div
|
||||
class="makeStyles-popupSection-40"
|
||||
class="makeStyles-popupSection-0"
|
||||
>
|
||||
<p>
|
||||
<b>
|
||||
@@ -124,7 +124,7 @@ exports[`DigitalTwinTab Render 1`] = `
|
||||
</p>
|
||||
</div>
|
||||
<div
|
||||
class="makeStyles-popupSection-40"
|
||||
class="makeStyles-popupSection-0"
|
||||
>
|
||||
<p>
|
||||
<b>
|
||||
|
||||
@@ -12,10 +12,10 @@ exports[`CarStatus Render 1`] = `
|
||||
data-testid="mocked-userprovider"
|
||||
>
|
||||
<div
|
||||
class="makeStyles-paper-3 makeStyles-tableSize-53"
|
||||
class="makeStyles-paper-0 makeStyles-tableSize-0"
|
||||
>
|
||||
<div
|
||||
class="MuiBox-root MuiBox-root-62 makeStyles-tableToolbar-30"
|
||||
class="MuiBox-root MuiBox-root-63 makeStyles-tableToolbar-0"
|
||||
>
|
||||
<div
|
||||
class="MuiTabs-root"
|
||||
@@ -103,7 +103,7 @@ exports[`CarStatus Render 1`] = `
|
||||
</button>
|
||||
</div>
|
||||
<span
|
||||
class="PrivateTabIndicator-root-63 PrivateTabIndicator-colorSecondary-65 MuiTabs-indicator"
|
||||
class="PrivateTabIndicator-root-64 PrivateTabIndicator-colorSecondary-66 MuiTabs-indicator"
|
||||
style="left: 0px; width: 0px;"
|
||||
/>
|
||||
</div>
|
||||
@@ -115,10 +115,10 @@ exports[`CarStatus Render 1`] = `
|
||||
role="tabpanel"
|
||||
>
|
||||
<div
|
||||
class="MuiBox-root MuiBox-root-67"
|
||||
class="MuiBox-root MuiBox-root-68"
|
||||
>
|
||||
<div
|
||||
class="makeStyles-paper-3 makeStyles-tableSize-53"
|
||||
class="makeStyles-paper-0 makeStyles-tableSize-0"
|
||||
>
|
||||
<h6
|
||||
class="MuiTypography-root MuiTypography-h6"
|
||||
@@ -126,13 +126,13 @@ exports[`CarStatus Render 1`] = `
|
||||
Vehicle Details
|
||||
</h6>
|
||||
<div
|
||||
class="makeStyles-paper-3 makeStyles-tableSize-53"
|
||||
class="makeStyles-paper-0 makeStyles-tableSize-0"
|
||||
>
|
||||
<div
|
||||
class="MuiGrid-root makeStyles-root-14 MuiGrid-container MuiGrid-spacing-xs-2"
|
||||
class="MuiGrid-root makeStyles-root-0 MuiGrid-container MuiGrid-spacing-xs-2"
|
||||
>
|
||||
<div
|
||||
class="MuiGrid-root makeStyles-textCenterAlign-48 MuiGrid-item MuiGrid-grid-md-12"
|
||||
class="MuiGrid-root makeStyles-textCenterAlign-0 MuiGrid-item MuiGrid-grid-md-12"
|
||||
>
|
||||
<p>
|
||||
<b>
|
||||
@@ -142,7 +142,7 @@ exports[`CarStatus Render 1`] = `
|
||||
</p>
|
||||
</div>
|
||||
<div
|
||||
class="MuiGrid-root makeStyles-textCenterAlign-48 MuiGrid-item MuiGrid-grid-md-12"
|
||||
class="MuiGrid-root makeStyles-textCenterAlign-0 MuiGrid-item MuiGrid-grid-md-12"
|
||||
>
|
||||
<a
|
||||
class=""
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
jest.mock("../../Contexts/CANFiltersContext");
|
||||
jest.mock("../../Contexts/StatusContext");
|
||||
jest.mock("../../Contexts/UserContext");
|
||||
jest.mock('@material-ui/core/utils/unstable_useId', () =>
|
||||
jest.fn().mockReturnValue('mui-test-id'),
|
||||
jest.mock("@material-ui/core/utils/unstable_useId", () =>
|
||||
jest.fn().mockReturnValue("mui-test-id")
|
||||
);
|
||||
|
||||
import { render, waitFor } from "@testing-library/react";
|
||||
@@ -12,7 +12,8 @@ import { CANFiltersProvider } from "../../Contexts/CANFiltersContext";
|
||||
import { StatusProvider } from "../../Contexts/StatusContext";
|
||||
import { UserProvider, setToken } from "../../Contexts/UserContext";
|
||||
import { TEST_AUTH_OBJECT } from "../../../utils/testing";
|
||||
import CarStatus from "./index"
|
||||
import CarStatus from "./index";
|
||||
import addSnapshotSerializer from "../../../utils/snapshot";
|
||||
|
||||
const renderCarStatus = async () => {
|
||||
const { container } = render(
|
||||
@@ -26,11 +27,17 @@ const renderCarStatus = async () => {
|
||||
</StatusProvider>
|
||||
</CANFiltersProvider>
|
||||
);
|
||||
await waitFor(() => { /* render */ });
|
||||
await waitFor(() => {
|
||||
/* render */
|
||||
});
|
||||
return container;
|
||||
};
|
||||
|
||||
describe("CarStatus", () => {
|
||||
beforeAll(() => {
|
||||
addSnapshotSerializer(expect);
|
||||
});
|
||||
|
||||
it("Render", async () => {
|
||||
setToken(TEST_AUTH_OBJECT);
|
||||
const container = await renderCarStatus();
|
||||
|
||||
@@ -15,11 +15,11 @@ exports[`VehicleUpdate Render 1`] = `
|
||||
data-testid="mocked-vehicleprovider"
|
||||
>
|
||||
<div
|
||||
class="makeStyles-paper-3"
|
||||
class="makeStyles-paper-0"
|
||||
>
|
||||
<form
|
||||
action="{onSubmit}"
|
||||
class="makeStyles-form-5"
|
||||
class="makeStyles-form-0"
|
||||
novalidate=""
|
||||
>
|
||||
<div
|
||||
@@ -57,10 +57,10 @@ exports[`VehicleUpdate Render 1`] = `
|
||||
/>
|
||||
<fieldset
|
||||
aria-hidden="true"
|
||||
class="PrivateNotchedOutline-root-62 MuiOutlinedInput-notchedOutline"
|
||||
class="PrivateNotchedOutline-root-63 MuiOutlinedInput-notchedOutline"
|
||||
>
|
||||
<legend
|
||||
class="PrivateNotchedOutline-legendLabelled-64"
|
||||
class="PrivateNotchedOutline-legendLabelled-65"
|
||||
>
|
||||
<span>
|
||||
VIN
|
||||
@@ -103,10 +103,10 @@ exports[`VehicleUpdate Render 1`] = `
|
||||
/>
|
||||
<fieldset
|
||||
aria-hidden="true"
|
||||
class="PrivateNotchedOutline-root-62 MuiOutlinedInput-notchedOutline"
|
||||
class="PrivateNotchedOutline-root-63 MuiOutlinedInput-notchedOutline"
|
||||
>
|
||||
<legend
|
||||
class="PrivateNotchedOutline-legendLabelled-64 PrivateNotchedOutline-legendNotched-65"
|
||||
class="PrivateNotchedOutline-legendLabelled-65 PrivateNotchedOutline-legendNotched-66"
|
||||
>
|
||||
<span>
|
||||
Model
|
||||
@@ -150,10 +150,10 @@ exports[`VehicleUpdate Render 1`] = `
|
||||
/>
|
||||
<fieldset
|
||||
aria-hidden="true"
|
||||
class="PrivateNotchedOutline-root-62 MuiOutlinedInput-notchedOutline"
|
||||
class="PrivateNotchedOutline-root-63 MuiOutlinedInput-notchedOutline"
|
||||
>
|
||||
<legend
|
||||
class="PrivateNotchedOutline-legendLabelled-64 PrivateNotchedOutline-legendNotched-65"
|
||||
class="PrivateNotchedOutline-legendLabelled-65 PrivateNotchedOutline-legendNotched-66"
|
||||
>
|
||||
<span>
|
||||
Year
|
||||
@@ -197,10 +197,10 @@ exports[`VehicleUpdate Render 1`] = `
|
||||
/>
|
||||
<fieldset
|
||||
aria-hidden="true"
|
||||
class="PrivateNotchedOutline-root-62 MuiOutlinedInput-notchedOutline"
|
||||
class="PrivateNotchedOutline-root-63 MuiOutlinedInput-notchedOutline"
|
||||
>
|
||||
<legend
|
||||
class="PrivateNotchedOutline-legendLabelled-64 PrivateNotchedOutline-legendNotched-65"
|
||||
class="PrivateNotchedOutline-legendLabelled-65 PrivateNotchedOutline-legendNotched-66"
|
||||
>
|
||||
<span>
|
||||
Trim
|
||||
@@ -227,19 +227,19 @@ exports[`VehicleUpdate Render 1`] = `
|
||||
>
|
||||
<span
|
||||
aria-disabled="false"
|
||||
class="MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-66 MuiRadio-root MuiRadio-colorSecondary MuiIconButton-colorSecondary"
|
||||
class="MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-67 MuiRadio-root MuiRadio-colorSecondary MuiIconButton-colorSecondary"
|
||||
>
|
||||
<span
|
||||
class="MuiIconButton-label"
|
||||
>
|
||||
<input
|
||||
class="PrivateSwitchBase-input-69"
|
||||
class="PrivateSwitchBase-input-70"
|
||||
name="log-level-group"
|
||||
type="radio"
|
||||
value="trace"
|
||||
/>
|
||||
<div
|
||||
class="PrivateRadioButtonIcon-root-70"
|
||||
class="PrivateRadioButtonIcon-root-71"
|
||||
>
|
||||
<svg
|
||||
aria-hidden="true"
|
||||
@@ -253,7 +253,7 @@ exports[`VehicleUpdate Render 1`] = `
|
||||
</svg>
|
||||
<svg
|
||||
aria-hidden="true"
|
||||
class="MuiSvgIcon-root PrivateRadioButtonIcon-layer-71"
|
||||
class="MuiSvgIcon-root PrivateRadioButtonIcon-layer-72"
|
||||
focusable="false"
|
||||
viewBox="0 0 24 24"
|
||||
>
|
||||
@@ -278,19 +278,19 @@ exports[`VehicleUpdate Render 1`] = `
|
||||
>
|
||||
<span
|
||||
aria-disabled="false"
|
||||
class="MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-66 MuiRadio-root MuiRadio-colorSecondary MuiIconButton-colorSecondary"
|
||||
class="MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-67 MuiRadio-root MuiRadio-colorSecondary MuiIconButton-colorSecondary"
|
||||
>
|
||||
<span
|
||||
class="MuiIconButton-label"
|
||||
>
|
||||
<input
|
||||
class="PrivateSwitchBase-input-69"
|
||||
class="PrivateSwitchBase-input-70"
|
||||
name="log-level-group"
|
||||
type="radio"
|
||||
value="debug"
|
||||
/>
|
||||
<div
|
||||
class="PrivateRadioButtonIcon-root-70"
|
||||
class="PrivateRadioButtonIcon-root-71"
|
||||
>
|
||||
<svg
|
||||
aria-hidden="true"
|
||||
@@ -304,7 +304,7 @@ exports[`VehicleUpdate Render 1`] = `
|
||||
</svg>
|
||||
<svg
|
||||
aria-hidden="true"
|
||||
class="MuiSvgIcon-root PrivateRadioButtonIcon-layer-71"
|
||||
class="MuiSvgIcon-root PrivateRadioButtonIcon-layer-72"
|
||||
focusable="false"
|
||||
viewBox="0 0 24 24"
|
||||
>
|
||||
@@ -329,20 +329,20 @@ exports[`VehicleUpdate Render 1`] = `
|
||||
>
|
||||
<span
|
||||
aria-disabled="false"
|
||||
class="MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-66 MuiRadio-root MuiRadio-colorSecondary PrivateSwitchBase-checked-67 Mui-checked MuiIconButton-colorSecondary"
|
||||
class="MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-67 MuiRadio-root MuiRadio-colorSecondary PrivateSwitchBase-checked-68 Mui-checked MuiIconButton-colorSecondary"
|
||||
>
|
||||
<span
|
||||
class="MuiIconButton-label"
|
||||
>
|
||||
<input
|
||||
checked=""
|
||||
class="PrivateSwitchBase-input-69"
|
||||
class="PrivateSwitchBase-input-70"
|
||||
name="log-level-group"
|
||||
type="radio"
|
||||
value="info"
|
||||
/>
|
||||
<div
|
||||
class="PrivateRadioButtonIcon-root-70 PrivateRadioButtonIcon-checked-72"
|
||||
class="PrivateRadioButtonIcon-root-71 PrivateRadioButtonIcon-checked-73"
|
||||
>
|
||||
<svg
|
||||
aria-hidden="true"
|
||||
@@ -356,7 +356,7 @@ exports[`VehicleUpdate Render 1`] = `
|
||||
</svg>
|
||||
<svg
|
||||
aria-hidden="true"
|
||||
class="MuiSvgIcon-root PrivateRadioButtonIcon-layer-71"
|
||||
class="MuiSvgIcon-root PrivateRadioButtonIcon-layer-72"
|
||||
focusable="false"
|
||||
viewBox="0 0 24 24"
|
||||
>
|
||||
@@ -381,19 +381,19 @@ exports[`VehicleUpdate Render 1`] = `
|
||||
>
|
||||
<span
|
||||
aria-disabled="false"
|
||||
class="MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-66 MuiRadio-root MuiRadio-colorSecondary MuiIconButton-colorSecondary"
|
||||
class="MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-67 MuiRadio-root MuiRadio-colorSecondary MuiIconButton-colorSecondary"
|
||||
>
|
||||
<span
|
||||
class="MuiIconButton-label"
|
||||
>
|
||||
<input
|
||||
class="PrivateSwitchBase-input-69"
|
||||
class="PrivateSwitchBase-input-70"
|
||||
name="log-level-group"
|
||||
type="radio"
|
||||
value="warn"
|
||||
/>
|
||||
<div
|
||||
class="PrivateRadioButtonIcon-root-70"
|
||||
class="PrivateRadioButtonIcon-root-71"
|
||||
>
|
||||
<svg
|
||||
aria-hidden="true"
|
||||
@@ -407,7 +407,7 @@ exports[`VehicleUpdate Render 1`] = `
|
||||
</svg>
|
||||
<svg
|
||||
aria-hidden="true"
|
||||
class="MuiSvgIcon-root PrivateRadioButtonIcon-layer-71"
|
||||
class="MuiSvgIcon-root PrivateRadioButtonIcon-layer-72"
|
||||
focusable="false"
|
||||
viewBox="0 0 24 24"
|
||||
>
|
||||
@@ -432,19 +432,19 @@ exports[`VehicleUpdate Render 1`] = `
|
||||
>
|
||||
<span
|
||||
aria-disabled="false"
|
||||
class="MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-66 MuiRadio-root MuiRadio-colorSecondary MuiIconButton-colorSecondary"
|
||||
class="MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-67 MuiRadio-root MuiRadio-colorSecondary MuiIconButton-colorSecondary"
|
||||
>
|
||||
<span
|
||||
class="MuiIconButton-label"
|
||||
>
|
||||
<input
|
||||
class="PrivateSwitchBase-input-69"
|
||||
class="PrivateSwitchBase-input-70"
|
||||
name="log-level-group"
|
||||
type="radio"
|
||||
value="error"
|
||||
/>
|
||||
<div
|
||||
class="PrivateRadioButtonIcon-root-70"
|
||||
class="PrivateRadioButtonIcon-root-71"
|
||||
>
|
||||
<svg
|
||||
aria-hidden="true"
|
||||
@@ -458,7 +458,7 @@ exports[`VehicleUpdate Render 1`] = `
|
||||
</svg>
|
||||
<svg
|
||||
aria-hidden="true"
|
||||
class="MuiSvgIcon-root PrivateRadioButtonIcon-layer-71"
|
||||
class="MuiSvgIcon-root PrivateRadioButtonIcon-layer-72"
|
||||
focusable="false"
|
||||
viewBox="0 0 24 24"
|
||||
>
|
||||
@@ -483,19 +483,19 @@ exports[`VehicleUpdate Render 1`] = `
|
||||
>
|
||||
<span
|
||||
aria-disabled="false"
|
||||
class="MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-66 MuiRadio-root MuiRadio-colorSecondary MuiIconButton-colorSecondary"
|
||||
class="MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-67 MuiRadio-root MuiRadio-colorSecondary MuiIconButton-colorSecondary"
|
||||
>
|
||||
<span
|
||||
class="MuiIconButton-label"
|
||||
>
|
||||
<input
|
||||
class="PrivateSwitchBase-input-69"
|
||||
class="PrivateSwitchBase-input-70"
|
||||
name="log-level-group"
|
||||
type="radio"
|
||||
value="critical"
|
||||
/>
|
||||
<div
|
||||
class="PrivateRadioButtonIcon-root-70"
|
||||
class="PrivateRadioButtonIcon-root-71"
|
||||
>
|
||||
<svg
|
||||
aria-hidden="true"
|
||||
@@ -509,7 +509,7 @@ exports[`VehicleUpdate Render 1`] = `
|
||||
</svg>
|
||||
<svg
|
||||
aria-hidden="true"
|
||||
class="MuiSvgIcon-root PrivateRadioButtonIcon-layer-71"
|
||||
class="MuiSvgIcon-root PrivateRadioButtonIcon-layer-72"
|
||||
focusable="false"
|
||||
viewBox="0 0 24 24"
|
||||
>
|
||||
@@ -544,14 +544,14 @@ exports[`VehicleUpdate Render 1`] = `
|
||||
>
|
||||
<span
|
||||
aria-disabled="false"
|
||||
class="MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-66 MuiCheckbox-root MuiCheckbox-colorSecondary PrivateSwitchBase-checked-67 Mui-checked MuiIconButton-colorSecondary"
|
||||
class="MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-67 MuiCheckbox-root MuiCheckbox-colorSecondary PrivateSwitchBase-checked-68 Mui-checked MuiIconButton-colorSecondary"
|
||||
>
|
||||
<span
|
||||
class="MuiIconButton-label"
|
||||
>
|
||||
<input
|
||||
checked=""
|
||||
class="PrivateSwitchBase-input-69"
|
||||
class="PrivateSwitchBase-input-70"
|
||||
data-indeterminate="false"
|
||||
type="checkbox"
|
||||
value=""
|
||||
@@ -610,10 +610,10 @@ exports[`VehicleUpdate Render 1`] = `
|
||||
/>
|
||||
<fieldset
|
||||
aria-hidden="true"
|
||||
class="PrivateNotchedOutline-root-62 MuiOutlinedInput-notchedOutline"
|
||||
class="PrivateNotchedOutline-root-63 MuiOutlinedInput-notchedOutline"
|
||||
>
|
||||
<legend
|
||||
class="PrivateNotchedOutline-legendLabelled-64 PrivateNotchedOutline-legendNotched-65"
|
||||
class="PrivateNotchedOutline-legendLabelled-65 PrivateNotchedOutline-legendNotched-66"
|
||||
>
|
||||
<span>
|
||||
Max Memory Buffer Size (0 uses default size)
|
||||
@@ -628,13 +628,13 @@ exports[`VehicleUpdate Render 1`] = `
|
||||
>
|
||||
<span
|
||||
aria-disabled="false"
|
||||
class="MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-66 MuiCheckbox-root MuiCheckbox-colorSecondary PrivateSwitchBase-checked-67 Mui-checked MuiIconButton-colorSecondary"
|
||||
class="MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-67 MuiCheckbox-root MuiCheckbox-colorSecondary PrivateSwitchBase-checked-68 Mui-checked MuiIconButton-colorSecondary"
|
||||
>
|
||||
<span
|
||||
class="MuiIconButton-label"
|
||||
>
|
||||
<input
|
||||
class="PrivateSwitchBase-input-69"
|
||||
class="PrivateSwitchBase-input-70"
|
||||
data-indeterminate="false"
|
||||
type="checkbox"
|
||||
value=""
|
||||
@@ -694,10 +694,10 @@ exports[`VehicleUpdate Render 1`] = `
|
||||
/>
|
||||
<fieldset
|
||||
aria-hidden="true"
|
||||
class="PrivateNotchedOutline-root-62 MuiOutlinedInput-notchedOutline"
|
||||
class="PrivateNotchedOutline-root-63 MuiOutlinedInput-notchedOutline"
|
||||
>
|
||||
<legend
|
||||
class="PrivateNotchedOutline-legendLabelled-64 PrivateNotchedOutline-legendNotched-65"
|
||||
class="PrivateNotchedOutline-legendLabelled-65 PrivateNotchedOutline-legendNotched-66"
|
||||
>
|
||||
<span>
|
||||
Max Disk Buffer Size (0 uses default size)
|
||||
@@ -708,7 +708,7 @@ exports[`VehicleUpdate Render 1`] = `
|
||||
</div>
|
||||
</div>
|
||||
<button
|
||||
class="MuiButtonBase-root MuiButton-root MuiButton-contained makeStyles-submit-6 MuiButton-containedPrimary MuiButton-fullWidth"
|
||||
class="MuiButtonBase-root MuiButton-root MuiButton-contained makeStyles-submit-0 MuiButton-containedPrimary MuiButton-fullWidth"
|
||||
tabindex="0"
|
||||
type="submit"
|
||||
>
|
||||
|
||||
@@ -9,7 +9,8 @@ import { VehicleProvider } from "../../Contexts/VehicleContext";
|
||||
import { StatusProvider } from "../../Contexts/StatusContext";
|
||||
import { UserProvider, setToken } from "../../Contexts/UserContext";
|
||||
import { TEST_AUTH_OBJECT } from "../../../utils/testing";
|
||||
import MainForm from "./index"
|
||||
import MainForm from "./index";
|
||||
import addSnapshotSerializer from "../../../utils/snapshot";
|
||||
|
||||
const renderVehicleUpdate = async () => {
|
||||
const { container } = render(
|
||||
@@ -23,11 +24,17 @@ const renderVehicleUpdate = async () => {
|
||||
</StatusProvider>
|
||||
</VehicleProvider>
|
||||
);
|
||||
await waitFor(() => { /* render */ });
|
||||
await waitFor(() => {
|
||||
/* render */
|
||||
});
|
||||
return container;
|
||||
};
|
||||
|
||||
describe("VehicleUpdate", () => {
|
||||
beforeAll(() => {
|
||||
addSnapshotSerializer(expect);
|
||||
});
|
||||
|
||||
it("Render", async () => {
|
||||
setToken(TEST_AUTH_OBJECT);
|
||||
const container = await renderVehicleUpdate();
|
||||
|
||||
@@ -2,11 +2,13 @@ import React from "react";
|
||||
import { render, waitFor } from "@testing-library/react";
|
||||
|
||||
import DownloadCerts from "./DownloadCerts";
|
||||
import addSnapshotSerializer from "../../../utils/snapshot";
|
||||
|
||||
describe("DownloadCerts", () => {
|
||||
beforeAll(() => {
|
||||
global.URL.createObjectURL = jest.fn();
|
||||
global.URL.revokeObjectURL = jest.fn();
|
||||
addSnapshotSerializer(expect);
|
||||
});
|
||||
|
||||
it("Render", async () => {
|
||||
|
||||
@@ -23,7 +23,7 @@ exports[`DownloadCerts Render 1`] = `
|
||||
</li>
|
||||
</ul>
|
||||
<button
|
||||
class="MuiButtonBase-root MuiButton-root MuiButton-contained makeStyles-submit-6 MuiButton-containedPrimary MuiButton-fullWidth"
|
||||
class="MuiButtonBase-root MuiButton-root MuiButton-contained makeStyles-submit-0 MuiButton-containedPrimary MuiButton-fullWidth"
|
||||
tabindex="0"
|
||||
type="submit"
|
||||
>
|
||||
|
||||
@@ -4,6 +4,7 @@ import { render, waitFor } from "@testing-library/react";
|
||||
import CarUpdateStatusProgress from "../CarUpdateStatusProgress";
|
||||
import useStyles from "../../useStyles";
|
||||
import s from "./Statuses";
|
||||
import addSnapshotSerializer from "../../../utils/snapshot";
|
||||
|
||||
const TestWrapper = ({ status }) => {
|
||||
const classes = useStyles();
|
||||
@@ -17,6 +18,10 @@ const renderCarUpdateStatusProgress = async (status) => {
|
||||
};
|
||||
|
||||
describe("CarUpdateStatusProgress", () => {
|
||||
beforeAll(() => {
|
||||
addSnapshotSerializer(expect);
|
||||
});
|
||||
|
||||
const tests = [
|
||||
{
|
||||
name: "manifest_received",
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -7,6 +7,7 @@ import { CarUpdatesProvider } from "../../Contexts/CarUpdatesContext";
|
||||
import CarUpdateStatusTable from "../CarUpdateStatusTable";
|
||||
import { StatusProvider } from "../../Contexts/StatusContext";
|
||||
import { TEST_AUTH_OBJECT } from "../../../utils/testing";
|
||||
import addSnapshotSerializer from "../../../utils/snapshot";
|
||||
|
||||
const renderCarUpdateStatusTable = async () => {
|
||||
const { container } = render(
|
||||
@@ -22,17 +23,7 @@ const renderCarUpdateStatusTable = async () => {
|
||||
|
||||
describe("CarUpdateStatusTable", () => {
|
||||
beforeAll(() => {
|
||||
expect.addSnapshotSerializer({
|
||||
test: function (val) {
|
||||
return val && typeof val === "string" && val.indexOf("mui-") >= 0;
|
||||
},
|
||||
print: function (val) {
|
||||
let str = val;
|
||||
str = str.replace(/mui-\d*/g, "mui-00000");
|
||||
|
||||
return `"${str}"`;
|
||||
},
|
||||
});
|
||||
addSnapshotSerializer(expect);
|
||||
});
|
||||
|
||||
it("Render", async () => {
|
||||
|
||||
@@ -194,7 +194,7 @@ exports[`CarUpdateStatusTable Render 1`] = `
|
||||
/>
|
||||
<p
|
||||
class="MuiTypography-root MuiTablePagination-caption MuiTypography-body2 MuiTypography-colorInherit"
|
||||
id="mui-00000"
|
||||
id="mui-0"
|
||||
>
|
||||
Rows per page:
|
||||
</p>
|
||||
@@ -204,7 +204,7 @@ exports[`CarUpdateStatusTable Render 1`] = `
|
||||
<select
|
||||
aria-label="rows per page"
|
||||
class="MuiSelect-root MuiSelect-select MuiTablePagination-select MuiInputBase-input"
|
||||
id="mui-00000"
|
||||
id="mui-0"
|
||||
>
|
||||
<option
|
||||
class="MuiTablePagination-menuItem"
|
||||
|
||||
@@ -2,11 +2,13 @@ import React from "react";
|
||||
import { render, waitFor } from "@testing-library/react";
|
||||
|
||||
import DownloadFileLink from ".";
|
||||
import addSnapshotSerializer from "../../../utils/snapshot";
|
||||
|
||||
describe("DownloadFileLink", () => {
|
||||
beforeAll(() => {
|
||||
global.URL.createObjectURL = jest.fn();
|
||||
global.URL.revokeObjectURL = jest.fn();
|
||||
addSnapshotSerializer(expect);
|
||||
});
|
||||
|
||||
it("Render", async () => {
|
||||
|
||||
@@ -1,20 +1,15 @@
|
||||
import React from "react";
|
||||
|
||||
const ResponsiveIFrame = (props) => {
|
||||
const { classes, src, title } = props;
|
||||
const { classes, src, title, fullscreen } = props;
|
||||
const container = fullscreen
|
||||
? classes.iframeResponsive
|
||||
: classes.embeddedWrapper;
|
||||
|
||||
return (
|
||||
<div className={classes.embeddedWrapper}>
|
||||
<div className={container}>
|
||||
<iframe
|
||||
style={{
|
||||
position: "absolute",
|
||||
top: 0,
|
||||
left: 0,
|
||||
bottom: 0,
|
||||
right: 0,
|
||||
width: "100%",
|
||||
height: "100%",
|
||||
}}
|
||||
className={classes.iframeResponsive}
|
||||
title={title}
|
||||
src={src}
|
||||
frameBorder="0"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { render, waitFor } from "@testing-library/react";
|
||||
|
||||
import TabPanel from "./index"
|
||||
|
||||
import TabPanel from "./index";
|
||||
import addSnapshotSerializer from "../../../utils/snapshot";
|
||||
|
||||
const renderTabPanel = async () => {
|
||||
const { container } = render(
|
||||
@@ -9,11 +9,15 @@ const renderTabPanel = async () => {
|
||||
<div>Test</div>
|
||||
</TabPanel>
|
||||
);
|
||||
await waitFor(() => { });
|
||||
await waitFor(() => {});
|
||||
return container;
|
||||
};
|
||||
|
||||
describe("TabPanel", () => {
|
||||
beforeAll(() => {
|
||||
addSnapshotSerializer(expect);
|
||||
});
|
||||
|
||||
it("Render", async () => {
|
||||
const container = await renderTabPanel();
|
||||
expect(container).toMatchSnapshot();
|
||||
|
||||
26
src/components/Dashboard/index.jsx
Normal file
26
src/components/Dashboard/index.jsx
Normal file
@@ -0,0 +1,26 @@
|
||||
import React, { useEffect } from "react";
|
||||
import ResponsiveIFrame from "../Controls/ResponsiveIFrame";
|
||||
import { SupersetDashboardURL } from "../../services/superset";
|
||||
import { useStatusContext } from "../Contexts/StatusContext";
|
||||
import useStyles from "../useStyles";
|
||||
|
||||
const Dashboard = () => {
|
||||
const classes = useStyles();
|
||||
const { setTitle } = useStatusContext();
|
||||
|
||||
useEffect(() => {
|
||||
setTitle("Datascope");
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<ResponsiveIFrame
|
||||
src={SupersetDashboardURL}
|
||||
title="Dashboard"
|
||||
classes={classes}
|
||||
fullscreen
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
export default Dashboard;
|
||||
@@ -15,11 +15,11 @@ exports[`FleetAddForm Render 1`] = `
|
||||
data-testid="mocked-fleetprovider"
|
||||
>
|
||||
<div
|
||||
class="makeStyles-paper-3"
|
||||
class="makeStyles-paper-0"
|
||||
>
|
||||
<form
|
||||
action="{onSubmit}"
|
||||
class="makeStyles-form-5"
|
||||
class="makeStyles-form-0"
|
||||
novalidate=""
|
||||
>
|
||||
<div
|
||||
@@ -55,10 +55,10 @@ exports[`FleetAddForm Render 1`] = `
|
||||
/>
|
||||
<fieldset
|
||||
aria-hidden="true"
|
||||
class="PrivateNotchedOutline-root-62 MuiOutlinedInput-notchedOutline"
|
||||
class="PrivateNotchedOutline-root-63 MuiOutlinedInput-notchedOutline"
|
||||
>
|
||||
<legend
|
||||
class="PrivateNotchedOutline-legendLabelled-64"
|
||||
class="PrivateNotchedOutline-legendLabelled-65"
|
||||
>
|
||||
<span>
|
||||
Name
|
||||
@@ -85,19 +85,19 @@ exports[`FleetAddForm Render 1`] = `
|
||||
>
|
||||
<span
|
||||
aria-disabled="false"
|
||||
class="MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-66 MuiRadio-root MuiRadio-colorSecondary MuiIconButton-colorSecondary"
|
||||
class="MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-67 MuiRadio-root MuiRadio-colorSecondary MuiIconButton-colorSecondary"
|
||||
>
|
||||
<span
|
||||
class="MuiIconButton-label"
|
||||
>
|
||||
<input
|
||||
class="PrivateSwitchBase-input-69"
|
||||
class="PrivateSwitchBase-input-70"
|
||||
name="log-level-group"
|
||||
type="radio"
|
||||
value="trace"
|
||||
/>
|
||||
<div
|
||||
class="PrivateRadioButtonIcon-root-70"
|
||||
class="PrivateRadioButtonIcon-root-71"
|
||||
>
|
||||
<svg
|
||||
aria-hidden="true"
|
||||
@@ -111,7 +111,7 @@ exports[`FleetAddForm Render 1`] = `
|
||||
</svg>
|
||||
<svg
|
||||
aria-hidden="true"
|
||||
class="MuiSvgIcon-root PrivateRadioButtonIcon-layer-71"
|
||||
class="MuiSvgIcon-root PrivateRadioButtonIcon-layer-72"
|
||||
focusable="false"
|
||||
viewBox="0 0 24 24"
|
||||
>
|
||||
@@ -136,19 +136,19 @@ exports[`FleetAddForm Render 1`] = `
|
||||
>
|
||||
<span
|
||||
aria-disabled="false"
|
||||
class="MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-66 MuiRadio-root MuiRadio-colorSecondary MuiIconButton-colorSecondary"
|
||||
class="MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-67 MuiRadio-root MuiRadio-colorSecondary MuiIconButton-colorSecondary"
|
||||
>
|
||||
<span
|
||||
class="MuiIconButton-label"
|
||||
>
|
||||
<input
|
||||
class="PrivateSwitchBase-input-69"
|
||||
class="PrivateSwitchBase-input-70"
|
||||
name="log-level-group"
|
||||
type="radio"
|
||||
value="debug"
|
||||
/>
|
||||
<div
|
||||
class="PrivateRadioButtonIcon-root-70"
|
||||
class="PrivateRadioButtonIcon-root-71"
|
||||
>
|
||||
<svg
|
||||
aria-hidden="true"
|
||||
@@ -162,7 +162,7 @@ exports[`FleetAddForm Render 1`] = `
|
||||
</svg>
|
||||
<svg
|
||||
aria-hidden="true"
|
||||
class="MuiSvgIcon-root PrivateRadioButtonIcon-layer-71"
|
||||
class="MuiSvgIcon-root PrivateRadioButtonIcon-layer-72"
|
||||
focusable="false"
|
||||
viewBox="0 0 24 24"
|
||||
>
|
||||
@@ -187,20 +187,20 @@ exports[`FleetAddForm Render 1`] = `
|
||||
>
|
||||
<span
|
||||
aria-disabled="false"
|
||||
class="MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-66 MuiRadio-root MuiRadio-colorSecondary PrivateSwitchBase-checked-67 Mui-checked MuiIconButton-colorSecondary"
|
||||
class="MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-67 MuiRadio-root MuiRadio-colorSecondary PrivateSwitchBase-checked-68 Mui-checked MuiIconButton-colorSecondary"
|
||||
>
|
||||
<span
|
||||
class="MuiIconButton-label"
|
||||
>
|
||||
<input
|
||||
checked=""
|
||||
class="PrivateSwitchBase-input-69"
|
||||
class="PrivateSwitchBase-input-70"
|
||||
name="log-level-group"
|
||||
type="radio"
|
||||
value="info"
|
||||
/>
|
||||
<div
|
||||
class="PrivateRadioButtonIcon-root-70 PrivateRadioButtonIcon-checked-72"
|
||||
class="PrivateRadioButtonIcon-root-71 PrivateRadioButtonIcon-checked-73"
|
||||
>
|
||||
<svg
|
||||
aria-hidden="true"
|
||||
@@ -214,7 +214,7 @@ exports[`FleetAddForm Render 1`] = `
|
||||
</svg>
|
||||
<svg
|
||||
aria-hidden="true"
|
||||
class="MuiSvgIcon-root PrivateRadioButtonIcon-layer-71"
|
||||
class="MuiSvgIcon-root PrivateRadioButtonIcon-layer-72"
|
||||
focusable="false"
|
||||
viewBox="0 0 24 24"
|
||||
>
|
||||
@@ -239,19 +239,19 @@ exports[`FleetAddForm Render 1`] = `
|
||||
>
|
||||
<span
|
||||
aria-disabled="false"
|
||||
class="MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-66 MuiRadio-root MuiRadio-colorSecondary MuiIconButton-colorSecondary"
|
||||
class="MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-67 MuiRadio-root MuiRadio-colorSecondary MuiIconButton-colorSecondary"
|
||||
>
|
||||
<span
|
||||
class="MuiIconButton-label"
|
||||
>
|
||||
<input
|
||||
class="PrivateSwitchBase-input-69"
|
||||
class="PrivateSwitchBase-input-70"
|
||||
name="log-level-group"
|
||||
type="radio"
|
||||
value="warn"
|
||||
/>
|
||||
<div
|
||||
class="PrivateRadioButtonIcon-root-70"
|
||||
class="PrivateRadioButtonIcon-root-71"
|
||||
>
|
||||
<svg
|
||||
aria-hidden="true"
|
||||
@@ -265,7 +265,7 @@ exports[`FleetAddForm Render 1`] = `
|
||||
</svg>
|
||||
<svg
|
||||
aria-hidden="true"
|
||||
class="MuiSvgIcon-root PrivateRadioButtonIcon-layer-71"
|
||||
class="MuiSvgIcon-root PrivateRadioButtonIcon-layer-72"
|
||||
focusable="false"
|
||||
viewBox="0 0 24 24"
|
||||
>
|
||||
@@ -290,19 +290,19 @@ exports[`FleetAddForm Render 1`] = `
|
||||
>
|
||||
<span
|
||||
aria-disabled="false"
|
||||
class="MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-66 MuiRadio-root MuiRadio-colorSecondary MuiIconButton-colorSecondary"
|
||||
class="MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-67 MuiRadio-root MuiRadio-colorSecondary MuiIconButton-colorSecondary"
|
||||
>
|
||||
<span
|
||||
class="MuiIconButton-label"
|
||||
>
|
||||
<input
|
||||
class="PrivateSwitchBase-input-69"
|
||||
class="PrivateSwitchBase-input-70"
|
||||
name="log-level-group"
|
||||
type="radio"
|
||||
value="error"
|
||||
/>
|
||||
<div
|
||||
class="PrivateRadioButtonIcon-root-70"
|
||||
class="PrivateRadioButtonIcon-root-71"
|
||||
>
|
||||
<svg
|
||||
aria-hidden="true"
|
||||
@@ -316,7 +316,7 @@ exports[`FleetAddForm Render 1`] = `
|
||||
</svg>
|
||||
<svg
|
||||
aria-hidden="true"
|
||||
class="MuiSvgIcon-root PrivateRadioButtonIcon-layer-71"
|
||||
class="MuiSvgIcon-root PrivateRadioButtonIcon-layer-72"
|
||||
focusable="false"
|
||||
viewBox="0 0 24 24"
|
||||
>
|
||||
@@ -341,19 +341,19 @@ exports[`FleetAddForm Render 1`] = `
|
||||
>
|
||||
<span
|
||||
aria-disabled="false"
|
||||
class="MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-66 MuiRadio-root MuiRadio-colorSecondary MuiIconButton-colorSecondary"
|
||||
class="MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-67 MuiRadio-root MuiRadio-colorSecondary MuiIconButton-colorSecondary"
|
||||
>
|
||||
<span
|
||||
class="MuiIconButton-label"
|
||||
>
|
||||
<input
|
||||
class="PrivateSwitchBase-input-69"
|
||||
class="PrivateSwitchBase-input-70"
|
||||
name="log-level-group"
|
||||
type="radio"
|
||||
value="critical"
|
||||
/>
|
||||
<div
|
||||
class="PrivateRadioButtonIcon-root-70"
|
||||
class="PrivateRadioButtonIcon-root-71"
|
||||
>
|
||||
<svg
|
||||
aria-hidden="true"
|
||||
@@ -367,7 +367,7 @@ exports[`FleetAddForm Render 1`] = `
|
||||
</svg>
|
||||
<svg
|
||||
aria-hidden="true"
|
||||
class="MuiSvgIcon-root PrivateRadioButtonIcon-layer-71"
|
||||
class="MuiSvgIcon-root PrivateRadioButtonIcon-layer-72"
|
||||
focusable="false"
|
||||
viewBox="0 0 24 24"
|
||||
>
|
||||
@@ -402,14 +402,14 @@ exports[`FleetAddForm Render 1`] = `
|
||||
>
|
||||
<span
|
||||
aria-disabled="false"
|
||||
class="MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-66 MuiCheckbox-root MuiCheckbox-colorSecondary PrivateSwitchBase-checked-67 Mui-checked MuiIconButton-colorSecondary"
|
||||
class="MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-67 MuiCheckbox-root MuiCheckbox-colorSecondary PrivateSwitchBase-checked-68 Mui-checked MuiIconButton-colorSecondary"
|
||||
>
|
||||
<span
|
||||
class="MuiIconButton-label"
|
||||
>
|
||||
<input
|
||||
checked=""
|
||||
class="PrivateSwitchBase-input-69"
|
||||
class="PrivateSwitchBase-input-70"
|
||||
data-indeterminate="false"
|
||||
type="checkbox"
|
||||
value=""
|
||||
@@ -468,10 +468,10 @@ exports[`FleetAddForm Render 1`] = `
|
||||
/>
|
||||
<fieldset
|
||||
aria-hidden="true"
|
||||
class="PrivateNotchedOutline-root-62 MuiOutlinedInput-notchedOutline"
|
||||
class="PrivateNotchedOutline-root-63 MuiOutlinedInput-notchedOutline"
|
||||
>
|
||||
<legend
|
||||
class="PrivateNotchedOutline-legendLabelled-64 PrivateNotchedOutline-legendNotched-65"
|
||||
class="PrivateNotchedOutline-legendLabelled-65 PrivateNotchedOutline-legendNotched-66"
|
||||
>
|
||||
<span>
|
||||
Max Memory Buffer Size (0 uses default size)
|
||||
@@ -486,13 +486,13 @@ exports[`FleetAddForm Render 1`] = `
|
||||
>
|
||||
<span
|
||||
aria-disabled="false"
|
||||
class="MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-66 MuiCheckbox-root MuiCheckbox-colorSecondary MuiIconButton-colorSecondary"
|
||||
class="MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-67 MuiCheckbox-root MuiCheckbox-colorSecondary MuiIconButton-colorSecondary"
|
||||
>
|
||||
<span
|
||||
class="MuiIconButton-label"
|
||||
>
|
||||
<input
|
||||
class="PrivateSwitchBase-input-69"
|
||||
class="PrivateSwitchBase-input-70"
|
||||
data-indeterminate="false"
|
||||
type="checkbox"
|
||||
value=""
|
||||
@@ -553,10 +553,10 @@ exports[`FleetAddForm Render 1`] = `
|
||||
/>
|
||||
<fieldset
|
||||
aria-hidden="true"
|
||||
class="PrivateNotchedOutline-root-62 MuiOutlinedInput-notchedOutline"
|
||||
class="PrivateNotchedOutline-root-63 MuiOutlinedInput-notchedOutline"
|
||||
>
|
||||
<legend
|
||||
class="PrivateNotchedOutline-legendLabelled-64 PrivateNotchedOutline-legendNotched-65"
|
||||
class="PrivateNotchedOutline-legendLabelled-65 PrivateNotchedOutline-legendNotched-66"
|
||||
>
|
||||
<span>
|
||||
Max Disk Buffer Size (0 uses default size)
|
||||
@@ -567,7 +567,7 @@ exports[`FleetAddForm Render 1`] = `
|
||||
</div>
|
||||
</div>
|
||||
<button
|
||||
class="MuiButtonBase-root MuiButton-root MuiButton-contained makeStyles-submit-6 MuiButton-containedPrimary MuiButton-fullWidth"
|
||||
class="MuiButtonBase-root MuiButton-root MuiButton-contained makeStyles-submit-0 MuiButton-containedPrimary MuiButton-fullWidth"
|
||||
tabindex="0"
|
||||
type="submit"
|
||||
>
|
||||
|
||||
@@ -9,7 +9,8 @@ import { FleetProvider } from "../../Contexts/FleetContext";
|
||||
import { StatusProvider } from "../../Contexts/StatusContext";
|
||||
import { UserProvider, setToken } from "../../Contexts/UserContext";
|
||||
import { TEST_AUTH_OBJECT } from "../../../utils/testing";
|
||||
import MainForm from "./index"
|
||||
import MainForm from "./index";
|
||||
import addSnapshotSerializer from "../../../utils/snapshot";
|
||||
|
||||
const renderFleetAdd = async () => {
|
||||
const { container } = render(
|
||||
@@ -23,11 +24,17 @@ const renderFleetAdd = async () => {
|
||||
</StatusProvider>
|
||||
</FleetProvider>
|
||||
);
|
||||
await waitFor(() => { /* render */ });
|
||||
await waitFor(() => {
|
||||
/* render */
|
||||
});
|
||||
return container;
|
||||
};
|
||||
|
||||
describe("FleetAddForm", () => {
|
||||
beforeAll(() => {
|
||||
addSnapshotSerializer(expect);
|
||||
});
|
||||
|
||||
it("Render", async () => {
|
||||
setToken(TEST_AUTH_OBJECT);
|
||||
const container = await renderFleetAdd();
|
||||
|
||||
@@ -15,11 +15,11 @@ exports[`FleetCANFilterAdd Render 1`] = `
|
||||
data-testid="mocked-fleetprovider"
|
||||
>
|
||||
<div
|
||||
class="makeStyles-paper-3"
|
||||
class="makeStyles-paper-0"
|
||||
>
|
||||
<form
|
||||
action="{onSubmit}"
|
||||
class="makeStyles-form-5"
|
||||
class="makeStyles-form-0"
|
||||
novalidate=""
|
||||
>
|
||||
<div
|
||||
@@ -56,10 +56,10 @@ exports[`FleetCANFilterAdd Render 1`] = `
|
||||
/>
|
||||
<fieldset
|
||||
aria-hidden="true"
|
||||
class="PrivateNotchedOutline-root-62 MuiOutlinedInput-notchedOutline"
|
||||
class="PrivateNotchedOutline-root-63 MuiOutlinedInput-notchedOutline"
|
||||
>
|
||||
<legend
|
||||
class="PrivateNotchedOutline-legendLabelled-64"
|
||||
class="PrivateNotchedOutline-legendLabelled-65"
|
||||
>
|
||||
<span>
|
||||
Fleet Name
|
||||
@@ -102,10 +102,10 @@ exports[`FleetCANFilterAdd Render 1`] = `
|
||||
/>
|
||||
<fieldset
|
||||
aria-hidden="true"
|
||||
class="PrivateNotchedOutline-root-62 MuiOutlinedInput-notchedOutline"
|
||||
class="PrivateNotchedOutline-root-63 MuiOutlinedInput-notchedOutline"
|
||||
>
|
||||
<legend
|
||||
class="PrivateNotchedOutline-legendLabelled-64"
|
||||
class="PrivateNotchedOutline-legendLabelled-65"
|
||||
>
|
||||
<span>
|
||||
CAN ID
|
||||
@@ -140,10 +140,10 @@ exports[`FleetCANFilterAdd Render 1`] = `
|
||||
/>
|
||||
<fieldset
|
||||
aria-hidden="true"
|
||||
class="PrivateNotchedOutline-root-62 MuiOutlinedInput-notchedOutline"
|
||||
class="PrivateNotchedOutline-root-63 MuiOutlinedInput-notchedOutline"
|
||||
>
|
||||
<legend
|
||||
class="PrivateNotchedOutline-legendLabelled-64"
|
||||
class="PrivateNotchedOutline-legendLabelled-65"
|
||||
>
|
||||
<span>
|
||||
Interval
|
||||
@@ -153,7 +153,7 @@ exports[`FleetCANFilterAdd Render 1`] = `
|
||||
</div>
|
||||
</div>
|
||||
<button
|
||||
class="MuiButtonBase-root MuiButton-root MuiButton-contained makeStyles-submit-6 MuiButton-containedPrimary MuiButton-fullWidth"
|
||||
class="MuiButtonBase-root MuiButton-root MuiButton-contained makeStyles-submit-0 MuiButton-containedPrimary MuiButton-fullWidth"
|
||||
tabindex="0"
|
||||
type="submit"
|
||||
>
|
||||
|
||||
@@ -9,7 +9,8 @@ import { FleetProvider } from "../../../../Contexts/FleetContext";
|
||||
import { StatusProvider } from "../../../../Contexts/StatusContext";
|
||||
import { UserProvider, setToken } from "../../../../Contexts/UserContext";
|
||||
import { TEST_AUTH_OBJECT } from "../../../../../utils/testing";
|
||||
import MainForm from "./index"
|
||||
import MainForm from "./index";
|
||||
import addSnapshotSerializer from "../../../../../utils/snapshot";
|
||||
|
||||
const renderFleetCANFilterAdd = async () => {
|
||||
const { container } = render(
|
||||
@@ -23,11 +24,15 @@ const renderFleetCANFilterAdd = async () => {
|
||||
</StatusProvider>
|
||||
</FleetProvider>
|
||||
);
|
||||
await waitFor(() => { });
|
||||
await waitFor(() => {});
|
||||
return container;
|
||||
};
|
||||
|
||||
describe("FleetCANFilterAdd", () => {
|
||||
beforeAll(() => {
|
||||
addSnapshotSerializer(expect);
|
||||
});
|
||||
|
||||
it("Render", async () => {
|
||||
setToken(TEST_AUTH_OBJECT);
|
||||
const container = await renderFleetCANFilterAdd();
|
||||
|
||||
@@ -15,16 +15,16 @@ exports[`FleetCANFiltersTable Render 1`] = `
|
||||
data-testid="mocked-fleetprovider"
|
||||
>
|
||||
<div
|
||||
class="makeStyles-paper-3 makeStyles-tableSize-53"
|
||||
class="makeStyles-paper-0 makeStyles-tableSize-0"
|
||||
>
|
||||
<div
|
||||
class="MuiGrid-root makeStyles-root-14 MuiGrid-container MuiGrid-spacing-xs-2"
|
||||
class="MuiGrid-root makeStyles-root-0 MuiGrid-container MuiGrid-spacing-xs-2"
|
||||
>
|
||||
<div
|
||||
class="MuiGrid-root makeStyles-textJustifyAlign-47 MuiGrid-item MuiGrid-grid-md-4"
|
||||
class="MuiGrid-root makeStyles-textJustifyAlign-0 MuiGrid-item MuiGrid-grid-md-4"
|
||||
>
|
||||
<a
|
||||
class="makeStyles-labelInline-9"
|
||||
class="makeStyles-labelInline-0"
|
||||
href="/fleet/undefined/filter-add"
|
||||
>
|
||||
<svg
|
||||
@@ -41,10 +41,10 @@ exports[`FleetCANFiltersTable Render 1`] = `
|
||||
</div>
|
||||
<div
|
||||
align="right"
|
||||
class="MuiGrid-root makeStyles-textCenterAlign-48 MuiGrid-item MuiGrid-grid-md-8"
|
||||
class="MuiGrid-root makeStyles-textCenterAlign-0 MuiGrid-item MuiGrid-grid-md-8"
|
||||
>
|
||||
<div
|
||||
class="MuiFormControl-root makeStyles-margin-28 makeStyles-fullWidth-50"
|
||||
class="MuiFormControl-root makeStyles-margin-0 makeStyles-fullWidth-0"
|
||||
>
|
||||
<label
|
||||
class="MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated"
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
jest.mock("../../../../Contexts/FleetContext");
|
||||
jest.mock("../../../../Contexts/StatusContext");
|
||||
jest.mock("../../../../Contexts/UserContext");
|
||||
jest.mock('@material-ui/core/utils/unstable_useId', () =>
|
||||
jest.fn().mockReturnValue('mui-test-id'),
|
||||
jest.mock("@material-ui/core/utils/unstable_useId", () =>
|
||||
jest.fn().mockReturnValue("mui-test-id")
|
||||
);
|
||||
|
||||
import { render, waitFor } from "@testing-library/react";
|
||||
@@ -12,7 +12,8 @@ import { FleetProvider } from "../../../../Contexts/FleetContext";
|
||||
import { StatusProvider } from "../../../../Contexts/StatusContext";
|
||||
import { UserProvider, setToken } from "../../../../Contexts/UserContext";
|
||||
import { TEST_AUTH_OBJECT } from "../../../../../utils/testing";
|
||||
import MainForm from "./index"
|
||||
import MainForm from "./index";
|
||||
import addSnapshotSerializer from "../../../../../utils/snapshot";
|
||||
|
||||
const renderFleetCANFiltersTable = async () => {
|
||||
const { container } = render(
|
||||
@@ -26,11 +27,15 @@ const renderFleetCANFiltersTable = async () => {
|
||||
</StatusProvider>
|
||||
</FleetProvider>
|
||||
);
|
||||
await waitFor(() => { });
|
||||
await waitFor(() => {});
|
||||
return container;
|
||||
};
|
||||
|
||||
describe("FleetCANFiltersTable", () => {
|
||||
beforeAll(() => {
|
||||
addSnapshotSerializer(expect);
|
||||
});
|
||||
|
||||
it("Render", async () => {
|
||||
setToken(TEST_AUTH_OBJECT);
|
||||
const container = await renderFleetCANFiltersTable();
|
||||
|
||||
@@ -15,11 +15,11 @@ exports[`FleetCANFilterUpdate Render 1`] = `
|
||||
data-testid="mocked-fleetprovider"
|
||||
>
|
||||
<div
|
||||
class="makeStyles-paper-3"
|
||||
class="makeStyles-paper-0"
|
||||
>
|
||||
<form
|
||||
action="{onSubmit}"
|
||||
class="makeStyles-form-5"
|
||||
class="makeStyles-form-0"
|
||||
novalidate=""
|
||||
>
|
||||
<div
|
||||
@@ -56,10 +56,10 @@ exports[`FleetCANFilterUpdate Render 1`] = `
|
||||
/>
|
||||
<fieldset
|
||||
aria-hidden="true"
|
||||
class="PrivateNotchedOutline-root-62 MuiOutlinedInput-notchedOutline"
|
||||
class="PrivateNotchedOutline-root-63 MuiOutlinedInput-notchedOutline"
|
||||
>
|
||||
<legend
|
||||
class="PrivateNotchedOutline-legendLabelled-64"
|
||||
class="PrivateNotchedOutline-legendLabelled-65"
|
||||
>
|
||||
<span>
|
||||
Fleet Name
|
||||
@@ -103,10 +103,10 @@ exports[`FleetCANFilterUpdate Render 1`] = `
|
||||
/>
|
||||
<fieldset
|
||||
aria-hidden="true"
|
||||
class="PrivateNotchedOutline-root-62 MuiOutlinedInput-notchedOutline"
|
||||
class="PrivateNotchedOutline-root-63 MuiOutlinedInput-notchedOutline"
|
||||
>
|
||||
<legend
|
||||
class="PrivateNotchedOutline-legendLabelled-64"
|
||||
class="PrivateNotchedOutline-legendLabelled-65"
|
||||
>
|
||||
<span>
|
||||
CAN ID
|
||||
@@ -149,10 +149,10 @@ exports[`FleetCANFilterUpdate Render 1`] = `
|
||||
/>
|
||||
<fieldset
|
||||
aria-hidden="true"
|
||||
class="PrivateNotchedOutline-root-62 MuiOutlinedInput-notchedOutline"
|
||||
class="PrivateNotchedOutline-root-63 MuiOutlinedInput-notchedOutline"
|
||||
>
|
||||
<legend
|
||||
class="PrivateNotchedOutline-legendLabelled-64"
|
||||
class="PrivateNotchedOutline-legendLabelled-65"
|
||||
>
|
||||
<span>
|
||||
Interval
|
||||
@@ -163,7 +163,7 @@ exports[`FleetCANFilterUpdate Render 1`] = `
|
||||
</div>
|
||||
</div>
|
||||
<button
|
||||
class="MuiButtonBase-root MuiButton-root MuiButton-contained makeStyles-submit-6 MuiButton-containedPrimary MuiButton-fullWidth"
|
||||
class="MuiButtonBase-root MuiButton-root MuiButton-contained makeStyles-submit-0 MuiButton-containedPrimary MuiButton-fullWidth"
|
||||
tabindex="0"
|
||||
type="submit"
|
||||
>
|
||||
|
||||
@@ -9,7 +9,8 @@ import { FleetProvider } from "../../../../Contexts/FleetContext";
|
||||
import { StatusProvider } from "../../../../Contexts/StatusContext";
|
||||
import { UserProvider, setToken } from "../../../../Contexts/UserContext";
|
||||
import { TEST_AUTH_OBJECT } from "../../../../../utils/testing";
|
||||
import MainForm from "./index"
|
||||
import MainForm from "./index";
|
||||
import addSnapshotSerializer from "../../../../../utils/snapshot";
|
||||
|
||||
const renderFleetCANFilterUpdate = async () => {
|
||||
const { container } = render(
|
||||
@@ -23,11 +24,15 @@ const renderFleetCANFilterUpdate = async () => {
|
||||
</StatusProvider>
|
||||
</FleetProvider>
|
||||
);
|
||||
await waitFor(() => { });
|
||||
await waitFor(() => {});
|
||||
return container;
|
||||
};
|
||||
|
||||
describe("FleetCANFilterUpdate", () => {
|
||||
beforeAll(() => {
|
||||
addSnapshotSerializer(expect);
|
||||
});
|
||||
|
||||
it("Render", async () => {
|
||||
setToken(TEST_AUTH_OBJECT);
|
||||
const container = await renderFleetCANFilterUpdate();
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
jest.mock("../../Contexts/FleetContext");
|
||||
jest.mock("../../Contexts/StatusContext");
|
||||
jest.mock("../../Contexts/UserContext");
|
||||
jest.mock('@material-ui/core/utils/unstable_useId', () =>
|
||||
jest.fn().mockReturnValue('mui-test-id'),
|
||||
jest.mock("@material-ui/core/utils/unstable_useId", () =>
|
||||
jest.fn().mockReturnValue("mui-test-id")
|
||||
);
|
||||
|
||||
import { render, waitFor } from "@testing-library/react";
|
||||
@@ -10,7 +10,8 @@ import { BrowserRouter } from "react-router-dom";
|
||||
|
||||
import { setToken } from "../../Contexts/UserContext";
|
||||
import { TEST_AUTH_OBJECT } from "../../../utils/testing";
|
||||
import CANFiltersTab from "./CANFiltersTab"
|
||||
import CANFiltersTab from "./CANFiltersTab";
|
||||
import addSnapshotSerializer from "../../../utils/snapshot";
|
||||
|
||||
const renderCANFitlersTab = async () => {
|
||||
const { container } = render(
|
||||
@@ -18,11 +19,17 @@ const renderCANFitlersTab = async () => {
|
||||
<CANFiltersTab name="US-TEST" />
|
||||
</BrowserRouter>
|
||||
);
|
||||
await waitFor(() => { /* render */ });
|
||||
await waitFor(() => {
|
||||
/* render */
|
||||
});
|
||||
return container;
|
||||
};
|
||||
|
||||
describe("CANFiltersTab", () => {
|
||||
beforeAll(() => {
|
||||
addSnapshotSerializer(expect);
|
||||
});
|
||||
|
||||
it("Render", async () => {
|
||||
setToken(TEST_AUTH_OBJECT);
|
||||
const container = await renderCANFitlersTab();
|
||||
|
||||
@@ -15,13 +15,13 @@ exports[`FleetDetailsTab Render 1`] = `
|
||||
data-testid="mocked-fleetprovider"
|
||||
>
|
||||
<div
|
||||
class="makeStyles-paper-3 makeStyles-tableSize-53"
|
||||
class="makeStyles-paper-0 makeStyles-tableSize-0"
|
||||
>
|
||||
<div
|
||||
class="MuiGrid-root makeStyles-root-14 MuiGrid-container MuiGrid-spacing-xs-2"
|
||||
class="MuiGrid-root makeStyles-root-0 MuiGrid-container MuiGrid-spacing-xs-2"
|
||||
>
|
||||
<div
|
||||
class="MuiGrid-root makeStyles-textCenterAlign-48 MuiGrid-item MuiGrid-grid-md-12"
|
||||
class="MuiGrid-root makeStyles-textCenterAlign-0 MuiGrid-item MuiGrid-grid-md-12"
|
||||
>
|
||||
<p>
|
||||
<b>
|
||||
@@ -45,7 +45,7 @@ exports[`FleetDetailsTab Render 1`] = `
|
||||
</p>
|
||||
</div>
|
||||
<div
|
||||
class="MuiGrid-root makeStyles-textCenterAlign-48 MuiGrid-item MuiGrid-grid-md-12"
|
||||
class="MuiGrid-root makeStyles-textCenterAlign-0 MuiGrid-item MuiGrid-grid-md-12"
|
||||
>
|
||||
<b>
|
||||
CANBus
|
||||
@@ -87,7 +87,7 @@ exports[`FleetDetailsTab Render 1`] = `
|
||||
</p>
|
||||
</div>
|
||||
<div
|
||||
class="MuiGrid-root makeStyles-textCenterAlign-48 MuiGrid-item MuiGrid-grid-md-12"
|
||||
class="MuiGrid-root makeStyles-textCenterAlign-0 MuiGrid-item MuiGrid-grid-md-12"
|
||||
>
|
||||
<a
|
||||
class=""
|
||||
|
||||
@@ -9,7 +9,8 @@ import { FleetProvider } from "../../../Contexts/FleetContext";
|
||||
import { StatusProvider } from "../../../Contexts/StatusContext";
|
||||
import { UserProvider, setToken } from "../../../Contexts/UserContext";
|
||||
import { TEST_AUTH_OBJECT } from "../../../../utils/testing";
|
||||
import MainForm from "./index"
|
||||
import MainForm from "./index";
|
||||
import addSnapshotSerializer from "../../../../utils/snapshot";
|
||||
|
||||
const renderFleetDetailsTab = async () => {
|
||||
const { container } = render(
|
||||
@@ -23,11 +24,17 @@ const renderFleetDetailsTab = async () => {
|
||||
</StatusProvider>
|
||||
</FleetProvider>
|
||||
);
|
||||
await waitFor(() => { /* render */ });
|
||||
await waitFor(() => {
|
||||
/* render */
|
||||
});
|
||||
return container;
|
||||
};
|
||||
|
||||
describe("FleetDetailsTab", () => {
|
||||
beforeAll(() => {
|
||||
addSnapshotSerializer(expect);
|
||||
});
|
||||
|
||||
it("Render", async () => {
|
||||
setToken(TEST_AUTH_OBJECT);
|
||||
const container = await renderFleetDetailsTab();
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
jest.mock("../../Contexts/FleetContext");
|
||||
jest.mock("../../Contexts/StatusContext");
|
||||
jest.mock("../../Contexts/UserContext");
|
||||
jest.mock('@material-ui/core/utils/unstable_useId', () =>
|
||||
jest.fn().mockReturnValue('mui-test-id'),
|
||||
jest.mock("@material-ui/core/utils/unstable_useId", () =>
|
||||
jest.fn().mockReturnValue("mui-test-id")
|
||||
);
|
||||
|
||||
import { render, waitFor } from "@testing-library/react";
|
||||
@@ -12,27 +12,34 @@ import { FleetProvider } from "../../Contexts/FleetContext";
|
||||
import { StatusProvider } from "../../Contexts/StatusContext";
|
||||
import { UserProvider, setToken } from "../../Contexts/UserContext";
|
||||
import { TEST_AUTH_OBJECT } from "../../../utils/testing";
|
||||
import MainForm from "./DetailsTab"
|
||||
import MainForm from "./DetailsTab";
|
||||
import addSnapshotSerializer from "../../../utils/snapshot";
|
||||
|
||||
const renderDetailsTab = async () => {
|
||||
const { container } = render(
|
||||
<FleetProvider>
|
||||
<StatusProvider>
|
||||
<UserProvider>
|
||||
<MemoryRouter initialEntries={['/testroute/US-TEST']}>
|
||||
<MemoryRouter initialEntries={["/testroute/US-TEST"]}>
|
||||
<Route path="/testroute/:name">
|
||||
<MainForm name="US-TEST" />
|
||||
</Route>
|
||||
</MemoryRouter >
|
||||
</MemoryRouter>
|
||||
</UserProvider>
|
||||
</StatusProvider>
|
||||
</FleetProvider>
|
||||
);
|
||||
await waitFor(() => { /* render */ });
|
||||
await waitFor(() => {
|
||||
/* render */
|
||||
});
|
||||
return container;
|
||||
};
|
||||
|
||||
describe("DetailsTab", () => {
|
||||
beforeAll(() => {
|
||||
addSnapshotSerializer(expect);
|
||||
});
|
||||
|
||||
it("Render", async () => {
|
||||
setToken(TEST_AUTH_OBJECT);
|
||||
const container = await renderDetailsTab();
|
||||
|
||||
@@ -15,11 +15,11 @@ exports[`FleetVehicleAdd Render 1`] = `
|
||||
data-testid="mocked-fleetprovider"
|
||||
>
|
||||
<div
|
||||
class="makeStyles-paper-3"
|
||||
class="makeStyles-paper-0"
|
||||
>
|
||||
<form
|
||||
action="{onSubmit}"
|
||||
class="makeStyles-form-5"
|
||||
class="makeStyles-form-0"
|
||||
novalidate=""
|
||||
>
|
||||
<div
|
||||
@@ -55,10 +55,10 @@ exports[`FleetVehicleAdd Render 1`] = `
|
||||
/>
|
||||
<fieldset
|
||||
aria-hidden="true"
|
||||
class="PrivateNotchedOutline-root-62 MuiOutlinedInput-notchedOutline"
|
||||
class="PrivateNotchedOutline-root-63 MuiOutlinedInput-notchedOutline"
|
||||
>
|
||||
<legend
|
||||
class="PrivateNotchedOutline-legendLabelled-64"
|
||||
class="PrivateNotchedOutline-legendLabelled-65"
|
||||
>
|
||||
<span>
|
||||
VIN
|
||||
@@ -69,7 +69,7 @@ exports[`FleetVehicleAdd Render 1`] = `
|
||||
</div>
|
||||
</div>
|
||||
<button
|
||||
class="MuiButtonBase-root MuiButton-root MuiButton-contained makeStyles-submit-6 MuiButton-containedPrimary MuiButton-fullWidth"
|
||||
class="MuiButtonBase-root MuiButton-root MuiButton-contained makeStyles-submit-0 MuiButton-containedPrimary MuiButton-fullWidth"
|
||||
tabindex="0"
|
||||
type="submit"
|
||||
>
|
||||
|
||||
@@ -9,7 +9,8 @@ import { FleetProvider } from "../../../../Contexts/FleetContext";
|
||||
import { StatusProvider } from "../../../../Contexts/StatusContext";
|
||||
import { UserProvider, setToken } from "../../../../Contexts/UserContext";
|
||||
import { TEST_AUTH_OBJECT } from "../../../../../utils/testing";
|
||||
import MainForm from "./index"
|
||||
import MainForm from "./index";
|
||||
import addSnapshotSerializer from "../../../../../utils/snapshot";
|
||||
|
||||
const renderFleetVehicleAdd = async () => {
|
||||
const { container } = render(
|
||||
@@ -23,11 +24,17 @@ const renderFleetVehicleAdd = async () => {
|
||||
</StatusProvider>
|
||||
</FleetProvider>
|
||||
);
|
||||
await waitFor(() => { /* render */ });
|
||||
await waitFor(() => {
|
||||
/* render */
|
||||
});
|
||||
return container;
|
||||
};
|
||||
|
||||
describe("FleetVehicleAdd", () => {
|
||||
beforeAll(() => {
|
||||
addSnapshotSerializer(expect);
|
||||
});
|
||||
|
||||
it("Render", async () => {
|
||||
setToken(TEST_AUTH_OBJECT);
|
||||
const container = await renderFleetVehicleAdd();
|
||||
|
||||
@@ -15,16 +15,16 @@ exports[`FleetVehiclesTable Render 1`] = `
|
||||
data-testid="mocked-fleetprovider"
|
||||
>
|
||||
<div
|
||||
class="makeStyles-paper-3 makeStyles-tableSize-53"
|
||||
class="makeStyles-paper-0 makeStyles-tableSize-0"
|
||||
>
|
||||
<div
|
||||
class="MuiGrid-root makeStyles-root-14 MuiGrid-container MuiGrid-spacing-xs-2"
|
||||
class="MuiGrid-root makeStyles-root-0 MuiGrid-container MuiGrid-spacing-xs-2"
|
||||
>
|
||||
<div
|
||||
class="MuiGrid-root makeStyles-textJustifyAlign-47 MuiGrid-item MuiGrid-grid-md-4"
|
||||
class="MuiGrid-root makeStyles-textJustifyAlign-0 MuiGrid-item MuiGrid-grid-md-4"
|
||||
>
|
||||
<a
|
||||
class="makeStyles-labelInline-9"
|
||||
class="makeStyles-labelInline-0"
|
||||
href="/fleet/undefined/vehicle-add"
|
||||
>
|
||||
<svg
|
||||
@@ -41,10 +41,10 @@ exports[`FleetVehiclesTable Render 1`] = `
|
||||
</div>
|
||||
<div
|
||||
align="right"
|
||||
class="MuiGrid-root makeStyles-textCenterAlign-48 MuiGrid-item MuiGrid-grid-md-8"
|
||||
class="MuiGrid-root makeStyles-textCenterAlign-0 MuiGrid-item MuiGrid-grid-md-8"
|
||||
>
|
||||
<div
|
||||
class="MuiFormControl-root makeStyles-margin-28 makeStyles-fullWidth-50"
|
||||
class="MuiFormControl-root makeStyles-margin-0 makeStyles-fullWidth-0"
|
||||
>
|
||||
<label
|
||||
class="MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated"
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
jest.mock("../../../../Contexts/FleetContext");
|
||||
jest.mock("../../../../Contexts/StatusContext");
|
||||
jest.mock("../../../../Contexts/UserContext");
|
||||
jest.mock('@material-ui/core/utils/unstable_useId', () =>
|
||||
jest.fn().mockReturnValue('mui-test-id'),
|
||||
jest.mock("@material-ui/core/utils/unstable_useId", () =>
|
||||
jest.fn().mockReturnValue("mui-test-id")
|
||||
);
|
||||
|
||||
import { render, waitFor } from "@testing-library/react";
|
||||
@@ -12,7 +12,8 @@ import { FleetProvider } from "../../../../Contexts/FleetContext";
|
||||
import { StatusProvider } from "../../../../Contexts/StatusContext";
|
||||
import { UserProvider, setToken } from "../../../../Contexts/UserContext";
|
||||
import { TEST_AUTH_OBJECT } from "../../../../../utils/testing";
|
||||
import MainForm from "./index"
|
||||
import MainForm from "./index";
|
||||
import addSnapshotSerializer from "../../../../../utils/snapshot";
|
||||
|
||||
const renderFleetVehiclesTable = async () => {
|
||||
const { container } = render(
|
||||
@@ -26,11 +27,17 @@ const renderFleetVehiclesTable = async () => {
|
||||
</StatusProvider>
|
||||
</FleetProvider>
|
||||
);
|
||||
await waitFor(() => { /* render */ });
|
||||
await waitFor(() => {
|
||||
/* render */
|
||||
});
|
||||
return container;
|
||||
};
|
||||
|
||||
describe("FleetVehiclesTable", () => {
|
||||
beforeAll(() => {
|
||||
addSnapshotSerializer(expect);
|
||||
});
|
||||
|
||||
it("Render", async () => {
|
||||
setToken(TEST_AUTH_OBJECT);
|
||||
const container = await renderFleetVehiclesTable();
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
jest.mock("../../Contexts/FleetContext");
|
||||
jest.mock("../../Contexts/StatusContext");
|
||||
jest.mock("../../Contexts/UserContext");
|
||||
jest.mock('@material-ui/core/utils/unstable_useId', () =>
|
||||
jest.fn().mockReturnValue('mui-test-id'),
|
||||
jest.mock("@material-ui/core/utils/unstable_useId", () =>
|
||||
jest.fn().mockReturnValue("mui-test-id")
|
||||
);
|
||||
|
||||
import { render, waitFor } from "@testing-library/react";
|
||||
@@ -10,7 +10,8 @@ import { BrowserRouter } from "react-router-dom";
|
||||
|
||||
import { setToken } from "../../Contexts/UserContext";
|
||||
import { TEST_AUTH_OBJECT } from "../../../utils/testing";
|
||||
import VehiclesTab from "./VehiclesTab"
|
||||
import VehiclesTab from "./VehiclesTab";
|
||||
import addSnapshotSerializer from "../../../utils/snapshot";
|
||||
|
||||
const renderVehiclesTab = async () => {
|
||||
const { container } = render(
|
||||
@@ -18,11 +19,17 @@ const renderVehiclesTab = async () => {
|
||||
<VehiclesTab name="US-TEST" />
|
||||
</BrowserRouter>
|
||||
);
|
||||
await waitFor(() => { /* render */ });
|
||||
await waitFor(() => {
|
||||
/* render */
|
||||
});
|
||||
return container;
|
||||
};
|
||||
|
||||
describe("VehiclesTab", () => {
|
||||
beforeAll(() => {
|
||||
addSnapshotSerializer(expect);
|
||||
});
|
||||
|
||||
it("Render", async () => {
|
||||
setToken(TEST_AUTH_OBJECT);
|
||||
const container = await renderVehiclesTab();
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
exports[`CANFiltersTab Render 1`] = `
|
||||
<div>
|
||||
<div
|
||||
class="makeStyles-paper-3 makeStyles-tableSize-53"
|
||||
class="makeStyles-paper-0 makeStyles-tableSize-0"
|
||||
>
|
||||
<h6
|
||||
class="MuiTypography-root MuiTypography-h6"
|
||||
@@ -14,16 +14,16 @@ exports[`CANFiltersTab Render 1`] = `
|
||||
data-testid="mocked-fleetprovider"
|
||||
>
|
||||
<div
|
||||
class="makeStyles-paper-3 makeStyles-tableSize-53"
|
||||
class="makeStyles-paper-0 makeStyles-tableSize-0"
|
||||
>
|
||||
<div
|
||||
class="MuiGrid-root makeStyles-root-14 MuiGrid-container MuiGrid-spacing-xs-2"
|
||||
class="MuiGrid-root makeStyles-root-0 MuiGrid-container MuiGrid-spacing-xs-2"
|
||||
>
|
||||
<div
|
||||
class="MuiGrid-root makeStyles-textJustifyAlign-47 MuiGrid-item MuiGrid-grid-md-4"
|
||||
class="MuiGrid-root makeStyles-textJustifyAlign-0 MuiGrid-item MuiGrid-grid-md-4"
|
||||
>
|
||||
<a
|
||||
class="makeStyles-labelInline-9"
|
||||
class="makeStyles-labelInline-0"
|
||||
href="/fleet/undefined/filter-add"
|
||||
>
|
||||
<svg
|
||||
@@ -40,10 +40,10 @@ exports[`CANFiltersTab Render 1`] = `
|
||||
</div>
|
||||
<div
|
||||
align="right"
|
||||
class="MuiGrid-root makeStyles-textCenterAlign-48 MuiGrid-item MuiGrid-grid-md-8"
|
||||
class="MuiGrid-root makeStyles-textCenterAlign-0 MuiGrid-item MuiGrid-grid-md-8"
|
||||
>
|
||||
<div
|
||||
class="MuiFormControl-root makeStyles-margin-28 makeStyles-fullWidth-50"
|
||||
class="MuiFormControl-root makeStyles-margin-0 makeStyles-fullWidth-0"
|
||||
>
|
||||
<label
|
||||
class="MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated"
|
||||
|
||||
@@ -12,7 +12,7 @@ exports[`DetailsTab Render 1`] = `
|
||||
data-testid="mocked-userprovider"
|
||||
>
|
||||
<div
|
||||
class="makeStyles-paper-3 makeStyles-tableSize-53"
|
||||
class="makeStyles-paper-0 makeStyles-tableSize-0"
|
||||
>
|
||||
<h6
|
||||
class="MuiTypography-root MuiTypography-h6"
|
||||
@@ -23,13 +23,13 @@ exports[`DetailsTab Render 1`] = `
|
||||
data-testid="mocked-fleetprovider"
|
||||
>
|
||||
<div
|
||||
class="makeStyles-paper-3 makeStyles-tableSize-53"
|
||||
class="makeStyles-paper-0 makeStyles-tableSize-0"
|
||||
>
|
||||
<div
|
||||
class="MuiGrid-root makeStyles-root-14 MuiGrid-container MuiGrid-spacing-xs-2"
|
||||
class="MuiGrid-root makeStyles-root-0 MuiGrid-container MuiGrid-spacing-xs-2"
|
||||
>
|
||||
<div
|
||||
class="MuiGrid-root makeStyles-textCenterAlign-48 MuiGrid-item MuiGrid-grid-md-12"
|
||||
class="MuiGrid-root makeStyles-textCenterAlign-0 MuiGrid-item MuiGrid-grid-md-12"
|
||||
>
|
||||
<p>
|
||||
<b>
|
||||
@@ -54,7 +54,7 @@ exports[`DetailsTab Render 1`] = `
|
||||
</p>
|
||||
</div>
|
||||
<div
|
||||
class="MuiGrid-root makeStyles-textCenterAlign-48 MuiGrid-item MuiGrid-grid-md-12"
|
||||
class="MuiGrid-root makeStyles-textCenterAlign-0 MuiGrid-item MuiGrid-grid-md-12"
|
||||
>
|
||||
<b>
|
||||
CANBus
|
||||
@@ -96,7 +96,7 @@ exports[`DetailsTab Render 1`] = `
|
||||
</p>
|
||||
</div>
|
||||
<div
|
||||
class="MuiGrid-root makeStyles-textCenterAlign-48 MuiGrid-item MuiGrid-grid-md-12"
|
||||
class="MuiGrid-root makeStyles-textCenterAlign-0 MuiGrid-item MuiGrid-grid-md-12"
|
||||
>
|
||||
<a
|
||||
class=""
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
exports[`VehiclesTab Render 1`] = `
|
||||
<div>
|
||||
<div
|
||||
class="makeStyles-paper-3 makeStyles-tableSize-53"
|
||||
class="makeStyles-paper-0 makeStyles-tableSize-0"
|
||||
>
|
||||
<h6
|
||||
class="MuiTypography-root MuiTypography-h6"
|
||||
@@ -14,16 +14,16 @@ exports[`VehiclesTab Render 1`] = `
|
||||
data-testid="mocked-fleetprovider"
|
||||
>
|
||||
<div
|
||||
class="makeStyles-paper-3 makeStyles-tableSize-53"
|
||||
class="makeStyles-paper-0 makeStyles-tableSize-0"
|
||||
>
|
||||
<div
|
||||
class="MuiGrid-root makeStyles-root-14 MuiGrid-container MuiGrid-spacing-xs-2"
|
||||
class="MuiGrid-root makeStyles-root-0 MuiGrid-container MuiGrid-spacing-xs-2"
|
||||
>
|
||||
<div
|
||||
class="MuiGrid-root makeStyles-textJustifyAlign-47 MuiGrid-item MuiGrid-grid-md-4"
|
||||
class="MuiGrid-root makeStyles-textJustifyAlign-0 MuiGrid-item MuiGrid-grid-md-4"
|
||||
>
|
||||
<a
|
||||
class="makeStyles-labelInline-9"
|
||||
class="makeStyles-labelInline-0"
|
||||
href="/fleet/undefined/vehicle-add"
|
||||
>
|
||||
<svg
|
||||
@@ -40,10 +40,10 @@ exports[`VehiclesTab Render 1`] = `
|
||||
</div>
|
||||
<div
|
||||
align="right"
|
||||
class="MuiGrid-root makeStyles-textCenterAlign-48 MuiGrid-item MuiGrid-grid-md-8"
|
||||
class="MuiGrid-root makeStyles-textCenterAlign-0 MuiGrid-item MuiGrid-grid-md-8"
|
||||
>
|
||||
<div
|
||||
class="MuiFormControl-root makeStyles-margin-28 makeStyles-fullWidth-50"
|
||||
class="MuiFormControl-root makeStyles-margin-0 makeStyles-fullWidth-0"
|
||||
>
|
||||
<label
|
||||
class="MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated"
|
||||
|
||||
@@ -12,10 +12,10 @@ exports[`FleetStatus Render 1`] = `
|
||||
data-testid="mocked-userprovider"
|
||||
>
|
||||
<div
|
||||
class="makeStyles-paper-3 makeStyles-tableSize-53"
|
||||
class="makeStyles-paper-0 makeStyles-tableSize-0"
|
||||
>
|
||||
<div
|
||||
class="MuiBox-root MuiBox-root-62 makeStyles-tableToolbar-30"
|
||||
class="MuiBox-root MuiBox-root-63 makeStyles-tableToolbar-0"
|
||||
>
|
||||
<div
|
||||
class="MuiTabs-root"
|
||||
@@ -85,7 +85,7 @@ exports[`FleetStatus Render 1`] = `
|
||||
</button>
|
||||
</div>
|
||||
<span
|
||||
class="PrivateTabIndicator-root-63 PrivateTabIndicator-colorSecondary-65 MuiTabs-indicator"
|
||||
class="PrivateTabIndicator-root-64 PrivateTabIndicator-colorSecondary-66 MuiTabs-indicator"
|
||||
style="left: 0px; width: 0px;"
|
||||
/>
|
||||
</div>
|
||||
@@ -97,10 +97,10 @@ exports[`FleetStatus Render 1`] = `
|
||||
role="tabpanel"
|
||||
>
|
||||
<div
|
||||
class="MuiBox-root MuiBox-root-67"
|
||||
class="MuiBox-root MuiBox-root-68"
|
||||
>
|
||||
<div
|
||||
class="makeStyles-paper-3 makeStyles-tableSize-53"
|
||||
class="makeStyles-paper-0 makeStyles-tableSize-0"
|
||||
>
|
||||
<h6
|
||||
class="MuiTypography-root MuiTypography-h6"
|
||||
@@ -111,13 +111,13 @@ exports[`FleetStatus Render 1`] = `
|
||||
data-testid="mocked-fleetprovider"
|
||||
>
|
||||
<div
|
||||
class="makeStyles-paper-3 makeStyles-tableSize-53"
|
||||
class="makeStyles-paper-0 makeStyles-tableSize-0"
|
||||
>
|
||||
<div
|
||||
class="MuiGrid-root makeStyles-root-14 MuiGrid-container MuiGrid-spacing-xs-2"
|
||||
class="MuiGrid-root makeStyles-root-0 MuiGrid-container MuiGrid-spacing-xs-2"
|
||||
>
|
||||
<div
|
||||
class="MuiGrid-root makeStyles-textCenterAlign-48 MuiGrid-item MuiGrid-grid-md-12"
|
||||
class="MuiGrid-root makeStyles-textCenterAlign-0 MuiGrid-item MuiGrid-grid-md-12"
|
||||
>
|
||||
<p>
|
||||
<b>
|
||||
@@ -141,7 +141,7 @@ exports[`FleetStatus Render 1`] = `
|
||||
</p>
|
||||
</div>
|
||||
<div
|
||||
class="MuiGrid-root makeStyles-textCenterAlign-48 MuiGrid-item MuiGrid-grid-md-12"
|
||||
class="MuiGrid-root makeStyles-textCenterAlign-0 MuiGrid-item MuiGrid-grid-md-12"
|
||||
>
|
||||
<b>
|
||||
CANBus
|
||||
@@ -183,7 +183,7 @@ exports[`FleetStatus Render 1`] = `
|
||||
</p>
|
||||
</div>
|
||||
<div
|
||||
class="MuiGrid-root makeStyles-textCenterAlign-48 MuiGrid-item MuiGrid-grid-md-12"
|
||||
class="MuiGrid-root makeStyles-textCenterAlign-0 MuiGrid-item MuiGrid-grid-md-12"
|
||||
>
|
||||
<a
|
||||
class=""
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
jest.mock("../../Contexts/FleetContext");
|
||||
jest.mock("../../Contexts/StatusContext");
|
||||
jest.mock("../../Contexts/UserContext");
|
||||
jest.mock('@material-ui/core/utils/unstable_useId', () =>
|
||||
jest.fn().mockReturnValue('mui-test-id'),
|
||||
jest.mock("@material-ui/core/utils/unstable_useId", () =>
|
||||
jest.fn().mockReturnValue("mui-test-id")
|
||||
);
|
||||
|
||||
import { render, waitFor } from "@testing-library/react";
|
||||
@@ -12,7 +12,8 @@ import { FleetProvider } from "../../Contexts/FleetContext";
|
||||
import { StatusProvider } from "../../Contexts/StatusContext";
|
||||
import { UserProvider, setToken } from "../../Contexts/UserContext";
|
||||
import { TEST_AUTH_OBJECT } from "../../../utils/testing";
|
||||
import FleetStatus from "./index"
|
||||
import FleetStatus from "./index";
|
||||
import addSnapshotSerializer from "../../../utils/snapshot";
|
||||
|
||||
const renderCarStatus = async () => {
|
||||
const { container } = render(
|
||||
@@ -26,11 +27,17 @@ const renderCarStatus = async () => {
|
||||
</StatusProvider>
|
||||
</FleetProvider>
|
||||
);
|
||||
await waitFor(() => { /* render */ });
|
||||
await waitFor(() => {
|
||||
/* render */
|
||||
});
|
||||
return container;
|
||||
};
|
||||
|
||||
describe("FleetStatus", () => {
|
||||
beforeAll(() => {
|
||||
addSnapshotSerializer(expect);
|
||||
});
|
||||
|
||||
it("Render", async () => {
|
||||
setToken(TEST_AUTH_OBJECT);
|
||||
const container = await renderCarStatus();
|
||||
|
||||
@@ -15,16 +15,16 @@ exports[`FleetTable Render 1`] = `
|
||||
data-testid="mocked-fleetprovider"
|
||||
>
|
||||
<div
|
||||
class="makeStyles-paper-3 makeStyles-tableSize-53"
|
||||
class="makeStyles-paper-0 makeStyles-tableSize-0"
|
||||
>
|
||||
<div
|
||||
class="MuiGrid-root makeStyles-root-14 MuiGrid-container MuiGrid-spacing-xs-2"
|
||||
class="MuiGrid-root makeStyles-root-0 MuiGrid-container MuiGrid-spacing-xs-2"
|
||||
>
|
||||
<div
|
||||
class="MuiGrid-root makeStyles-textJustifyAlign-47 MuiGrid-item MuiGrid-grid-md-4"
|
||||
class="MuiGrid-root makeStyles-textJustifyAlign-0 MuiGrid-item MuiGrid-grid-md-4"
|
||||
>
|
||||
<a
|
||||
class="makeStyles-labelInline-9"
|
||||
class="makeStyles-labelInline-0"
|
||||
href="/fleet-add"
|
||||
>
|
||||
<svg
|
||||
@@ -41,10 +41,10 @@ exports[`FleetTable Render 1`] = `
|
||||
</div>
|
||||
<div
|
||||
align="right"
|
||||
class="MuiGrid-root makeStyles-textCenterAlign-48 MuiGrid-item MuiGrid-grid-md-4"
|
||||
class="MuiGrid-root makeStyles-textCenterAlign-0 MuiGrid-item MuiGrid-grid-md-4"
|
||||
>
|
||||
<div
|
||||
class="MuiFormControl-root makeStyles-margin-28 makeStyles-fullWidth-50"
|
||||
class="MuiFormControl-root makeStyles-margin-0 makeStyles-fullWidth-0"
|
||||
>
|
||||
<label
|
||||
class="MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated"
|
||||
@@ -95,7 +95,7 @@ exports[`FleetTable Render 1`] = `
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="MuiGrid-root makeStyles-textRightAlign-49 MuiGrid-item MuiGrid-grid-md-4"
|
||||
class="MuiGrid-root makeStyles-textRightAlign-0 MuiGrid-item MuiGrid-grid-md-4"
|
||||
/>
|
||||
</div>
|
||||
<table
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
jest.mock("../../Contexts/FleetContext");
|
||||
jest.mock("../../Contexts/StatusContext");
|
||||
jest.mock("../../Contexts/UserContext");
|
||||
jest.mock('@material-ui/core/utils/unstable_useId', () =>
|
||||
jest.fn().mockReturnValue('mui-test-id'),
|
||||
jest.mock("@material-ui/core/utils/unstable_useId", () =>
|
||||
jest.fn().mockReturnValue("mui-test-id")
|
||||
);
|
||||
|
||||
import { render, waitFor } from "@testing-library/react";
|
||||
@@ -12,7 +12,8 @@ import { FleetProvider } from "../../Contexts/FleetContext";
|
||||
import { StatusProvider } from "../../Contexts/StatusContext";
|
||||
import { UserProvider, setToken } from "../../Contexts/UserContext";
|
||||
import { TEST_AUTH_OBJECT } from "../../../utils/testing";
|
||||
import MainForm from "./index"
|
||||
import MainForm from "./index";
|
||||
import addSnapshotSerializer from "../../../utils/snapshot";
|
||||
|
||||
const renderFleetTable = async () => {
|
||||
const { container } = render(
|
||||
@@ -26,11 +27,17 @@ const renderFleetTable = async () => {
|
||||
</StatusProvider>
|
||||
</FleetProvider>
|
||||
);
|
||||
await waitFor(() => { /* render */ });
|
||||
await waitFor(() => {
|
||||
/* render */
|
||||
});
|
||||
return container;
|
||||
};
|
||||
|
||||
describe("FleetTable", () => {
|
||||
beforeAll(() => {
|
||||
addSnapshotSerializer(expect);
|
||||
});
|
||||
|
||||
it("Render", async () => {
|
||||
setToken(TEST_AUTH_OBJECT);
|
||||
const container = await renderFleetTable();
|
||||
|
||||
@@ -15,11 +15,11 @@ exports[`FleetUpdate Render 1`] = `
|
||||
data-testid="mocked-fleetprovider"
|
||||
>
|
||||
<div
|
||||
class="makeStyles-paper-3"
|
||||
class="makeStyles-paper-0"
|
||||
>
|
||||
<form
|
||||
action="{onSubmit}"
|
||||
class="makeStyles-form-5"
|
||||
class="makeStyles-form-0"
|
||||
novalidate=""
|
||||
>
|
||||
<div
|
||||
@@ -57,10 +57,10 @@ exports[`FleetUpdate Render 1`] = `
|
||||
/>
|
||||
<fieldset
|
||||
aria-hidden="true"
|
||||
class="PrivateNotchedOutline-root-62 MuiOutlinedInput-notchedOutline"
|
||||
class="PrivateNotchedOutline-root-63 MuiOutlinedInput-notchedOutline"
|
||||
>
|
||||
<legend
|
||||
class="PrivateNotchedOutline-legendLabelled-64"
|
||||
class="PrivateNotchedOutline-legendLabelled-65"
|
||||
>
|
||||
<span>
|
||||
Name
|
||||
@@ -87,19 +87,19 @@ exports[`FleetUpdate Render 1`] = `
|
||||
>
|
||||
<span
|
||||
aria-disabled="false"
|
||||
class="MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-66 MuiRadio-root MuiRadio-colorSecondary MuiIconButton-colorSecondary"
|
||||
class="MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-67 MuiRadio-root MuiRadio-colorSecondary MuiIconButton-colorSecondary"
|
||||
>
|
||||
<span
|
||||
class="MuiIconButton-label"
|
||||
>
|
||||
<input
|
||||
class="PrivateSwitchBase-input-69"
|
||||
class="PrivateSwitchBase-input-70"
|
||||
name="log-level-group"
|
||||
type="radio"
|
||||
value="trace"
|
||||
/>
|
||||
<div
|
||||
class="PrivateRadioButtonIcon-root-70"
|
||||
class="PrivateRadioButtonIcon-root-71"
|
||||
>
|
||||
<svg
|
||||
aria-hidden="true"
|
||||
@@ -113,7 +113,7 @@ exports[`FleetUpdate Render 1`] = `
|
||||
</svg>
|
||||
<svg
|
||||
aria-hidden="true"
|
||||
class="MuiSvgIcon-root PrivateRadioButtonIcon-layer-71"
|
||||
class="MuiSvgIcon-root PrivateRadioButtonIcon-layer-72"
|
||||
focusable="false"
|
||||
viewBox="0 0 24 24"
|
||||
>
|
||||
@@ -138,19 +138,19 @@ exports[`FleetUpdate Render 1`] = `
|
||||
>
|
||||
<span
|
||||
aria-disabled="false"
|
||||
class="MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-66 MuiRadio-root MuiRadio-colorSecondary MuiIconButton-colorSecondary"
|
||||
class="MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-67 MuiRadio-root MuiRadio-colorSecondary MuiIconButton-colorSecondary"
|
||||
>
|
||||
<span
|
||||
class="MuiIconButton-label"
|
||||
>
|
||||
<input
|
||||
class="PrivateSwitchBase-input-69"
|
||||
class="PrivateSwitchBase-input-70"
|
||||
name="log-level-group"
|
||||
type="radio"
|
||||
value="debug"
|
||||
/>
|
||||
<div
|
||||
class="PrivateRadioButtonIcon-root-70"
|
||||
class="PrivateRadioButtonIcon-root-71"
|
||||
>
|
||||
<svg
|
||||
aria-hidden="true"
|
||||
@@ -164,7 +164,7 @@ exports[`FleetUpdate Render 1`] = `
|
||||
</svg>
|
||||
<svg
|
||||
aria-hidden="true"
|
||||
class="MuiSvgIcon-root PrivateRadioButtonIcon-layer-71"
|
||||
class="MuiSvgIcon-root PrivateRadioButtonIcon-layer-72"
|
||||
focusable="false"
|
||||
viewBox="0 0 24 24"
|
||||
>
|
||||
@@ -189,20 +189,20 @@ exports[`FleetUpdate Render 1`] = `
|
||||
>
|
||||
<span
|
||||
aria-disabled="false"
|
||||
class="MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-66 MuiRadio-root MuiRadio-colorSecondary PrivateSwitchBase-checked-67 Mui-checked MuiIconButton-colorSecondary"
|
||||
class="MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-67 MuiRadio-root MuiRadio-colorSecondary PrivateSwitchBase-checked-68 Mui-checked MuiIconButton-colorSecondary"
|
||||
>
|
||||
<span
|
||||
class="MuiIconButton-label"
|
||||
>
|
||||
<input
|
||||
checked=""
|
||||
class="PrivateSwitchBase-input-69"
|
||||
class="PrivateSwitchBase-input-70"
|
||||
name="log-level-group"
|
||||
type="radio"
|
||||
value="info"
|
||||
/>
|
||||
<div
|
||||
class="PrivateRadioButtonIcon-root-70 PrivateRadioButtonIcon-checked-72"
|
||||
class="PrivateRadioButtonIcon-root-71 PrivateRadioButtonIcon-checked-73"
|
||||
>
|
||||
<svg
|
||||
aria-hidden="true"
|
||||
@@ -216,7 +216,7 @@ exports[`FleetUpdate Render 1`] = `
|
||||
</svg>
|
||||
<svg
|
||||
aria-hidden="true"
|
||||
class="MuiSvgIcon-root PrivateRadioButtonIcon-layer-71"
|
||||
class="MuiSvgIcon-root PrivateRadioButtonIcon-layer-72"
|
||||
focusable="false"
|
||||
viewBox="0 0 24 24"
|
||||
>
|
||||
@@ -241,19 +241,19 @@ exports[`FleetUpdate Render 1`] = `
|
||||
>
|
||||
<span
|
||||
aria-disabled="false"
|
||||
class="MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-66 MuiRadio-root MuiRadio-colorSecondary MuiIconButton-colorSecondary"
|
||||
class="MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-67 MuiRadio-root MuiRadio-colorSecondary MuiIconButton-colorSecondary"
|
||||
>
|
||||
<span
|
||||
class="MuiIconButton-label"
|
||||
>
|
||||
<input
|
||||
class="PrivateSwitchBase-input-69"
|
||||
class="PrivateSwitchBase-input-70"
|
||||
name="log-level-group"
|
||||
type="radio"
|
||||
value="warn"
|
||||
/>
|
||||
<div
|
||||
class="PrivateRadioButtonIcon-root-70"
|
||||
class="PrivateRadioButtonIcon-root-71"
|
||||
>
|
||||
<svg
|
||||
aria-hidden="true"
|
||||
@@ -267,7 +267,7 @@ exports[`FleetUpdate Render 1`] = `
|
||||
</svg>
|
||||
<svg
|
||||
aria-hidden="true"
|
||||
class="MuiSvgIcon-root PrivateRadioButtonIcon-layer-71"
|
||||
class="MuiSvgIcon-root PrivateRadioButtonIcon-layer-72"
|
||||
focusable="false"
|
||||
viewBox="0 0 24 24"
|
||||
>
|
||||
@@ -292,19 +292,19 @@ exports[`FleetUpdate Render 1`] = `
|
||||
>
|
||||
<span
|
||||
aria-disabled="false"
|
||||
class="MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-66 MuiRadio-root MuiRadio-colorSecondary MuiIconButton-colorSecondary"
|
||||
class="MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-67 MuiRadio-root MuiRadio-colorSecondary MuiIconButton-colorSecondary"
|
||||
>
|
||||
<span
|
||||
class="MuiIconButton-label"
|
||||
>
|
||||
<input
|
||||
class="PrivateSwitchBase-input-69"
|
||||
class="PrivateSwitchBase-input-70"
|
||||
name="log-level-group"
|
||||
type="radio"
|
||||
value="error"
|
||||
/>
|
||||
<div
|
||||
class="PrivateRadioButtonIcon-root-70"
|
||||
class="PrivateRadioButtonIcon-root-71"
|
||||
>
|
||||
<svg
|
||||
aria-hidden="true"
|
||||
@@ -318,7 +318,7 @@ exports[`FleetUpdate Render 1`] = `
|
||||
</svg>
|
||||
<svg
|
||||
aria-hidden="true"
|
||||
class="MuiSvgIcon-root PrivateRadioButtonIcon-layer-71"
|
||||
class="MuiSvgIcon-root PrivateRadioButtonIcon-layer-72"
|
||||
focusable="false"
|
||||
viewBox="0 0 24 24"
|
||||
>
|
||||
@@ -343,19 +343,19 @@ exports[`FleetUpdate Render 1`] = `
|
||||
>
|
||||
<span
|
||||
aria-disabled="false"
|
||||
class="MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-66 MuiRadio-root MuiRadio-colorSecondary MuiIconButton-colorSecondary"
|
||||
class="MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-67 MuiRadio-root MuiRadio-colorSecondary MuiIconButton-colorSecondary"
|
||||
>
|
||||
<span
|
||||
class="MuiIconButton-label"
|
||||
>
|
||||
<input
|
||||
class="PrivateSwitchBase-input-69"
|
||||
class="PrivateSwitchBase-input-70"
|
||||
name="log-level-group"
|
||||
type="radio"
|
||||
value="critical"
|
||||
/>
|
||||
<div
|
||||
class="PrivateRadioButtonIcon-root-70"
|
||||
class="PrivateRadioButtonIcon-root-71"
|
||||
>
|
||||
<svg
|
||||
aria-hidden="true"
|
||||
@@ -369,7 +369,7 @@ exports[`FleetUpdate Render 1`] = `
|
||||
</svg>
|
||||
<svg
|
||||
aria-hidden="true"
|
||||
class="MuiSvgIcon-root PrivateRadioButtonIcon-layer-71"
|
||||
class="MuiSvgIcon-root PrivateRadioButtonIcon-layer-72"
|
||||
focusable="false"
|
||||
viewBox="0 0 24 24"
|
||||
>
|
||||
@@ -404,14 +404,14 @@ exports[`FleetUpdate Render 1`] = `
|
||||
>
|
||||
<span
|
||||
aria-disabled="false"
|
||||
class="MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-66 MuiCheckbox-root MuiCheckbox-colorSecondary PrivateSwitchBase-checked-67 Mui-checked MuiIconButton-colorSecondary"
|
||||
class="MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-67 MuiCheckbox-root MuiCheckbox-colorSecondary PrivateSwitchBase-checked-68 Mui-checked MuiIconButton-colorSecondary"
|
||||
>
|
||||
<span
|
||||
class="MuiIconButton-label"
|
||||
>
|
||||
<input
|
||||
checked=""
|
||||
class="PrivateSwitchBase-input-69"
|
||||
class="PrivateSwitchBase-input-70"
|
||||
data-indeterminate="false"
|
||||
type="checkbox"
|
||||
value=""
|
||||
@@ -470,10 +470,10 @@ exports[`FleetUpdate Render 1`] = `
|
||||
/>
|
||||
<fieldset
|
||||
aria-hidden="true"
|
||||
class="PrivateNotchedOutline-root-62 MuiOutlinedInput-notchedOutline"
|
||||
class="PrivateNotchedOutline-root-63 MuiOutlinedInput-notchedOutline"
|
||||
>
|
||||
<legend
|
||||
class="PrivateNotchedOutline-legendLabelled-64 PrivateNotchedOutline-legendNotched-65"
|
||||
class="PrivateNotchedOutline-legendLabelled-65 PrivateNotchedOutline-legendNotched-66"
|
||||
>
|
||||
<span>
|
||||
Max Memory Buffer Size (0 uses default size)
|
||||
@@ -488,13 +488,13 @@ exports[`FleetUpdate Render 1`] = `
|
||||
>
|
||||
<span
|
||||
aria-disabled="false"
|
||||
class="MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-66 MuiCheckbox-root MuiCheckbox-colorSecondary PrivateSwitchBase-checked-67 Mui-checked MuiIconButton-colorSecondary"
|
||||
class="MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-67 MuiCheckbox-root MuiCheckbox-colorSecondary PrivateSwitchBase-checked-68 Mui-checked MuiIconButton-colorSecondary"
|
||||
>
|
||||
<span
|
||||
class="MuiIconButton-label"
|
||||
>
|
||||
<input
|
||||
class="PrivateSwitchBase-input-69"
|
||||
class="PrivateSwitchBase-input-70"
|
||||
data-indeterminate="false"
|
||||
type="checkbox"
|
||||
value=""
|
||||
@@ -554,10 +554,10 @@ exports[`FleetUpdate Render 1`] = `
|
||||
/>
|
||||
<fieldset
|
||||
aria-hidden="true"
|
||||
class="PrivateNotchedOutline-root-62 MuiOutlinedInput-notchedOutline"
|
||||
class="PrivateNotchedOutline-root-63 MuiOutlinedInput-notchedOutline"
|
||||
>
|
||||
<legend
|
||||
class="PrivateNotchedOutline-legendLabelled-64 PrivateNotchedOutline-legendNotched-65"
|
||||
class="PrivateNotchedOutline-legendLabelled-65 PrivateNotchedOutline-legendNotched-66"
|
||||
>
|
||||
<span>
|
||||
Max Disk Buffer Size (0 uses default size)
|
||||
@@ -568,7 +568,7 @@ exports[`FleetUpdate Render 1`] = `
|
||||
</div>
|
||||
</div>
|
||||
<button
|
||||
class="MuiButtonBase-root MuiButton-root MuiButton-contained makeStyles-submit-6 MuiButton-containedPrimary MuiButton-fullWidth"
|
||||
class="MuiButtonBase-root MuiButton-root MuiButton-contained makeStyles-submit-0 MuiButton-containedPrimary MuiButton-fullWidth"
|
||||
tabindex="0"
|
||||
type="submit"
|
||||
>
|
||||
|
||||
@@ -9,7 +9,8 @@ import { FleetProvider } from "../../Contexts/FleetContext";
|
||||
import { StatusProvider } from "../../Contexts/StatusContext";
|
||||
import { UserProvider, setToken } from "../../Contexts/UserContext";
|
||||
import { TEST_AUTH_OBJECT } from "../../../utils/testing";
|
||||
import MainForm from "./index"
|
||||
import MainForm from "./index";
|
||||
import addSnapshotSerializer from "../../../utils/snapshot";
|
||||
|
||||
const renderFleetUpdate = async () => {
|
||||
const { container } = render(
|
||||
@@ -23,11 +24,17 @@ const renderFleetUpdate = async () => {
|
||||
</StatusProvider>
|
||||
</FleetProvider>
|
||||
);
|
||||
await waitFor(() => { /* render */ });
|
||||
await waitFor(() => {
|
||||
/* render */
|
||||
});
|
||||
return container;
|
||||
};
|
||||
|
||||
describe("FleetUpdate", () => {
|
||||
beforeAll(() => {
|
||||
addSnapshotSerializer(expect);
|
||||
});
|
||||
|
||||
it("Render", async () => {
|
||||
setToken(TEST_AUTH_OBJECT);
|
||||
const container = await renderFleetUpdate();
|
||||
|
||||
@@ -8,7 +8,6 @@ const Home = () => {
|
||||
const classes = useStyles();
|
||||
const { setTitle, setSitePath } = useStatusContext();
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
setTitle("Home");
|
||||
setSitePath([]);
|
||||
|
||||
@@ -12,7 +12,6 @@ import ListItemLink from "../ListItemLink";
|
||||
import ListItemExternalLink from "../ListItemExternalLink";
|
||||
import { useUserContext } from "../Contexts/UserContext";
|
||||
import { Roles, hasRole } from "../../utils/roles";
|
||||
import { SupersetDashboardURL } from "../../services/superset";
|
||||
|
||||
const menuData = [
|
||||
{
|
||||
@@ -41,7 +40,7 @@ const menuData = [
|
||||
},
|
||||
{
|
||||
label: "Datascope",
|
||||
url: SupersetDashboardURL,
|
||||
to: "/datascope",
|
||||
icon: <AssessmentIcon />,
|
||||
roles: [Roles.READ, Roles.CREATE],
|
||||
},
|
||||
@@ -66,10 +65,9 @@ const menuData = [
|
||||
label: "SMS",
|
||||
to: "/tools/sms/send",
|
||||
roles: [],
|
||||
}
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
];
|
||||
|
||||
const MenuItem = ({ item, children }) => {
|
||||
|
||||
@@ -5,6 +5,7 @@ import { BrowserRouter } from "react-router-dom";
|
||||
import { UserProvider, setToken } from "../Contexts/UserContext";
|
||||
import { TEST_AUTH_OBJECT } from "../../utils/testing";
|
||||
import SideMenu from "./SideMenu";
|
||||
import addSnapshotSerializer from "../../utils/snapshot";
|
||||
|
||||
const renderMenu = async () => {
|
||||
const { container } = render(
|
||||
@@ -19,6 +20,10 @@ const renderMenu = async () => {
|
||||
};
|
||||
|
||||
describe("SideMenu", () => {
|
||||
beforeAll(() => {
|
||||
addSnapshotSerializer(expect);
|
||||
});
|
||||
|
||||
it("Unauthenticated", async () => {
|
||||
setToken(null);
|
||||
const container = await renderMenu();
|
||||
|
||||
@@ -155,12 +155,10 @@ exports[`SideMenu Authenticated 1`] = `
|
||||
<li>
|
||||
<a
|
||||
aria-disabled="false"
|
||||
class="MuiTypography-root MuiLink-root MuiLink-underlineHover MuiButtonBase-root MuiListItem-root makeStyles-menuExternalLink-52 MuiListItem-gutters MuiListItem-button MuiTypography-colorPrimary"
|
||||
href="https://dev-superset.cloud.fiskerinc.com/r/3"
|
||||
rel="noopener"
|
||||
class="MuiButtonBase-root MuiListItem-root MuiListItem-gutters MuiListItem-button"
|
||||
href="/datascope"
|
||||
role="button"
|
||||
tabindex="0"
|
||||
target="_blank"
|
||||
>
|
||||
<div
|
||||
class="MuiListItemIcon-root"
|
||||
|
||||
@@ -12,7 +12,7 @@ Object {
|
||||
data-testid="mocked-manifestsprovider"
|
||||
>
|
||||
<div
|
||||
class="makeStyles-link-26"
|
||||
class="makeStyles-link-0"
|
||||
>
|
||||
Show Details
|
||||
</div>
|
||||
@@ -28,7 +28,7 @@ Object {
|
||||
data-testid="mocked-manifestsprovider"
|
||||
>
|
||||
<div
|
||||
class="makeStyles-link-26"
|
||||
class="makeStyles-link-0"
|
||||
>
|
||||
Show Details
|
||||
</div>
|
||||
@@ -101,7 +101,7 @@ Object {
|
||||
data-testid="mocked-manifestsprovider"
|
||||
>
|
||||
<div
|
||||
class="makeStyles-link-87"
|
||||
class="makeStyles-link-0"
|
||||
>
|
||||
Hide Details
|
||||
</div>
|
||||
@@ -156,7 +156,7 @@ Object {
|
||||
data-testid="mocked-manifestsprovider"
|
||||
>
|
||||
<div
|
||||
class="makeStyles-link-87"
|
||||
class="makeStyles-link-0"
|
||||
>
|
||||
Hide Details
|
||||
</div>
|
||||
|
||||
@@ -10,6 +10,7 @@ import { UserProvider, setToken } from "../../Contexts/UserContext";
|
||||
import { StatusProvider } from "../../Contexts/StatusContext";
|
||||
import ManifestDetails from ".";
|
||||
import { TEST_AUTH_OBJECT } from "../../../utils/testing";
|
||||
import addSnapshotSerializer from "../../../utils/snapshot";
|
||||
|
||||
const TestComponent = (opened) => (
|
||||
<UserProvider>
|
||||
@@ -26,6 +27,7 @@ const TestComponent = (opened) => (
|
||||
describe("Manifest Details Component", () => {
|
||||
beforeAll(() => {
|
||||
setToken(TEST_AUTH_OBJECT);
|
||||
addSnapshotSerializer(expect);
|
||||
});
|
||||
|
||||
it("Render Hidden", async () => {
|
||||
|
||||
@@ -37,7 +37,7 @@ const CertificateCreate = React.lazy(() => import("../Certificates/Add"));
|
||||
const SMSSend = React.lazy(() => import("../SMS/Send"));
|
||||
const SuppliersList = React.lazy(() => import("../Suppliers/List"));
|
||||
const SupplierDetails = React.lazy(() => import("../Suppliers/Details"));
|
||||
|
||||
const Datascope = React.lazy(() => import("../Dashboard"));
|
||||
const SiteRoutes = () => {
|
||||
const { token, groups } = useUserContext();
|
||||
return (
|
||||
@@ -233,6 +233,14 @@ const SiteRoutes = () => {
|
||||
groups={groups}
|
||||
roles={[Roles.APPROVESUPPLIERS]}
|
||||
/>
|
||||
<AuthRoute
|
||||
path="/datascope"
|
||||
render={() => <Datascope />}
|
||||
type={TYPES.PROTECTED}
|
||||
token={token}
|
||||
groups={groups}
|
||||
roles={[Roles.READ, Roles.CREATE]}
|
||||
/>
|
||||
<PageNotFound />
|
||||
</Switch>
|
||||
</Suspense>
|
||||
|
||||
@@ -2,11 +2,13 @@ import React from "react";
|
||||
import { render, waitFor } from "@testing-library/react";
|
||||
|
||||
import ViewResult from "./ViewResult";
|
||||
import addSnapshotSerializer from "../../../utils/snapshot";
|
||||
|
||||
describe("ViewResult", () => {
|
||||
beforeAll(() => {
|
||||
global.URL.createObjectURL = jest.fn();
|
||||
global.URL.revokeObjectURL = jest.fn();
|
||||
addSnapshotSerializer(expect);
|
||||
});
|
||||
|
||||
it("Render", async () => {
|
||||
|
||||
@@ -21,7 +21,7 @@ exports[`ViewResult Render 1`] = `
|
||||
</li>
|
||||
</ul>
|
||||
<button
|
||||
class="MuiButtonBase-root MuiButton-root MuiButton-contained makeStyles-submit-6 MuiButton-containedPrimary MuiButton-fullWidth"
|
||||
class="MuiButtonBase-root MuiButton-root MuiButton-contained makeStyles-submit-0 MuiButton-containedPrimary MuiButton-fullWidth"
|
||||
tabindex="0"
|
||||
type="submit"
|
||||
>
|
||||
|
||||
@@ -4,8 +4,13 @@ import React from "react";
|
||||
import { BrowserRouter } from "react-router-dom";
|
||||
import { render, cleanup } from "@testing-library/react";
|
||||
import SSOForm from "./index";
|
||||
import addSnapshotSerializer from "../../utils/snapshot";
|
||||
|
||||
describe("Sign In Form", () => {
|
||||
beforeAll(() => {
|
||||
addSnapshotSerializer(expect);
|
||||
});
|
||||
|
||||
it("Should render", () => {
|
||||
const { container } = render(
|
||||
<BrowserRouter>
|
||||
@@ -13,7 +18,7 @@ describe("Sign In Form", () => {
|
||||
</BrowserRouter>
|
||||
);
|
||||
expect(container).toMatchSnapshot();
|
||||
|
||||
|
||||
cleanup();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -3,11 +3,11 @@
|
||||
exports[`Sign In Form Should render 1`] = `
|
||||
<div>
|
||||
<div
|
||||
class="makeStyles-paper-3 makeStyles-textJustifyAlign-47"
|
||||
class="makeStyles-paper-0 makeStyles-textJustifyAlign-0"
|
||||
>
|
||||
<a
|
||||
aria-disabled="false"
|
||||
class="MuiButtonBase-root MuiButton-root MuiButton-contained makeStyles-submit-6 MuiButton-containedPrimary"
|
||||
class="MuiButtonBase-root MuiButton-root MuiButton-contained makeStyles-submit-0 MuiButton-containedPrimary"
|
||||
href="https://cognito.com/authorize?redirect=https://example.com/callback"
|
||||
tabindex="0"
|
||||
>
|
||||
|
||||
@@ -12,11 +12,11 @@ exports[`Supplier page Render 1`] = `
|
||||
id="mock-browserrouter"
|
||||
>
|
||||
<div
|
||||
class="makeStyles-paper-3"
|
||||
class="makeStyles-paper-0"
|
||||
>
|
||||
<form
|
||||
action="#"
|
||||
class="makeStyles-form-5"
|
||||
class="makeStyles-form-0"
|
||||
novalidate=""
|
||||
>
|
||||
<div
|
||||
@@ -52,10 +52,10 @@ exports[`Supplier page Render 1`] = `
|
||||
/>
|
||||
<fieldset
|
||||
aria-hidden="true"
|
||||
class="PrivateNotchedOutline-root-62 MuiOutlinedInput-notchedOutline"
|
||||
class="PrivateNotchedOutline-root-63 MuiOutlinedInput-notchedOutline"
|
||||
>
|
||||
<legend
|
||||
class="PrivateNotchedOutline-legendLabelled-64 PrivateNotchedOutline-legendNotched-65"
|
||||
class="PrivateNotchedOutline-legendLabelled-65 PrivateNotchedOutline-legendNotched-66"
|
||||
>
|
||||
<span>
|
||||
Contact
|
||||
@@ -98,10 +98,10 @@ exports[`Supplier page Render 1`] = `
|
||||
/>
|
||||
<fieldset
|
||||
aria-hidden="true"
|
||||
class="PrivateNotchedOutline-root-62 MuiOutlinedInput-notchedOutline"
|
||||
class="PrivateNotchedOutline-root-63 MuiOutlinedInput-notchedOutline"
|
||||
>
|
||||
<legend
|
||||
class="PrivateNotchedOutline-legendLabelled-64 PrivateNotchedOutline-legendNotched-65"
|
||||
class="PrivateNotchedOutline-legendLabelled-65 PrivateNotchedOutline-legendNotched-66"
|
||||
>
|
||||
<span>
|
||||
Company
|
||||
@@ -144,10 +144,10 @@ exports[`Supplier page Render 1`] = `
|
||||
/>
|
||||
<fieldset
|
||||
aria-hidden="true"
|
||||
class="PrivateNotchedOutline-root-62 MuiOutlinedInput-notchedOutline"
|
||||
class="PrivateNotchedOutline-root-63 MuiOutlinedInput-notchedOutline"
|
||||
>
|
||||
<legend
|
||||
class="PrivateNotchedOutline-legendLabelled-64 PrivateNotchedOutline-legendNotched-65"
|
||||
class="PrivateNotchedOutline-legendLabelled-65 PrivateNotchedOutline-legendNotched-66"
|
||||
>
|
||||
<span>
|
||||
Address
|
||||
@@ -190,10 +190,10 @@ exports[`Supplier page Render 1`] = `
|
||||
/>
|
||||
<fieldset
|
||||
aria-hidden="true"
|
||||
class="PrivateNotchedOutline-root-62 MuiOutlinedInput-notchedOutline"
|
||||
class="PrivateNotchedOutline-root-63 MuiOutlinedInput-notchedOutline"
|
||||
>
|
||||
<legend
|
||||
class="PrivateNotchedOutline-legendLabelled-64 PrivateNotchedOutline-legendNotched-65"
|
||||
class="PrivateNotchedOutline-legendLabelled-65 PrivateNotchedOutline-legendNotched-66"
|
||||
>
|
||||
<span>
|
||||
Telephone
|
||||
@@ -236,10 +236,10 @@ exports[`Supplier page Render 1`] = `
|
||||
/>
|
||||
<fieldset
|
||||
aria-hidden="true"
|
||||
class="PrivateNotchedOutline-root-62 MuiOutlinedInput-notchedOutline"
|
||||
class="PrivateNotchedOutline-root-63 MuiOutlinedInput-notchedOutline"
|
||||
>
|
||||
<legend
|
||||
class="PrivateNotchedOutline-legendLabelled-64 PrivateNotchedOutline-legendNotched-65"
|
||||
class="PrivateNotchedOutline-legendLabelled-65 PrivateNotchedOutline-legendNotched-66"
|
||||
>
|
||||
<span>
|
||||
Program
|
||||
@@ -282,10 +282,10 @@ exports[`Supplier page Render 1`] = `
|
||||
/>
|
||||
<fieldset
|
||||
aria-hidden="true"
|
||||
class="PrivateNotchedOutline-root-62 MuiOutlinedInput-notchedOutline"
|
||||
class="PrivateNotchedOutline-root-63 MuiOutlinedInput-notchedOutline"
|
||||
>
|
||||
<legend
|
||||
class="PrivateNotchedOutline-legendLabelled-64 PrivateNotchedOutline-legendNotched-65"
|
||||
class="PrivateNotchedOutline-legendLabelled-65 PrivateNotchedOutline-legendNotched-66"
|
||||
>
|
||||
<span>
|
||||
ECUs
|
||||
@@ -296,7 +296,7 @@ exports[`Supplier page Render 1`] = `
|
||||
</div>
|
||||
</div>
|
||||
<button
|
||||
class="MuiButtonBase-root MuiButton-root MuiButton-contained makeStyles-submit-6 MuiButton-containedSecondary MuiButton-fullWidth"
|
||||
class="MuiButtonBase-root MuiButton-root MuiButton-contained makeStyles-submit-0 MuiButton-containedSecondary MuiButton-fullWidth"
|
||||
tabindex="0"
|
||||
type="button"
|
||||
>
|
||||
@@ -310,7 +310,7 @@ exports[`Supplier page Render 1`] = `
|
||||
/>
|
||||
</button>
|
||||
<button
|
||||
class="MuiButtonBase-root MuiButton-root MuiButton-contained makeStyles-submit-6 MuiButton-containedPrimary MuiButton-fullWidth"
|
||||
class="MuiButtonBase-root MuiButton-root MuiButton-contained makeStyles-submit-0 MuiButton-containedPrimary MuiButton-fullWidth"
|
||||
tabindex="0"
|
||||
type="submit"
|
||||
>
|
||||
|
||||
@@ -17,6 +17,7 @@ import { StatusProvider } from "../../Contexts/StatusContext";
|
||||
import { UserProvider, setToken } from "../../Contexts/UserContext";
|
||||
import { TEST_AUTH_OBJECT } from "../../../utils/testing";
|
||||
import MainForm from "./index";
|
||||
import addSnapshotSerializer from "../../../utils/snapshot";
|
||||
|
||||
const renderSupplierDetailsPage = async () => {
|
||||
const { container } = render(
|
||||
@@ -37,6 +38,10 @@ const renderSupplierDetailsPage = async () => {
|
||||
};
|
||||
|
||||
describe("Supplier page", () => {
|
||||
beforeAll(() => {
|
||||
addSnapshotSerializer(expect);
|
||||
});
|
||||
|
||||
it("Render", async () => {
|
||||
setToken(TEST_AUTH_OBJECT);
|
||||
const container = await renderSupplierDetailsPage();
|
||||
|
||||
@@ -9,10 +9,10 @@ exports[`Suppliers page Render 1`] = `
|
||||
data-testid="mocked-userprovider"
|
||||
>
|
||||
<div
|
||||
class="makeStyles-paper-3 makeStyles-tableSize-53"
|
||||
class="makeStyles-paper-0 makeStyles-tableSize-0"
|
||||
>
|
||||
<div
|
||||
class="makeStyles-paper-3 makeStyles-tableSize-53"
|
||||
class="makeStyles-paper-0 makeStyles-tableSize-0"
|
||||
>
|
||||
<table
|
||||
class="MuiTable-root"
|
||||
@@ -151,7 +151,7 @@ exports[`Suppliers page Render 1`] = `
|
||||
>
|
||||
Registered
|
||||
<span
|
||||
class="makeStyles-hiddenSortSpan-27"
|
||||
class="makeStyles-hiddenSortSpan-0"
|
||||
>
|
||||
sorted ascending
|
||||
</span>
|
||||
|
||||
@@ -12,6 +12,7 @@ import { StatusProvider } from "../../Contexts/StatusContext";
|
||||
import { UserProvider, setToken } from "../../Contexts/UserContext";
|
||||
import { TEST_AUTH_OBJECT } from "../../../utils/testing";
|
||||
import MainForm from "./index";
|
||||
import addSnapshotSerializer from "../../../utils/snapshot";
|
||||
|
||||
const renderSuppliersPage = async () => {
|
||||
const { container } = render(
|
||||
@@ -32,6 +33,10 @@ const renderSuppliersPage = async () => {
|
||||
};
|
||||
|
||||
describe("Suppliers page", () => {
|
||||
beforeAll(() => {
|
||||
addSnapshotSerializer(expect);
|
||||
});
|
||||
|
||||
it("Render", async () => {
|
||||
setToken(TEST_AUTH_OBJECT);
|
||||
const container = await renderSuppliersPage();
|
||||
|
||||
@@ -171,6 +171,15 @@ const useStyles = makeStyles((theme) => ({
|
||||
grow: {
|
||||
flexGrow: 1,
|
||||
},
|
||||
iframeResponsive: {
|
||||
position: "absolute",
|
||||
top: 0,
|
||||
left: 0,
|
||||
bottom: 0,
|
||||
right: 0,
|
||||
width: "100%",
|
||||
height: "100%",
|
||||
},
|
||||
embeddedWrapper: {
|
||||
marginTop: 10,
|
||||
position: "relative",
|
||||
|
||||
35
src/utils/snapshot.js
Normal file
35
src/utils/snapshot.js
Normal file
@@ -0,0 +1,35 @@
|
||||
const rxMakeStyles = /makeStyles-(\w+)-(\d+)/gi;
|
||||
const rxMUIStyles = /mui-\d*/g;
|
||||
|
||||
const snapshotSerializers = [
|
||||
{
|
||||
test: (val) => {
|
||||
return val && typeof val === "string" && val.indexOf("mui-") > -1;
|
||||
},
|
||||
print: (val) => {
|
||||
let str = val;
|
||||
str = str.replace(rxMUIStyles, "mui-0");
|
||||
|
||||
return `"${str}"`;
|
||||
},
|
||||
},
|
||||
{
|
||||
test: (val) => {
|
||||
return val && typeof val === "string" && val.search(rxMakeStyles) > -1;
|
||||
},
|
||||
print: (val) => {
|
||||
let str = val;
|
||||
str = str.replace(rxMakeStyles, "makeStyles-$1-0");
|
||||
|
||||
return `"${str}"`;
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
const addSnapshotSerializer = (expect) => {
|
||||
snapshotSerializers.forEach((serializer) => {
|
||||
expect.addSnapshotSerializer(serializer);
|
||||
});
|
||||
};
|
||||
|
||||
export default addSnapshotSerializer;
|
||||
Reference in New Issue
Block a user