This repository was archived by the owner on May 13, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +13
-8
lines changed
hooks/useLoginUrl/__tests__ Expand file tree Collapse file tree 3 files changed +13
-8
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ import * as utils from '@site/src/utils';
55
66jest
77 . spyOn ( utils , 'getServerConfig' )
8- . mockReturnValue ( { appId : '1234' , serverUrl : 'test.binary.sx' , oauth : 'test.deriv.com ' } ) ;
8+ . mockReturnValue ( { appId : '1234' , serverUrl : 'test.binary.sx' , oauth : 'test.oauth.sx ' } ) ;
99
1010describe ( '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.oauth.sx /oauth2/authorize?app_id=1234&l=en' ) ;
2727 expect ( loginUrl ) . toMatch ( / a p p _ i d = 1 2 3 4 / ) ;
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.oauth.sx /oauth2/authorize?app_id=1234&l=es' ) ;
4141 expect ( loginUrl ) . toMatch ( / a p p _ i d = 1 2 3 4 / ) ;
4242 } ) ;
4343} ) ;
Original file line number Diff line number Diff line change 11import * as utils from '@site/src/utils' ;
2- import { DEFAULT_WS_SERVER , LOCALHOST_APP_ID , VERCEL_DEPLOYMENT_APP_ID } from '../constants' ;
2+ import {
3+ LOCALHOST_APP_ID ,
4+ VERCEL_DEPLOYMENT_APP_ID ,
5+ OAUTH_URL ,
6+ DEFAULT_WS_SERVER ,
7+ } from '../constants' ;
38const {
49 getAccountsFromSearchParams,
510 getAppId,
@@ -174,7 +179,7 @@ describe('Get Server Config', () => {
174179
175180 const serverConfig = getServerConfig ( ) ;
176181 expect ( serverConfig . appId ) . toBe ( '1234' ) ;
177- expect ( serverConfig . serverUrl ) . toBe ( 'test.binary.sx ' ) ;
182+ expect ( serverConfig . serverUrl ) . toBe ( 'ws.binaryws.com ' ) ;
178183 expect ( localStorage . getItem ) . toHaveBeenCalledTimes ( 2 ) ;
179184 } ) ;
180185 } ) ;
Original file line number Diff line number Diff line change @@ -2,12 +2,12 @@ import moment from 'moment';
22import { IUserLoginAccount } from '../contexts/auth/auth.context' ;
33import { TScopes } from '../types' ;
44import {
5- DEFAULT_WS_SERVER ,
65 LOCALHOST_APP_ID ,
76 PRODUCTION_APP_ID ,
87 STAGING_APP_ID ,
98 VERCEL_DEPLOYMENT_APP_ID ,
109 OAUTH_URL ,
10+ DEFAULT_WS_SERVER ,
1111} from './constants' ;
1212
1313const CURRENCY_MAP = new Map ( [
@@ -129,9 +129,9 @@ export const getServerConfig = () => {
129129 const config_app_id = localStorage . getItem ( 'config.app_id' ) ;
130130 if ( config_app_id && config_server_url ) {
131131 return {
132- serverUrl : config_server_url ,
132+ serverUrl : DEFAULT_WS_SERVER ,
133133 appId : config_app_id ,
134- oauth : OAUTH_URL ,
134+ oauth : config_server_url ,
135135 } ;
136136 } else {
137137 const isLocalHost = isHost ( 'localhost' ) ;
You can’t perform that action at this time.
0 commit comments