Skip to content

Commit

Permalink
update test for scroll lock
Browse files Browse the repository at this point in the history
  • Loading branch information
theKashey committed Mar 16, 2023
1 parent 455fda9 commit 6327e83
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions __tests__/scroll-lock-integration.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import * as React from 'react';
import {configure, mount} from 'enzyme';
import {FocusOn} from '../src/UI';
import {sidecar} from "use-sidecar";
import { RemoveScroll } from 'react-remove-scroll/UI';
import * as Adapter from 'enzyme-adapter-react-16';

configure({ adapter: new Adapter() });



const tick = () => new Promise(resolve => setTimeout(resolve, 10));

const car = sidecar(() => import ('../src/sidecar'));

describe('UI', () => {
it('gap off', async () => {
const wrapper = mount(
<FocusOn sideCar={car}>content</FocusOn>
);
expect((wrapper).find(RemoveScroll).prop('gapMode')).toBe(undefined);
});
it('gap off', async () => {
const wrapper = mount(
<FocusOn sideCar={car} gapMode="padding">content</FocusOn>
);
expect((wrapper).find(RemoveScroll).prop('gapMode')).toBe('padding');
});
});

0 comments on commit 6327e83

Please sign in to comment.