Skip to content

Commit

Permalink
chore: fix failing test case (#5878)
Browse files Browse the repository at this point in the history
  • Loading branch information
balakrishna-deriv committed Jun 30, 2022
1 parent 5f7e1e9 commit 9c390cb
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@ import { fireEvent, render, screen, within } from '@testing-library/react';
import React from 'react';
import { CFDDemoAccountDisplay } from '../cfd-demo-account-display';

const mock_connect_props = {
dxtrade_tokens: {
demo: '',
real: '',
},
};

jest.mock('Stores/connect.js', () => ({
__esModule: true,
default: 'mockedDefaultExport',
connect: () => Component => props => Component({ ...props, ...mock_connect_props }),
}));

describe('<CFDDemoAccountDisplay />', () => {
const TESTED_CASES = {
EU: 'eu',
Expand Down Expand Up @@ -268,7 +281,7 @@ describe('<CFDDemoAccountDisplay />', () => {
const dxtrade_trade_on_web_terminal_button = within_dxtrade_synthetic.getByRole('link', {
name: /trade on web terminal/i,
});
expect(dxtrade_trade_on_web_terminal_button).toHaveAttribute('href', 'https://dx-demo.deriv.com/');
expect(dxtrade_trade_on_web_terminal_button).toHaveAttribute('href', 'https://dx-demo.deriv.com');

fireEvent.click(dxtrade_change_password_button);
expect(props.openPasswordManager).toHaveBeenCalledTimes(2);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@ import { fireEvent, render, screen, within } from '@testing-library/react';
import React from 'react';
import { CFDRealAccountDisplay } from '../cfd-real-account-display';

const mock_connect_props = {
dxtrade_tokens: {
demo: '',
real: '',
},
};

jest.mock('Stores/connect.js', () => ({
__esModule: true,
default: 'mockedDefaultExport',
connect: () => Component => props => Component({ ...props, ...mock_connect_props }),
}));

describe('<CFDRealAccountDisplay />', () => {
const TESTED_CASES = {
EU: 'eu',
Expand Down

1 comment on commit 9c390cb

@vercel
Copy link

@vercel vercel bot commented on 9c390cb Jun 30, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

deriv-app – ./

binary.sx
deriv-app.vercel.app
deriv-app.binary.sx
deriv-app-git-master.binary.sx

Please sign in to comment.