Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it('clears body scroll lock when shouldLockBgScroll is true', () => {
component = shallow(
<dialog>
);
component.instance().componentWillUnmount();
expect(enableBodyScroll.mock.calls.length).toBe(1);
expect(enableBodyScroll.mock.calls[0][0]).toBe('scrollTarget2');
expect(clearAllBodyScrollLocks.mock.calls.length).toBe(1);
});
</dialog>
it('clears body scroll lock when shouldLockBgScroll changes to false', () => {
component = shallow(
<dialog>
);
component.instance().componentDidUpdate({ shouldLockBgScroll: true });
expect(enableBodyScroll.mock.calls.length).toBe(1);
expect(enableBodyScroll.mock.calls[0][0]).toBe('scrollTarget1');
expect(clearAllBodyScrollLocks.mock.calls.length).toBe(1);
});
</dialog>