add VehicleConsumer mock (#359)
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -92,6 +92,10 @@ export const VehicleProvider = ({ children }) => {
|
||||
return <div data-testid="mocked-vehicleprovider">{children}</div>;
|
||||
};
|
||||
|
||||
export const VehicleConsumer = ({ children }) => {
|
||||
return children();
|
||||
};
|
||||
|
||||
export const useVehicleContext = () => ({
|
||||
busy,
|
||||
models,
|
||||
|
||||
Reference in New Issue
Block a user