You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-07-30 02:21:17 +03:00
Add ESLint Jest (#10261)
This commit is contained in:
@ -120,16 +120,14 @@ describe("local-room", () => {
|
||||
mocked(isRoomReady).mockReturnValue(false);
|
||||
});
|
||||
|
||||
it("should invoke the callbacks, set the room state to created and return the actual room id", (done) => {
|
||||
it("should invoke the callbacks, set the room state to created and return the actual room id", async () => {
|
||||
const prom = localRoomModule.waitForRoomReadyAndApplyAfterCreateCallbacks(client, localRoom);
|
||||
jest.advanceTimersByTime(5000);
|
||||
prom.then((roomId: string) => {
|
||||
expect(localRoom.state).toBe(LocalRoomState.CREATED);
|
||||
expect(localRoomCallbackRoomId).toBe(room1.roomId);
|
||||
expect(roomId).toBe(room1.roomId);
|
||||
expect(jest.getTimerCount()).toBe(0);
|
||||
done();
|
||||
});
|
||||
const roomId = await prom;
|
||||
expect(localRoom.state).toBe(LocalRoomState.CREATED);
|
||||
expect(localRoomCallbackRoomId).toBe(room1.roomId);
|
||||
expect(roomId).toBe(room1.roomId);
|
||||
expect(jest.getTimerCount()).toBe(0);
|
||||
});
|
||||
});
|
||||
|
||||
@ -138,17 +136,15 @@ describe("local-room", () => {
|
||||
mocked(isRoomReady).mockReturnValue(false);
|
||||
});
|
||||
|
||||
it("should invoke the callbacks, set the room state to created and return the actual room id", (done) => {
|
||||
it("should invoke the callbacks, set the room state to created and return the actual room id", async () => {
|
||||
const prom = localRoomModule.waitForRoomReadyAndApplyAfterCreateCallbacks(client, localRoom);
|
||||
mocked(isRoomReady).mockReturnValue(true);
|
||||
jest.advanceTimersByTime(500);
|
||||
prom.then((roomId: string) => {
|
||||
expect(localRoom.state).toBe(LocalRoomState.CREATED);
|
||||
expect(localRoomCallbackRoomId).toBe(room1.roomId);
|
||||
expect(roomId).toBe(room1.roomId);
|
||||
expect(jest.getTimerCount()).toBe(0);
|
||||
done();
|
||||
});
|
||||
const roomId = await prom;
|
||||
expect(localRoom.state).toBe(LocalRoomState.CREATED);
|
||||
expect(localRoomCallbackRoomId).toBe(room1.roomId);
|
||||
expect(roomId).toBe(room1.roomId);
|
||||
expect(jest.getTimerCount()).toBe(0);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user