-
-
Notifications
You must be signed in to change notification settings - Fork 301
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add empty checks, fix #100
- Loading branch information
Showing
5 changed files
with
154 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
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,24 @@ | ||
import React from 'react' | ||
import renderer from 'react-test-renderer' | ||
import { GroupedVirtuoso } from '../src' | ||
import { Virtuoso } from '../src/Virtuoso' | ||
|
||
test('Test rendering of empty list', () => { | ||
expect( | ||
renderer.create( | ||
<div> | ||
<Virtuoso totalCount={100} item={() => <div />} /> | ||
</div> | ||
) | ||
).toMatchSnapshot() | ||
}) | ||
|
||
test('Test rendering of empty grouped list', () => { | ||
expect( | ||
renderer.create( | ||
<div> | ||
<GroupedVirtuoso groupCounts={[]} group={() => <div />} item={() => <div />} /> | ||
</div> | ||
) | ||
).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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`Test rendering of empty grouped list 1`] = ` | ||
<div> | ||
<div | ||
style={ | ||
Object { | ||
"WebkitOverflowScrolling": "touch", | ||
"height": "40rem", | ||
"outline": "none", | ||
"overflowY": "auto", | ||
"position": "relative", | ||
} | ||
} | ||
tabIndex={0} | ||
> | ||
<div | ||
style={ | ||
Object { | ||
"height": "100%", | ||
"overflow": "absolute", | ||
"position": "absolute", | ||
"top": 0, | ||
"width": "100%", | ||
} | ||
} | ||
> | ||
<div | ||
style={ | ||
Object { | ||
"marginTop": "NaNpx", | ||
} | ||
} | ||
> | ||
</div> | ||
</div> | ||
<div | ||
style={ | ||
Object { | ||
"height": "0px", | ||
"position": "absolute", | ||
"top": 0, | ||
} | ||
} | ||
> | ||
</div> | ||
</div> | ||
</div> | ||
`; | ||
|
||
exports[`Test rendering of empty list 1`] = ` | ||
<div> | ||
<div | ||
style={ | ||
Object { | ||
"WebkitOverflowScrolling": "touch", | ||
"height": "40rem", | ||
"outline": "none", | ||
"overflowY": "auto", | ||
"position": "relative", | ||
} | ||
} | ||
tabIndex={0} | ||
> | ||
<div | ||
style={ | ||
Object { | ||
"height": "100%", | ||
"overflow": "absolute", | ||
"position": "absolute", | ||
"top": 0, | ||
"width": "100%", | ||
} | ||
} | ||
> | ||
<div | ||
style={ | ||
Object { | ||
"marginTop": "NaNpx", | ||
} | ||
} | ||
> | ||
</div> | ||
</div> | ||
<div | ||
style={ | ||
Object { | ||
"height": "0px", | ||
"position": "absolute", | ||
"top": 0, | ||
} | ||
} | ||
> | ||
</div> | ||
</div> | ||
</div> | ||
`; |
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