Skip to content

Commit 3d909b6

Browse files
committed
test: test that scroll is not blocked when blockScroll is false
1 parent 4db4971 commit 3d909b6

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

__tests__/index.test.tsx

+11
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,17 @@ describe('modal', () => {
339339
});
340340
});
341341

342+
describe('prop: blockScroll', () => {
343+
it('should not block the scroll when modal is opened and blockScroll is false', () => {
344+
render(
345+
<Modal open blockScroll={false} onClose={() => null}>
346+
<div>modal content</div>
347+
</Modal>
348+
);
349+
expect(document.documentElement.style.position).toBe('');
350+
});
351+
});
352+
342353
describe('prop: onEscKeyDown', () => {
343354
it('should be called when esc key is pressed', async () => {
344355
const onEscKeyDown = jest.fn();

0 commit comments

Comments
 (0)