generated from eea/volto-addon-template
-
Notifications
You must be signed in to change notification settings - Fork 4
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
4 changed files
with
175 additions
and
0 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,42 @@ | ||
import React from 'react'; | ||
import renderer from 'react-test-renderer'; | ||
import configureStore from 'redux-mock-store'; | ||
import { Provider } from 'react-intl-redux'; | ||
|
||
import ColumnVariations from './ColumnVariations'; | ||
|
||
const mockStore = configureStore(); | ||
|
||
test('renders column variations component', () => { | ||
const store = mockStore({ | ||
intl: { | ||
locale: 'en', | ||
messages: {}, | ||
}, | ||
}); | ||
|
||
const component = renderer.create( | ||
<Provider store={store}> | ||
<ColumnVariations | ||
id="column-variations" | ||
title="Column variations" | ||
fieldSet="default" | ||
variants={[ | ||
{ | ||
icon: {}, | ||
defaultData: { | ||
gridSize: 12, | ||
gridCols: ['halfWidth', 'halfWidth'], | ||
}, | ||
common: true, | ||
title: '50 / 50', | ||
}, | ||
]} | ||
onChange={() => {}} | ||
onClick={() => {}} | ||
/> | ||
</Provider>, | ||
); | ||
const json = component.toJSON(); | ||
expect(json).toMatchSnapshot(); | ||
}); |
43 changes: 43 additions & 0 deletions
43
src/ColumnsBlock/__snapshots__/ColumnVariations.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,43 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`renders column variations component 1`] = ` | ||
<div | ||
className="ui segment" | ||
> | ||
<h4> | ||
Select layout: | ||
</h4> | ||
<div | ||
className="ui centered seven cards" | ||
> | ||
<a | ||
className="ui card" | ||
onClick={[Function]} | ||
> | ||
<div | ||
className="content" | ||
> | ||
<svg | ||
className="icon" | ||
dangerouslySetInnerHTML={ | ||
Object { | ||
"__html": undefined, | ||
} | ||
} | ||
onClick={null} | ||
style={ | ||
Object { | ||
"fill": "currentColor", | ||
"height": "55px", | ||
"width": "auto", | ||
} | ||
} | ||
/> | ||
<p> | ||
50 / 50 | ||
</p> | ||
</div> | ||
</a> | ||
</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,32 @@ | ||
import React from 'react'; | ||
import renderer from 'react-test-renderer'; | ||
import configureStore from 'redux-mock-store'; | ||
import { Provider } from 'react-intl-redux'; | ||
|
||
import QuadSize from './QuadSize'; | ||
|
||
const mockStore = configureStore(); | ||
|
||
test('renders a quad size widget component', () => { | ||
const store = mockStore({ | ||
intl: { | ||
locale: 'en', | ||
messages: {}, | ||
}, | ||
}); | ||
|
||
const component = renderer.create( | ||
<Provider store={store}> | ||
<QuadSize | ||
id="quadsize-widget" | ||
title="QuadSize Widget" | ||
fieldSet="default" | ||
onChange={() => {}} | ||
onBlur={() => {}} | ||
onClick={() => {}} | ||
/> | ||
</Provider>, | ||
); | ||
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,58 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`renders a quad size widget component 1`] = ` | ||
<div | ||
className="inline field field-wrapper-quadsize-widget" | ||
> | ||
<div | ||
className="ui grid" | ||
> | ||
<div | ||
className="stretched row" | ||
> | ||
<div | ||
className="four wide column" | ||
> | ||
<div | ||
className="wrapper" | ||
> | ||
<label | ||
htmlFor="field-quadsize-widget" | ||
id="fieldset-default-field-label-quadsize-widget" | ||
> | ||
QuadSize Widget | ||
</label> | ||
</div> | ||
</div> | ||
<div | ||
className="eight wide column" | ||
> | ||
<div | ||
className="mocked-choices-widget" | ||
id="mocked-field-quadsize-widget-unit" | ||
> | ||
Unit | ||
- | ||
No description | ||
</div> | ||
<div | ||
className="mocked-default-widget" | ||
id="mocked-field-quadsize-widget-slider" | ||
> | ||
Size | ||
- | ||
No description | ||
</div> | ||
<div | ||
className="mocked-boolean-widget" | ||
id="mocked-field-quadsize-widget-lockSize" | ||
> | ||
Customize | ||
- | ||
No description | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
`; |