Skip to content

Commit

Permalink
[TRAH]/Mitra/TRAH-2774/Unit test for disclaimer component (deriv-com#…
Browse files Browse the repository at this point in the history
…14364)

* test: 🧪 unit test for disclaimer component

* fix: ✏️ make action meaningful
  • Loading branch information
mitra-deriv authored Mar 27, 2024
1 parent a3cccbd commit aedbff3
Showing 1 changed file with 27 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import React from 'react';
import { render, screen } from '@testing-library/react';
import EUDisclaimerMessage from '../EUDisclaimerMessage';

describe('EUDisclaimerMessage component', () => {
it('should render the EU disclaimer message correctly', () => {
render(<EUDisclaimerMessage />);

expect(screen.getByText(/EU statutory disclaimer/i)).toBeInTheDocument();

expect(
screen.getByText(
/: CFDs are complex instruments and come with a high risk of losing money rapidly due to leverage./i
)
).toBeInTheDocument();

expect(
screen.getByText(/70.1% of retail investor accounts lose money when trading CFDs with this provider/i)
).toBeInTheDocument();

expect(
screen.getByText(
/. You should consider whether you understand how CFDs work and whether you can afford to take the high risk of losing your money./i
)
).toBeInTheDocument();
});
});

0 comments on commit aedbff3

Please sign in to comment.