-
Notifications
You must be signed in to change notification settings - Fork 116
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Conrad Chan
committed
May 24, 2021
1 parent
c406c45
commit 7ab5b85
Showing
3 changed files
with
140 additions
and
1 deletion.
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
34 changes: 34 additions & 0 deletions
34
src/lib/viewers/box3d/image360/__tests__/Image360Controls-test.tsx
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,34 @@ | ||
import React from 'react'; | ||
import { shallow, ShallowWrapper } from 'enzyme'; | ||
import FullscreenToggle from '../../../controls/fullscreen'; | ||
import Image360Controls, { Props } from '../Image360Controls'; | ||
import VrToggleControl from '../../../controls/box3d/VrToggleControl'; | ||
|
||
describe('lib/viewers/box3d/image360/Image360Controls', () => { | ||
const getDefaults = (): Props => ({ | ||
isVrShown: false, | ||
onFullscreenToggle: jest.fn(), | ||
onVrToggle: jest.fn(), | ||
}); | ||
|
||
const getWrapper = (props: Partial<Props>): ShallowWrapper => | ||
shallow(<Image360Controls {...getDefaults()} {...props} />); | ||
|
||
describe('render()', () => { | ||
test('should return a valid wrapper', () => { | ||
const onFullscreenToggle = jest.fn(); | ||
const onVrToggle = jest.fn(); | ||
|
||
const wrapper = getWrapper({ | ||
onFullscreenToggle, | ||
onVrToggle, | ||
}); | ||
|
||
expect(wrapper.find(VrToggleControl).props()).toMatchObject({ | ||
isVrShown: false, | ||
onVrToggle, | ||
}); | ||
expect(wrapper.find(FullscreenToggle).prop('onFullscreenToggle')).toEqual(onFullscreenToggle); | ||
}); | ||
}); | ||
}); |
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