-
-
Notifications
You must be signed in to change notification settings - Fork 572
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
1 parent
842267e
commit e1051d0
Showing
9 changed files
with
97 additions
and
63 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
This file was deleted.
Oops, something went wrong.
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,21 @@ | ||
import React from 'react'; | ||
import renderer from 'react-test-renderer'; | ||
import Grid from './Grid'; | ||
|
||
jest.mock('../Row/Row', | ||
() => jest.fn(() => <div />)); | ||
|
||
test('renders a grid component', () => { | ||
const component = renderer.create( | ||
<Grid | ||
rows={[ | ||
['cell 1.1', 'cell 1.2'], | ||
['cell 2.1', 'cell 2.2'], | ||
]} | ||
selectTile={() => {}} | ||
setTileContent={() => {}} | ||
/> | ||
); | ||
const json = component.toJSON(); | ||
expect(json).toMatchSnapshot(); | ||
}); |
10 changes: 10 additions & 0 deletions
10
src/components/mosaic/Grid/__snapshots__/Grid.test.js.snap
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,10 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`renders a grid component 1`] = ` | ||
<div | ||
className="grid" | ||
> | ||
<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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import React from 'react'; | ||
import renderer from 'react-test-renderer'; | ||
import Row from './Row'; | ||
|
||
jest.mock('../Tile/Tile', | ||
() => jest.fn(() => <div />)); | ||
|
||
test('renders a row component', () => { | ||
const component = renderer.create( | ||
<Row | ||
tiles={[{ | ||
url: 'http://localhost', | ||
}]} | ||
row={0} | ||
selectTile={() => {}} | ||
setTileContent={() => {}} | ||
/> | ||
); | ||
const json = component.toJSON(); | ||
expect(json).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,9 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`renders a row component 1`] = ` | ||
<div | ||
className="undefined row" | ||
> | ||
<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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import React from 'react'; | ||
import renderer from 'react-test-renderer'; | ||
import Tile from './Tile'; | ||
|
||
jest.mock('draft-js-editor', | ||
() => jest.fn(() => <div />)); | ||
global.__SERVER__ = true; | ||
|
||
test('renders a tile component', () => { | ||
const component = renderer.create( | ||
<Tile | ||
content={'<h1>Hello World!</h1>'} | ||
width={4} | ||
row={0} | ||
column={0} | ||
selected={true} | ||
selectTile={() => {}} | ||
setTileContent={() => {}} | ||
/> | ||
); | ||
const json = component.toJSON(); | ||
expect(json).toMatchSnapshot(); | ||
}); |
12 changes: 12 additions & 0 deletions
12
src/components/mosaic/Tile/__snapshots__/Tile.test.js.snap
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,12 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`renders a tile component 1`] = ` | ||
<div | ||
className="undefined col-xs-4 undefined" | ||
> | ||
<div | ||
className={undefined} | ||
onClick={[Function]} | ||
/> | ||
</div> | ||
`; |