-
-
Notifications
You must be signed in to change notification settings - Fork 99
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
Showing
25 changed files
with
910 additions
and
39 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
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,27 @@ | ||
import React, { createRef } from 'react' | ||
import { render } from '@testing-library/react' | ||
import ControlledActivated from '../source/UncontrolledActivated' | ||
|
||
test('returns null when no portalEl', async () => { | ||
const { container } = render( | ||
<ControlledActivated | ||
closeText="Unzoom image" | ||
isActive={true} | ||
onLoad={jest.fn()} | ||
onUnload={jest.fn()} | ||
onZoomChange={jest.fn()} | ||
overlayBgColorEnd="rgba(255, 255, 255, 0.95)" | ||
overlayBgColorStart="rgba(255, 255, 255, 0)" | ||
parentRef={createRef(null)} | ||
portalEl={undefined} | ||
scrollableEl={null} | ||
transitionDuration={300} | ||
zoomMargin={0} | ||
zoomZindex={2147483647} | ||
> | ||
<img alt="foo" src="foo.jpg" width="500" /> | ||
</ControlledActivated> | ||
) | ||
|
||
expect(container).toMatchSnapshot() | ||
}) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import React, { createRef } from 'react' | ||
import { render } from '@testing-library/react' | ||
import UncontrolledActivated from '../source/UncontrolledActivated' | ||
|
||
test('returns null when no portalEl', async () => { | ||
const { container } = render( | ||
<UncontrolledActivated | ||
closeText="Unzoom image" | ||
onLoad={jest.fn()} | ||
onUnload={jest.fn()} | ||
overlayBgColorEnd="rgba(255, 255, 255, 0.95)" | ||
overlayBgColorStart="rgba(255, 255, 255, 0)" | ||
parentRef={createRef(null)} | ||
portalEl={undefined} | ||
scrollableEl={null} | ||
transitionDuration={300} | ||
zoomMargin={0} | ||
zoomZindex={2147483647} | ||
> | ||
<img alt="foo" src="foo.jpg" width="500" /> | ||
</UncontrolledActivated> | ||
) | ||
|
||
expect(container).toMatchSnapshot() | ||
}) |
Oops, something went wrong.