1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-07-31 13:44:28 +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

@ -1179,34 +1179,34 @@ describe("SpaceStore", () => {
const fn = jest.fn();
store.traverseSpace("!b:server", fn);
expect(fn).toBeCalledTimes(3);
expect(fn).toBeCalledWith("!a:server");
expect(fn).toBeCalledWith("!b:server");
expect(fn).toBeCalledWith("!c:server");
expect(fn).toHaveBeenCalledTimes(3);
expect(fn).toHaveBeenCalledWith("!a:server");
expect(fn).toHaveBeenCalledWith("!b:server");
expect(fn).toHaveBeenCalledWith("!c:server");
});
it("including rooms", () => {
const fn = jest.fn();
store.traverseSpace("!b:server", fn, true);
expect(fn).toBeCalledTimes(8); // twice for shared-child
expect(fn).toBeCalledWith("!a:server");
expect(fn).toBeCalledWith("!a-child:server");
expect(fn).toBeCalledWith("!b:server");
expect(fn).toBeCalledWith("!b-child:server");
expect(fn).toBeCalledWith("!c:server");
expect(fn).toBeCalledWith("!c-child:server");
expect(fn).toBeCalledWith("!shared-child:server");
expect(fn).toHaveBeenCalledTimes(8); // twice for shared-child
expect(fn).toHaveBeenCalledWith("!a:server");
expect(fn).toHaveBeenCalledWith("!a-child:server");
expect(fn).toHaveBeenCalledWith("!b:server");
expect(fn).toHaveBeenCalledWith("!b-child:server");
expect(fn).toHaveBeenCalledWith("!c:server");
expect(fn).toHaveBeenCalledWith("!c-child:server");
expect(fn).toHaveBeenCalledWith("!shared-child:server");
});
it("excluding rooms", () => {
const fn = jest.fn();
store.traverseSpace("!b:server", fn, false);
expect(fn).toBeCalledTimes(3);
expect(fn).toBeCalledWith("!a:server");
expect(fn).toBeCalledWith("!b:server");
expect(fn).toBeCalledWith("!c:server");
expect(fn).toHaveBeenCalledTimes(3);
expect(fn).toHaveBeenCalledWith("!a:server");
expect(fn).toHaveBeenCalledWith("!b:server");
expect(fn).toHaveBeenCalledWith("!c:server");
});
});