Diplay ECU name in update status (#110)
Optimize car update status progress control Remove car update status page test Replace with individual component tests
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
jest.mock("../../Contexts/CarUpdatesContext");
|
||||
|
||||
import React from "react";
|
||||
import { render, waitFor } from "@testing-library/react";
|
||||
|
||||
import { CarUpdatesProvider } from "../../Contexts/CarUpdatesContext";
|
||||
import CarUpdateStatusTable from "../CarUpdateStatusTable";
|
||||
import { StatusProvider } from "../../Contexts/StatusContext";
|
||||
import { TEST_AUTH_OBJECT } from "../../../utils/testing";
|
||||
|
||||
const renderCarUpdateStatusTable = async () => {
|
||||
const { container } = render(
|
||||
<StatusProvider>
|
||||
<CarUpdatesProvider>
|
||||
<CarUpdateStatusTable carupdateid={283} token={TEST_AUTH_OBJECT} />
|
||||
</CarUpdatesProvider>
|
||||
</StatusProvider>
|
||||
);
|
||||
await waitFor(() => {});
|
||||
return container;
|
||||
};
|
||||
|
||||
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}"`;
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
it("Render", async () => {
|
||||
const container = await renderCarUpdateStatusTable();
|
||||
expect(container).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user