How to use the body-scroll-lock.disableBodyScroll.mock function in body-scroll-lock

To help you get started, we’ve selected a few body-scroll-lock examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github qantasairways / runway / src / shared / ButtonWithDialog / __test__ / Dialog.spec.js View on Github external
it('adds body scroll lock when shouldLockBgScroll changes to true', () => {
      component = shallow(<Dialog {...requiredProps} shouldLockBgScroll />);
      component.instance().componentDidUpdate({ shouldLockBgScroll: false });
      expect(disableBodyScroll.mock.calls.length).toBe(1);
    });
github qantasairways / runway / src / shared / ButtonWithDialog / __test__ / Dialog.spec.js View on Github external
it('adds body scroll lock when transitionState changes to "entered" and shouldLockBgScroll is true', () => {
      component = shallow(
        <Dialog
          {...requiredProps}
          shouldLockBgScroll
          transitionState="entered"
        />
      );
      component.instance().componentDidUpdate({
        shouldLockBgScroll: true,
        transitionState: 'entering'
      });
      expect(disableBodyScroll.mock.calls.length).toBe(1);
    });
  });