Fix library dnd (#2314)

This commit is contained in:
David Luzar 2020-10-30 21:01:41 +01:00 committed by GitHub
parent 8a50916ef2
commit ba3f548b91
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 261 additions and 168 deletions

View file

@ -29,6 +29,17 @@ jest.mock("../data/firebase.ts", () => {
};
});
jest.mock("socket.io-client", () => {
return () => {
return {
close: () => {},
on: () => {},
off: () => {},
emit: () => {},
};
};
});
describe("collaboration", () => {
it("creating room should reset deleted elements", async () => {
render(
@ -50,7 +61,7 @@ describe("collaboration", () => {
expect(API.getStateHistory().length).toBe(1);
});
h.app.openPortal();
await h.app.openPortal();
await waitFor(() => {
expect(h.elements).toEqual([expect.objectContaining({ id: "A" })]);
expect(API.getStateHistory().length).toBe(1);