From 74dd2fb1b095955c249d6db01a56fdf94ceb1d09 Mon Sep 17 00:00:00 2001 From: Akmal Djumakhodjaev Date: Tue, 27 Sep 2022 14:47:33 +0800 Subject: [PATCH] Fix test cases --- .../__tests__/sent-email-modal.spec.js | 6 +++--- .../cfd-change-password-confirmation.spec.js | 4 +++- .../__tests__/cfd-password-manager-modal.spec.js | 12 ++++++------ .../Containers/__tests__/cfd-password-modal.spec.js | 2 +- .../__tests__/trading-password-manager.spec.js | 4 +++- 5 files changed, 16 insertions(+), 12 deletions(-) diff --git a/packages/account/src/Components/sent-email-modal/__tests__/sent-email-modal.spec.js b/packages/account/src/Components/sent-email-modal/__tests__/sent-email-modal.spec.js index 3213317deb57..1b50564a8960 100644 --- a/packages/account/src/Components/sent-email-modal/__tests__/sent-email-modal.spec.js +++ b/packages/account/src/Components/sent-email-modal/__tests__/sent-email-modal.spec.js @@ -27,11 +27,11 @@ describe('', () => { jest.clearAllMocks(); }); - it('should render SentEmailModal component to change dmt5 password', () => { + it('should render SentEmailModal component to change deriv mt5 password', () => { render(); expect( - screen.getByText(/please click on the link in the email to change your dmt5 password./i) + screen.getByText(/please click on the link in the email to change your deriv mt5 password./i) ).toBeInTheDocument(); }); @@ -105,7 +105,7 @@ describe('', () => { ); expect( - screen.queryByText(/please click on the link in the email to change your dmt5 password./i) + screen.queryByText(/please click on the link in the email to change your deriv mt5 password./i) ).not.toBeInTheDocument(); }); diff --git a/packages/cfd/src/Containers/__tests__/cfd-change-password-confirmation.spec.js b/packages/cfd/src/Containers/__tests__/cfd-change-password-confirmation.spec.js index 1232531d0a6e..79a7c4ce5d8d 100644 --- a/packages/cfd/src/Containers/__tests__/cfd-change-password-confirmation.spec.js +++ b/packages/cfd/src/Containers/__tests__/cfd-change-password-confirmation.spec.js @@ -59,6 +59,8 @@ describe('ChangePasswordConfirmation', () => { render(); expect(screen.getByText(/Confirm to change your Deriv MT5 password/i)).toBeInTheDocument(); - expect(screen.getByText(/This will change the password to all of your DMT5 accounts/i)).toBeInTheDocument(); + expect( + screen.getByText(/This will change the password to all of your Deriv MT5 accounts/i) + ).toBeInTheDocument(); }); }); diff --git a/packages/cfd/src/Containers/__tests__/cfd-password-manager-modal.spec.js b/packages/cfd/src/Containers/__tests__/cfd-password-manager-modal.spec.js index cacc10cc0b2f..91a69ff3b1a0 100644 --- a/packages/cfd/src/Containers/__tests__/cfd-password-manager-modal.spec.js +++ b/packages/cfd/src/Containers/__tests__/cfd-password-manager-modal.spec.js @@ -110,12 +110,12 @@ describe('', () => { expect( screen.getByText(/use this password to log in to your dmt5 accounts on the desktop, web, and mobile apps/i) ).toBeInTheDocument(); - expect(screen.getByRole('button', { name: /change dmt5 password/i })).toBeInTheDocument(); + expect(screen.getByRole('button', { name: /change deriv mt5 password/i })).toBeInTheDocument(); }); - it('should render CFDPasswordManagerModal if change dmt5 password button is clicked', () => { + it('should render CFDPasswordManagerModal if change deriv mt5 password button is clicked', () => { renderwithRouter(); - fireEvent.click(screen.getByRole('button', { name: /change dmt5 password/i })); + fireEvent.click(screen.getByRole('button', { name: /change deriv mt5 password/i })); expect(screen.getByText(/confirm to change your dmt5 password/i)).toBeInTheDocument(); expect(screen.getByText(/this will change the password to all of your dmt5 accounts/i)).toBeInTheDocument(); expect(screen.getByRole('button', { name: /cancel/i })).toBeInTheDocument(); @@ -124,11 +124,11 @@ describe('', () => { it('should render SentEmailModal if confirm button is clicked', async () => { renderwithRouter(); - fireEvent.click(screen.getByRole('button', { name: /change dmt5 password/i })); + fireEvent.click(screen.getByRole('button', { name: /change deriv mt5 password/i })); fireEvent.click(screen.getByRole('button', { name: /confirm/i })); expect(await screen.findByText(/we've sent you an email/i)).toBeInTheDocument(); expect( - await screen.findByText(/please click on the link in the email to change your dmt5 password./i) + await screen.findByText(/please click on the link in the email to change your deriv mt5 password./i) ).toBeInTheDocument(); expect(await screen.findByText(/didn't receive the email?/i)).toBeInTheDocument(); @@ -314,6 +314,6 @@ describe('', () => { expect(screen.getByText(/investor password/i)).toBeInTheDocument(); fireEvent.click(screen.getByText(/investor password/i)); - expect(await screen.findByText(/manage dmt5 real derived account password/i)).toBeInTheDocument(); + expect(await screen.findByText(/manage deriv mt5 real derived account password/i)).toBeInTheDocument(); }); }); diff --git a/packages/cfd/src/Containers/__tests__/cfd-password-modal.spec.js b/packages/cfd/src/Containers/__tests__/cfd-password-modal.spec.js index 3f5cb092cbd2..9e91e66aee85 100644 --- a/packages/cfd/src/Containers/__tests__/cfd-password-modal.spec.js +++ b/packages/cfd/src/Containers/__tests__/cfd-password-modal.spec.js @@ -157,7 +157,7 @@ describe('', () => { const ele_password_field = await screen.findByTestId('dt_mt5_password'); fireEvent.change(ele_password_field, { target: { value: user_input } }); - expect(await screen.findByText(/enter your dmt5 password to add a dmt5 account/i)).toBeInTheDocument(); + expect(await screen.findByText(/enter your deriv mt5 password to add a dmt5 account/i)).toBeInTheDocument(); expect(await screen.findByRole('button', { name: /add account/i })).toBeInTheDocument(); await waitFor(() => { diff --git a/packages/cfd/src/Containers/__tests__/trading-password-manager.spec.js b/packages/cfd/src/Containers/__tests__/trading-password-manager.spec.js index c39283086c50..2c06d657f185 100644 --- a/packages/cfd/src/Containers/__tests__/trading-password-manager.spec.js +++ b/packages/cfd/src/Containers/__tests__/trading-password-manager.spec.js @@ -40,7 +40,9 @@ describe('TradingPasswordManager', () => { fireEvent.click(screen.getByRole('button', { name: /Change Deriv MT5 password/i })); expect(screen.getByText(/IcMt5OnePassword/i)).toBeInTheDocument(); expect(screen.getByText(/Confirm to change your Deriv MT5 password/i)).toBeInTheDocument(); - expect(screen.getByText(/This will change the password to all of your DMT5 accounts/i)).toBeInTheDocument(); + expect( + screen.getByText(/This will change the password to all of your Deriv MT5 accounts/i) + ).toBeInTheDocument(); expect(screen.getByRole('button', { name: /Cancel/i })).toBeInTheDocument(); expect(screen.getByRole('button', { name: /Confirm/i })).toBeInTheDocument(); });