CEC-2291 Remote Commands (#194)
This commit is contained in:
40
src/components/Cars/Status/RemoteCommandsTab.test.jsx
Normal file
40
src/components/Cars/Status/RemoteCommandsTab.test.jsx
Normal file
@@ -0,0 +1,40 @@
|
||||
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")
|
||||
);
|
||||
|
||||
import {render, waitFor} from "@testing-library/react";
|
||||
import {StatusProvider} from "../../Contexts/StatusContext";
|
||||
import {setToken, UserProvider} from "../../Contexts/UserContext";
|
||||
import RemoteCommandsTab from "./RemoteCommandsTab";
|
||||
import addSnapshotSerializer from "../../../utils/snapshot";
|
||||
import {TEST_AUTH_OBJECT} from "../../../utils/testing";
|
||||
import React from "react";
|
||||
|
||||
const renderRemoteCommandsTab = async () => {
|
||||
const { container } = render(
|
||||
<StatusProvider>
|
||||
<UserProvider>
|
||||
<RemoteCommandsTab vin="TESTVIN1234567890" />
|
||||
</UserProvider>
|
||||
</StatusProvider>
|
||||
);
|
||||
await waitFor(() => {
|
||||
/* render */
|
||||
});
|
||||
return container;
|
||||
};
|
||||
|
||||
describe("RemoteCommandsTab", () => {
|
||||
beforeAll(() => {
|
||||
addSnapshotSerializer(expect);
|
||||
});
|
||||
|
||||
it("Render", async () => {
|
||||
setToken(TEST_AUTH_OBJECT);
|
||||
const container = await renderRemoteCommandsTab();
|
||||
expect(container).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user