-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #66 from theKashey/wireup-gap
fix: wire up gapMode, fixes #65
- Loading branch information
Showing
3 changed files
with
47 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters