Skip to content

Commit

Permalink
Merge pull request deriv-com#37 from farhan-nurzi-deriv/P2PS-1095/ref…
Browse files Browse the repository at this point in the history
…actor-loading-modal

refactor: refactor loading modal
  • Loading branch information
farrah-deriv authored Aug 2, 2023
2 parents 3701d00 + c64f485 commit 89cc383
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 3 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 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();
});
});

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import LoadingModal from './loading-modal';

export default LoadingModal;

0 comments on commit 89cc383

Please sign in to comment.