Skip to content

Commit

Permalink
Fix login tests
Browse files Browse the repository at this point in the history
Fixes "TypeError: Cannot read properties of undefined (reading 'toString')" when running the login test suite. Tests passed when ran individually without the fix.
  • Loading branch information
shepherd-l committed Feb 20, 2024
1 parent e8412f6 commit cd3180e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion __test__/support/helpers/login.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@ import {
DUMMY_GET_USER_REQUEST_WITH_PUSH_SUB,
} from '../constants';
import { RequestService } from '../../../src/core/requestService/RequestService';
import { WindowEnvironmentKind } from '../../../src/shared/models/WindowEnvironmentKind';

export function setupLoginStubs() {
test.stub(
RequestService,
'getUser',
Promise.resolve(DUMMY_GET_USER_REQUEST_WITH_PUSH_SUB),
);
test.stub(SdkEnvironment, 'getWindowEnv');
test.stub(SdkEnvironment, 'getWindowEnv', WindowEnvironmentKind.Host);
test.stub(
MainHelper,
'getCurrentPushToken',
Expand Down

0 comments on commit cd3180e

Please sign in to comment.