From fafdccb480370b0ac2e25bd617e23da3498f7277 Mon Sep 17 00:00:00 2001 From: "Ali(Ako) Hosseini" Date: Thu, 2 Nov 2023 18:53:36 +0800 Subject: [PATCH 1/2] feat: use dws endpoint --- src/features/Endpoint/Endpoint.tsx | 2 +- src/utils/constants.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/features/Endpoint/Endpoint.tsx b/src/features/Endpoint/Endpoint.tsx index 1cd7a03a3..9c999ab80 100644 --- a/src/features/Endpoint/Endpoint.tsx +++ b/src/features/Endpoint/Endpoint.tsx @@ -67,7 +67,7 @@ const EndPoint = () => { }, })} name='server_url' - placeholder='e.g. ws.binaryws.com' + placeholder='e.g. ws.derivws.com' className={styles.textInput} required /> diff --git a/src/utils/constants.ts b/src/utils/constants.ts index 95141c566..7059e498d 100644 --- a/src/utils/constants.ts +++ b/src/utils/constants.ts @@ -2,7 +2,7 @@ export const PRODUCTION_APP_ID = '36544'; export const STAGING_APP_ID = '36545'; export const VERCEL_DEPLOYMENT_APP_ID = '35073'; export const LOCALHOST_APP_ID = '35074'; -export const DEFAULT_WS_SERVER = 'ws.binaryws.com'; +export const DEFAULT_WS_SERVER = 'ws.derivws.com'; export const OAUTH_URL = 'oauth.deriv.com'; export const LOGIN_ACCOUNTS_SESSION_STORAGE_KEY = 'login-accounts'; From 14c1aac7251c84afd1f61e004987877b74add7e0 Mon Sep 17 00:00:00 2001 From: "Ali(Ako) Hosseini" Date: Thu, 2 Nov 2023 19:16:25 +0800 Subject: [PATCH 2/2] test: change the endpoints in the test --- src/features/Endpoint/__tests__/Endpoint.test.tsx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/features/Endpoint/__tests__/Endpoint.test.tsx b/src/features/Endpoint/__tests__/Endpoint.test.tsx index 94bde8313..401eb726d 100644 --- a/src/features/Endpoint/__tests__/Endpoint.test.tsx +++ b/src/features/Endpoint/__tests__/Endpoint.test.tsx @@ -21,7 +21,7 @@ describe('Endpoint', () => { }); it('should have default values in input fields', () => { - const server = screen.getByPlaceholderText('e.g. ws.binaryws.com'); + const server = screen.getByPlaceholderText('e.g. ws.derivws.com'); const app_id = screen.getByPlaceholderText('e.g. 9999'); expect(server).toHaveValue('oauth.deriv.com'); @@ -40,7 +40,7 @@ describe('Endpoint', () => { }); it('validate user inputs, and provides error messages for server field', async () => { - const server = screen.getByPlaceholderText('e.g. ws.binaryws.com'); + const server = screen.getByPlaceholderText('e.g. ws.derivws.com'); await userEvent.clear(server); await userEvent.type(server, 'qa10@deriv.com'); @@ -51,12 +51,12 @@ describe('Endpoint', () => { }); it('should validate submit button functionality', async () => { - const server = screen.getByPlaceholderText('e.g. ws.binaryws.com'); + const server = screen.getByPlaceholderText('e.g. ws.derivws.com'); const app_id = screen.getByPlaceholderText('e.g. 9999'); const form = screen.getByRole('form'); await userEvent.clear(server); - await userEvent.type(server, 'blue.binaryws.com'); + await userEvent.type(server, 'blue.derivws.com'); await userEvent.clear(app_id); await userEvent.type(app_id, '31063'); @@ -65,7 +65,7 @@ describe('Endpoint', () => { fireEvent.submit(form); }); - expect(server).toHaveValue('blue.binaryws.com'); + expect(server).toHaveValue('blue.derivws.com'); expect(app_id).toHaveValue('31063'); }); @@ -89,12 +89,12 @@ describe('Endpoint', () => { }); it('Should have submit button enabled with no errors on the from', async () => { - const server = screen.getByPlaceholderText('e.g. ws.binaryws.com'); + const server = screen.getByPlaceholderText('e.g. ws.derivws.com'); const app_id = screen.getByPlaceholderText('e.g. 9999'); const submit_button = screen.getByRole('button', { name: /submit/i }); await userEvent.clear(server); - await userEvent.type(server, 'blue.binaryws.com'); + await userEvent.type(server, 'blue.derivws.com'); await userEvent.clear(app_id); await userEvent.type(app_id, '31063');