Skip to content
This repository was archived by the owner on May 13, 2024. It is now read-only.

Commit defdfd4

Browse files
Hubert KosterHubert Koster
authored andcommitted
chore: fixing tests
1 parent 6a43da6 commit defdfd4

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/hooks/useLoginUrl/__tests__/useLoginUrl.test.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import * as utils from '@site/src/utils';
55

66
jest
77
.spyOn(utils, 'getServerConfig')
8-
.mockReturnValue({ appId: '1234', serverUrl: 'test.binary.sx', oauth: 'test.deriv.com' });
8+
.mockReturnValue({ appId: '1234', serverUrl: 'test.binary.sx' });
99

1010
describe('Use Login URL', () => {
1111
afterEach(() => {
@@ -23,7 +23,7 @@ describe('Use Login URL', () => {
2323

2424
expect(loginUrl).toContain('l=en');
2525
expect(utils.getServerConfig).toHaveBeenCalled();
26-
expect(loginUrl).toMatch('https://test.deriv.com/oauth2/authorize?app_id=1234&l=en');
26+
expect(loginUrl).toMatch('https://test.binary.sx/oauth2/authorize?app_id=1234&l=en');
2727
expect(loginUrl).toMatch(/app_id=1234/);
2828
});
2929

@@ -37,7 +37,7 @@ describe('Use Login URL', () => {
3737

3838
expect(loginUrl).toContain('l=es');
3939
expect(utils.getServerConfig).toHaveBeenCalled();
40-
expect(loginUrl).toMatch('https://test.deriv.com/oauth2/authorize?app_id=1234&l=es');
40+
expect(loginUrl).toMatch('https://test.binary.sx/oauth2/authorize?app_id=1234&l=es');
4141
expect(loginUrl).toMatch(/app_id=1234/);
4242
});
4343
});

src/utils/__tests__/utils.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as utils from '@site/src/utils';
2-
import { DEFAULT_WS_SERVER, LOCALHOST_APP_ID, VERCEL_DEPLOYMENT_APP_ID } from '../constants';
2+
import { LOCALHOST_APP_ID, VERCEL_DEPLOYMENT_APP_ID, OAUTH_URL } from '../constants';
33
const {
44
getAccountsFromSearchParams,
55
getAppId,
@@ -157,7 +157,7 @@ describe('Get Server Config', () => {
157157
jest.spyOn(utils, 'getIsBrowser').mockReturnValueOnce(false);
158158
const serverConfig = getServerConfig();
159159
expect(serverConfig.appId).toEqual(VERCEL_DEPLOYMENT_APP_ID);
160-
expect(serverConfig.serverUrl).toEqual(DEFAULT_WS_SERVER);
160+
expect(serverConfig.serverUrl).toEqual(OAUTH_URL);
161161
});
162162
});
163163
describe('Given we are in Browser', () => {
@@ -166,7 +166,7 @@ describe('Get Server Config', () => {
166166
it('Should return default ws server url and vercel deployment appId in LOCALHOST ', () => {
167167
const serverConfig = getServerConfig();
168168
expect(serverConfig.appId).toEqual(LOCALHOST_APP_ID);
169-
expect(serverConfig.serverUrl).toEqual(DEFAULT_WS_SERVER);
169+
expect(serverConfig.serverUrl).toEqual(OAUTH_URL);
170170
});
171171
it('Should return serverUrl and appId from localstorage in production', () => {
172172
jest.spyOn(localStorage, 'getItem').mockReturnValueOnce('test.binary.sx');

0 commit comments

Comments
 (0)