1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-08-09 08:42:50 +03:00

Add ESLint Jest (#10261)

This commit is contained in:
Michael Weimann
2023-03-01 16:23:35 +01:00
committed by GitHub
parent db7748b743
commit 5398db21ad
55 changed files with 336 additions and 351 deletions

View File

@@ -47,7 +47,7 @@ describe("<DeviceDetailHeading />", () => {
expect({ container }).toMatchSnapshot();
});
it("renders device id as fallback when device has no display name ", () => {
it("renders device id as fallback when device has no display name", () => {
const { getByText } = render(
getComponent({
device: { ...device, display_name: undefined },

View File

@@ -207,17 +207,6 @@ describe("<SessionManagerTab />", () => {
expect(container.getElementsByClassName("mx_Spinner").length).toBeTruthy();
});
it("removes spinner when device fetch fails", async () => {
mockClient.getDevices.mockRejectedValue({ httpStatus: 404 });
const { container } = render(getComponent());
expect(mockClient.getDevices).toHaveBeenCalled();
await act(async () => {
await flushPromises();
});
expect(container.getElementsByClassName("mx_Spinner").length).toBeFalsy();
});
it("removes spinner when device fetch fails", async () => {
// eat the expected error log
jest.spyOn(logger, "error").mockImplementation(() => {});
@@ -760,7 +749,7 @@ describe("<SessionManagerTab />", () => {
expect(mockClient.getDevices).toHaveBeenCalled();
});
it("deletes a device when interactive auth is not required", async () => {
it("does not delete a device when interactive auth is not required", async () => {
const { getByTestId } = render(getComponent());
await act(async () => {