forked from binary-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.
Merge pull request #30 from suisin-deriv/suisin/74076/ts_migration_fo…
…r_account_limits_extra_info_and_tests Suisin/74076/ts migration for account limits extra info and tests
- Loading branch information
Showing
6 changed files
with
41 additions
and
36 deletions.
There are no files selected for viewing
28 changes: 0 additions & 28 deletions
28
packages/account/src/Components/account-limits/__tests__/account-limits-extra-info.spec.js
This file was deleted.
Oops, something went wrong.
29 changes: 29 additions & 0 deletions
29
packages/account/src/Components/account-limits/__tests__/account-limits-extra-info.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,29 @@ | ||
import React from 'react'; | ||
import { screen, render } from '@testing-library/react'; | ||
import { isMobile } from '@deriv/shared'; | ||
import AccountLimitsExtraInfo from '../account-limits-extra-info'; | ||
|
||
jest.mock('@deriv/shared', () => ({ | ||
...jest.requireActual('@deriv/shared'), | ||
isMobile: jest.fn(() => true), | ||
})); | ||
|
||
describe('<AccountLimitsExtraInfo/>', () => { | ||
it('should render AccountLimitsExtraInfo component', () => { | ||
render(<AccountLimitsExtraInfo message='Lorem ipsum' />); | ||
expect(screen.getByText(/lorem ipsum/i)).toBeInTheDocument(); | ||
}); | ||
|
||
it('should render PopoverComponent if isMobile is false', () => { | ||
(isMobile as jest.Mock).mockReturnValue(false); | ||
render(<AccountLimitsExtraInfo message='Lorem ipsum' />); | ||
expect(screen.queryByTestId('dt_acc_limits_popover')).toHaveClass('da-account-limits__popover'); | ||
}); | ||
|
||
it('should pass props to PopoverComponent if isMobile is false', async () => { | ||
(isMobile as jest.Mock).mockReturnValue(false); | ||
render(<AccountLimitsExtraInfo message='Lorem ipsum' className='test_class' />); | ||
const popover = await screen.findByTestId('dt_acc_limits_popover'); | ||
expect(popover).toHaveClass('test_class'); | ||
}); | ||
}); |
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
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
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
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