Skip to content

Commit

Permalink
chore: fix failing test case
Browse files Browse the repository at this point in the history
  • Loading branch information
balakrishna-deriv committed Jun 30, 2022
1 parent 9487490 commit 0251ba8
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

0 comments on commit 0251ba8

Please sign in to comment.