Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
test: test that scroll is not blocked when blockScroll is false
  • Loading branch information
pradel committed Nov 8, 2020
1 parent 4db4971 commit 3d909b6
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions __tests__/index.test.tsx
Expand Up @@ -339,6 +339,17 @@ describe('modal', () => {
});
});

describe('prop: blockScroll', () => {
it('should not block the scroll when modal is opened and blockScroll is false', () => {
render(
<Modal open blockScroll={false} onClose={() => null}>
<div>modal content</div>
</Modal>
);
expect(document.documentElement.style.position).toBe('');
});
});

describe('prop: onEscKeyDown', () => {
it('should be called when esc key is pressed', async () => {
const onEscKeyDown = jest.fn();
Expand Down

0 comments on commit 3d909b6

Please sign in to comment.