Skip to content

Commit

Permalink
Rename DMT5 to Deriv Mt5
Browse files Browse the repository at this point in the history
  • Loading branch information
akmal-deriv committed Sep 27, 2022
1 parent 32e03e6 commit f0b74d7
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jest.mock('react-router-dom', () => ({

const interactWithPasswordField = async (trigger_click = true) => {
await waitForElementToBeRemoved(() => screen.getByTestId('dt_initial_loader'));
fireEvent.change(screen.getByLabelText('DMT5 password', { selector: 'input' }), {
fireEvent.change(screen.getByLabelText('Deriv MT5 password', { selector: 'input' }), {
target: { value: 'hN795jCWkDtPy5' },
});
if (trigger_click) {
Expand Down Expand Up @@ -85,7 +85,7 @@ describe('<ResetTradingPasswordModal/>', () => {
);
await interactWithPasswordField();

expect(await screen.findByText('Reset DMT5 password')).toBeInTheDocument();
expect(await screen.findByText('Reset Deriv MT5 password')).toBeInTheDocument();
});

it('should display error message returned by API', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ const SentEmailModal = ({
);
break;
case CFD_PLATFORMS.MT5:
subtitle = localize('Please click on the link in the email to change your DMT5 password.');
subtitle = localize('Please click on the link in the email to change your Deriv MT5 password.');
break;
case 'Google':
case 'Facebook':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ const PasswordsPlatform = ({ email, has_dxtrade_accounts, has_mt5_accounts }) =>
{has_mt5_accounts && (
<React.Fragment>
<Text as='p' className='passwords-platform__desc' color='prominent' size='xs' weight='lighter'>
<Localize i18n_default_text='Your DMT5 password is for logging in to your Deriv MT5 accounts on the desktop, web, and mobile apps.' />
<Localize i18n_default_text='Your Deriv MT5 password is for logging in to your Deriv MT5 accounts on the desktop, web, and mobile apps.' />
</Text>
<Text as='p' className='passwords-platform__desc' color='prominent' size='xs' weight='lighter'>
<Localize
i18n_default_text='Click the <0>Change password</0> button to change your DMT5 password.'
i18n_default_text='Click the <0>Change password</0> button to change your Deriv MT5 password.'
components={[<strong key={0} />]}
/>
</Text>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ describe('ChangePasswordConfirmation', () => {
it('check whether the text is according to the platform', () => {
render(<ChangePasswordConfirmation {...mock_props} />);

expect(screen.getByText(/Confirm to change your DMT5 password/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();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ describe('<CFDPasswordModal/>', () => {
});
});

it('should create DMT5 password when clicked on Create DMT5 password', async () => {
it('should create Deriv MT5 password when clicked on Create Deriv MT5 password', async () => {
const user_input = 'zo8lAet#2q01Ih';
validPassword.mockReturnValue(true);

Expand All @@ -367,7 +367,7 @@ describe('<CFDPasswordModal/>', () => {
</Router>
);
fireEvent.change(await screen.findByTestId('dt_mt5_password'), { target: { value: user_input } });
fireEvent.click(await screen.findByRole('button', { name: 'Create DMT5 password' }));
fireEvent.click(await screen.findByRole('button', { name: 'Create Deriv MT5 password' }));

await waitFor(() => {
expect(mockSubmitMt5Password).toHaveBeenCalled();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,18 @@ describe('TradingPasswordManager', () => {
it('should render the proper icon and text for DMT5 for TradingPasswordManager', () => {
render(<TradingPasswordManager {...mock_props} platform='mt5' />);
expect(screen.getByTestId('dt_mocked_icon')).toHaveTextContent('IcMt5OnePassword');
expect(screen.getAllByText(/DMT5 password/i)[0]).toBeInTheDocument();
expect(screen.getAllByText(/Deriv MT5 password/i)[0]).toBeInTheDocument();
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 call ChangePasswordConfirmation component as the next step if the button is clicked ', () => {
render(<TradingPasswordManager {...mock_props} />);
fireEvent.click(screen.getByRole('button', { name: /Change DMT5 password/i }));
fireEvent.click(screen.getByRole('button', { name: /Change Deriv MT5 password/i }));
expect(screen.getByText(/IcMt5OnePassword/i)).toBeInTheDocument();
expect(screen.getByText(/Confirm to change your DMT5 password/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.getByRole('button', { name: /Cancel/i })).toBeInTheDocument();
expect(screen.getByRole('button', { name: /Confirm/i })).toBeInTheDocument();
Expand Down Expand Up @@ -67,19 +67,19 @@ describe('TradingPasswordManager', () => {

it('should return to the previous Modal (TradingPasswordManager) if cancel button is clicked', () => {
render(<TradingPasswordManager {...mock_props} />);
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: /Cancel/i }));
expect(screen.getByText(/Change DMT5 password/i)).toBeInTheDocument();
expect(screen.getByText(/Change Deriv MT5 password/i)).toBeInTheDocument();
});

it('should call SendEmailModal if the confirm button is clicked for DMT5 account', async () => {
render(<TradingPasswordManager {...mock_props} />);
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 }));
await waitFor(() => expect(screen.getByText(/We've sent you an email/i)).toBeInTheDocument());
await waitFor(() =>
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()
);
await waitFor(() => expect(screen.getByText(/Didn't receive the email?/i)).toBeInTheDocument());
Expand Down

0 comments on commit f0b74d7

Please sign in to comment.