Skip to content

Commit

Permalink
Use the right mock
Browse files Browse the repository at this point in the history
  • Loading branch information
dbkr committed Oct 17, 2024
1 parent 4178c11 commit a11d1d3
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions test/unit-tests/components/structures/MatrixChat-test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,9 @@ describe("<MatrixChat />", () => {
getVersion: jest.fn().mockReturnValue("1"),
setDeviceIsolationMode: 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: {
isStored: jest.fn().mockReturnValue(null),
},
Expand Down Expand Up @@ -1010,7 +1010,8 @@ describe("<MatrixChat />", () => {
.mockResolvedValue(new UserVerificationStatus(false, false, false)),
setDeviceIsolationMode: jest.fn(),
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);
});
Expand Down Expand Up @@ -1114,8 +1115,6 @@ describe("<MatrixChat />", () => {

expect(loginClient.getCrypto()!.userHasCrossSigningKeys).toHaveBeenCalled();

await flushPromises();

// set up keys screen is rendered
expect(screen.getByText("Setting up keys")).toBeInTheDocument();
});
Expand Down

0 comments on commit a11d1d3

Please sign in to comment.