Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WALL5207] Suisin/chore: update content for tnc modal #17733

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,20 @@ describe('<TncStatusUpdateModal />', () => {
});

renderComponent({ store_config: mock });
expect(screen.queryByText('Please review our updated terms and conditions')).not.toBeInTheDocument();
expect(screen.queryByText('Accept updated terms and conditions')).not.toBeInTheDocument();
});

it('Should render TncStatusUpdateModal with correct content and verify that clicking the button triggers the API call and toggles the modal.', async () => {
renderComponent({});
expect(screen.getByText("Updated T&C's")).toBeInTheDocument();
expect(screen.getByText('By continuing you understand and accept the changes.')).toBeInTheDocument();
const continue_button = screen.getByRole('button', { name: 'Continue' });
expect(screen.getByText('Accept updated terms and conditions')).toBeInTheDocument();
expect(screen.getByText(/To continue trading, review and accept our updated/)).toBeInTheDocument();
expect(
screen.getByText(
/\. Not accepting will lead to restricted access to your account. Need help\? Contact us via/
)
).toBeInTheDocument();
expect(screen.getByText(/live chat/)).toBeInTheDocument();
const continue_button = screen.getByRole('button', { name: 'Accept now' });

await userEvent.click(continue_button);
expect(WS.tncApproval).toBeCalled();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { observer, useStore } from '@deriv/stores';
import { WS } from '@deriv/shared';
import { useDevice } from '@deriv-com/ui';
import './tnc-status-update-modal.scss';
import { URLUtils } from '@deriv-com/utils';

const TncStatusUpdateModal = observer(() => {
const { client, ui } = useStore();
Expand All @@ -27,12 +28,12 @@ const TncStatusUpdateModal = observer(() => {
>
<div className='tnc-status-update-modal'>
<Text size={isDesktop ? 's' : 'xs'} weight='bold'>
<Localize i18n_default_text="Updated T&C's" />
<Localize i18n_default_text='Accept updated terms and conditions' />
</Text>
<div className='tnc-status-update-modal__text-container'>
<Text size={isDesktop ? 'xs' : 'xxs'}>
<Localize
i18n_default_text='Please review our updated <0>terms and conditions</0>.'
i18n_default_text='To continue trading, review and accept our updated <0>terms and conditions</0>. Not accepting will lead to restricted access to your account. Need help? Contact us via <0>live chat</0>.'
components={[
<StaticUrl
key={0}
suisin-deriv marked this conversation as resolved.
Show resolved Hide resolved
Expand All @@ -43,13 +44,10 @@ const TncStatusUpdateModal = observer(() => {
]}
/>
</Text>
<Text size={isDesktop ? 'xs' : 'xxs'}>
<Localize i18n_default_text='By continuing you understand and accept the changes.' />
</Text>
</div>
<div className='tnc-status-update-modal__button'>
<Button className='dc-dialog__button' has_effect onClick={onClick} primary large>
<Localize i18n_default_text='Continue' />
<Localize i18n_default_text='Accept now' />
</Button>
</div>
</div>
Expand Down
Loading