diff --git a/src/components/App/__snapshots__/App.test.js.snap b/src/components/App/__snapshots__/App.test.js.snap index 08771e4..7cc160d 100644 --- a/src/components/App/__snapshots__/App.test.js.snap +++ b/src/components/App/__snapshots__/App.test.js.snap @@ -12198,7 +12198,7 @@ exports[`App Route /vehicles authenticated 1`] = ` class="MuiGrid-root makeStyles-root-0 MuiGrid-container MuiGrid-spacing-xs-2" >
+
+ + +
+ +
); }; diff --git a/src/components/Contexts/VehicleContext.jsx b/src/components/Contexts/VehicleContext.jsx index 6967a34..6a45be8 100644 --- a/src/components/Contexts/VehicleContext.jsx +++ b/src/components/Contexts/VehicleContext.jsx @@ -4,7 +4,8 @@ import { logger } from "../../services/monitoring"; import api from "../../services/vehiclesAPI"; import { validateVIN } from "../../utils/validationSupplier"; -export const VehicleContext = React.createContext(); +const VehicleContext = React.createContext(); +export const VehicleConsumer = VehicleContext.Consumer; const validateAdd = (vehicle) => { if (vehicle == null) { diff --git a/src/components/Contexts/__mocks__/VehicleContext.jsx b/src/components/Contexts/__mocks__/VehicleContext.jsx index 1fca329..cfa6f0d 100644 --- a/src/components/Contexts/__mocks__/VehicleContext.jsx +++ b/src/components/Contexts/__mocks__/VehicleContext.jsx @@ -92,6 +92,10 @@ export const VehicleProvider = ({ children }) => { return
{children}
; }; +export const VehicleConsumer = ({ children }) => { + return children(); +}; + export const useVehicleContext = () => ({ busy, models, diff --git a/src/components/Controls/DropDownButton/__snapshots__/index.test.jsx.snap b/src/components/Controls/DropDownButton/__snapshots__/index.test.jsx.snap index a4d6165..80616fa 100644 --- a/src/components/Controls/DropDownButton/__snapshots__/index.test.jsx.snap +++ b/src/components/Controls/DropDownButton/__snapshots__/index.test.jsx.snap @@ -1,101 +1,42 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`DownloadFileLink Render 1`] = ` -
-
- - -
-
-`; - exports[`DropDownButton Render 1`] = `
diff --git a/src/components/Controls/DropDownButton/index.test.jsx b/src/components/Controls/DropDownButton/index.test.jsx index 570c51f..32de737 100644 --- a/src/components/Controls/DropDownButton/index.test.jsx +++ b/src/components/Controls/DropDownButton/index.test.jsx @@ -53,7 +53,7 @@ describe("DropDownButton", () => { await waitFor(() => { /* render */ }); - const buttonEl = getByText("Disabled Action").parentElement; + const buttonEl = getByText("Disabled Action"); expect(buttonEl).toHaveProperty("disabled", true); });