mirror of
https://github.com/Novaloop-AG/healthchat-web.git
synced 2026-11-05 22:25:36 +00:00
Use the right mock
This commit is contained in:
@@ -135,9 +135,9 @@ describe("<MatrixChat />", () => {
|
|||||||
getVersion: jest.fn().mockReturnValue("1"),
|
getVersion: jest.fn().mockReturnValue("1"),
|
||||||
setDeviceIsolationMode: jest.fn(),
|
setDeviceIsolationMode: jest.fn(),
|
||||||
userHasCrossSigningKeys: jest.fn(),
|
userHasCrossSigningKeys: jest.fn(),
|
||||||
|
// This needs to not finish immediately because we need to test the screen appears
|
||||||
|
bootstrapCrossSigning: jest.fn().mockImplementation(() => bootstrapDeferred.promise),
|
||||||
}),
|
}),
|
||||||
// This needs to not finish immediately because we need to test the screen appears
|
|
||||||
bootstrapCrossSigning: jest.fn().mockImplementation(() => bootstrapDeferred.promise),
|
|
||||||
secretStorage: {
|
secretStorage: {
|
||||||
isStored: jest.fn().mockReturnValue(null),
|
isStored: jest.fn().mockReturnValue(null),
|
||||||
},
|
},
|
||||||
@@ -1010,7 +1010,8 @@ describe("<MatrixChat />", () => {
|
|||||||
.mockResolvedValue(new UserVerificationStatus(false, false, false)),
|
.mockResolvedValue(new UserVerificationStatus(false, false, false)),
|
||||||
setDeviceIsolationMode: jest.fn(),
|
setDeviceIsolationMode: jest.fn(),
|
||||||
userHasCrossSigningKeys: jest.fn().mockResolvedValue(false),
|
userHasCrossSigningKeys: jest.fn().mockResolvedValue(false),
|
||||||
bootstrapCrossSigning: jest.fn(),
|
// This needs to not finish immediately because we need to test the screen appears
|
||||||
|
bootstrapCrossSigning: jest.fn().mockImplementation(() => bootstrapDeferred.promise),
|
||||||
};
|
};
|
||||||
loginClient.getCrypto.mockReturnValue(mockCrypto as any);
|
loginClient.getCrypto.mockReturnValue(mockCrypto as any);
|
||||||
});
|
});
|
||||||
@@ -1114,8 +1115,6 @@ describe("<MatrixChat />", () => {
|
|||||||
|
|
||||||
expect(loginClient.getCrypto()!.userHasCrossSigningKeys).toHaveBeenCalled();
|
expect(loginClient.getCrypto()!.userHasCrossSigningKeys).toHaveBeenCalled();
|
||||||
|
|
||||||
await flushPromises();
|
|
||||||
|
|
||||||
// set up keys screen is rendered
|
// set up keys screen is rendered
|
||||||
expect(screen.getByText("Setting up keys")).toBeInTheDocument();
|
expect(screen.getByText("Setting up keys")).toBeInTheDocument();
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user