import React from "react";

let busy = false;
let vehicles = [];
let totalVehicles = 0;
let error = null;

export const VehicleProvider = ({ children }) => {
  return <div data-testid="mocked-vehicleprovider">{children}</div>;
};

export const useVehicleContext = () => ({
  busy,
  vehicles,
  totalVehicles,
  getVehicles: jest.fn(() => vehicles),
  addVehicle: jest.fn(),
});

export const setBusy = (val) => {
  busy = val;
};

export const setVehicles = (val) => {
  vehicles = val;
};
