From 3d909b6c90261e6bd1a40de0a522ac4f85a487a8 Mon Sep 17 00:00:00 2001 From: pradel Date: Sun, 8 Nov 2020 01:24:56 +0100 Subject: [PATCH] test: test that scroll is not blocked when blockScroll is false --- __tests__/index.test.tsx | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/__tests__/index.test.tsx b/__tests__/index.test.tsx index 1f017ab1..a4e87102 100644 --- a/__tests__/index.test.tsx +++ b/__tests__/index.test.tsx @@ -339,6 +339,17 @@ describe('modal', () => { }); }); + describe('prop: blockScroll', () => { + it('should not block the scroll when modal is opened and blockScroll is false', () => { + render( + null}> +
modal content
+
+ ); + expect(document.documentElement.style.position).toBe(''); + }); + }); + describe('prop: onEscKeyDown', () => { it('should be called when esc key is pressed', async () => { const onEscKeyDown = jest.fn();