forked from deriv-com/deriv-app
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[TRAH]/Mitra/TRAH-2774/Unit test for disclaimer component (deriv-com#…
…14364) * test: 🧪 unit test for disclaimer component * fix: ✏️ make action meaningful
- Loading branch information
1 parent
a3cccbd
commit aedbff3
Showing
1 changed file
with
27 additions
and
0 deletions.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
...ages/tradershub/src/components/EUDisclaimerMessage/__tests__/EUDisclaimerMessage.spec.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
}); | ||
}); |