Skip to content

Commit

Permalink
test: update mocks
Browse files Browse the repository at this point in the history
  • Loading branch information
PatrykBuniX committed Apr 25, 2024
1 parent d519cc3 commit dfca08b
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/script/E2EIdentity/E2EIdentityEnrollment.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,20 @@ import {Conversation} from '../entity/Conversation';
import {User} from '../entity/User';

jest.mock('./OIDCService', () => {
const mockedUserData = {
id_token: 'ID_TOKEN',
access_token: 'ACCESS_TOKEN',
refresh_token: 'REFRESH_TOKEN ',
token_type: 'auth',
profile: 'sub',
};
return {
// Mock the OIDCService class
OIDCService: jest.fn().mockImplementation(() => ({
handleSilentAuthentication: jest.fn().mockResolvedValue({
id_token: 'ID_TOKEN',
access_token: 'ACCESS_TOKEN',
refresh_token: 'REFRESH_TOKEN ',
token_type: 'auth',
profile: 'sub',
}),
handleSilentAuthentication: jest.fn().mockResolvedValue(mockedUserData),
clearProgress: jest.fn(),
handleAuthentication: jest.fn().mockResolvedValue({}),
getUser: jest.fn().mockResolvedValue(mockedUserData),
// ... other methods of OIDCService
})),
getOIDCServiceInstance: jest.fn(), // if needed
Expand Down

0 comments on commit dfca08b

Please sign in to comment.