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.
Merge pull request deriv-com#37 from farhan-nurzi-deriv/P2PS-1095/ref…
…actor-loading-modal refactor: refactor loading modal
- Loading branch information
Showing
4 changed files
with
30 additions
and
3 deletions.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
...es/p2p/src/components/modal-manager/modals/loading-modal/__tests__/loading-modal.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 ModalManagerContextProvider from 'Components/modal-manager/modal-manager-context-provider'; | ||
import LoadingModal from '../loading-modal'; | ||
|
||
jest.mock('Components/modal-manager/modal-manager-context', () => ({ | ||
useModalManagerContext: () => ({ | ||
is_modal_open: true, | ||
}), | ||
})); | ||
|
||
describe('<LoadingModal />', () => { | ||
let modal_root_el: HTMLElement; | ||
beforeAll(() => { | ||
modal_root_el = document.createElement('div'); | ||
modal_root_el.setAttribute('id', 'modal_root'); | ||
document.body.appendChild(modal_root_el); | ||
}); | ||
|
||
afterAll(() => { | ||
document.body.removeChild(modal_root_el); | ||
}); | ||
it('should render loading modal', () => { | ||
render(<LoadingModal />); | ||
expect(screen.getByTestId('dt_initial_loader')).toBeInTheDocument(); | ||
}); | ||
}); |
3 changes: 0 additions & 3 deletions
3
packages/p2p/src/components/modal-manager/modals/loading-modal/index.js
This file was deleted.
Oops, something went wrong.
3 changes: 3 additions & 0 deletions
3
packages/p2p/src/components/modal-manager/modals/loading-modal/index.ts
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,3 @@ | ||
import LoadingModal from './loading-modal'; | ||
|
||
export default LoadingModal; |
File renamed without changes.