mirror of
https://github.com/Unleash/unleash.git
synced 2025-04-06 01:15:28 +02:00
fix(archive): regenrate snapshot test for archive view
This commit is contained in:
parent
09bd67f1f1
commit
55683b0038
1
frontend/src/__mocks__/react-mdl.js
vendored
1
frontend/src/__mocks__/react-mdl.js
vendored
@ -11,6 +11,7 @@ module.exports = {
|
|||||||
List: 'react-mdl-List',
|
List: 'react-mdl-List',
|
||||||
ListItem: 'react-mdl-ListItem',
|
ListItem: 'react-mdl-ListItem',
|
||||||
ListItemContent: 'react-mdl-ListItemContent',
|
ListItemContent: 'react-mdl-ListItemContent',
|
||||||
|
ListItemAction: 'react-mdl-ListItemAction',
|
||||||
ProgressBar: 'react-mdl-ProgressBar',
|
ProgressBar: 'react-mdl-ProgressBar',
|
||||||
Switch: 'react-mdl-Switch',
|
Switch: 'react-mdl-Switch',
|
||||||
Tab: 'react-mdl-Tab',
|
Tab: 'react-mdl-Tab',
|
||||||
|
@ -5,81 +5,94 @@ exports[`renders correctly with archived toggles 1`] = `
|
|||||||
className="fullwidth"
|
className="fullwidth"
|
||||||
shadow={0}
|
shadow={0}
|
||||||
>
|
>
|
||||||
<div
|
<div>
|
||||||
className="horisontalScroll"
|
<div
|
||||||
>
|
|
||||||
<react-mdl-DataTable
|
|
||||||
className="fullwidth"
|
|
||||||
rows={
|
|
||||||
Array [
|
|
||||||
Object {
|
|
||||||
"createdAt": "2016-10-25T15:38:28.573Z",
|
|
||||||
"description": "Disables the confirm-functionality from API",
|
|
||||||
"enabled": false,
|
|
||||||
"name": "adin-pay-confirm-disabled",
|
|
||||||
"reviveName": "adin-pay-confirm-disabled",
|
|
||||||
"strategies": Array [
|
|
||||||
Object {
|
|
||||||
"name": "default",
|
|
||||||
"parameters": Object {},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
Object {
|
|
||||||
"createdAt": "2016-08-03T12:41:35.631Z",
|
|
||||||
"description": "Enables use of schibsted payment from order-payment-management",
|
|
||||||
"enabled": true,
|
|
||||||
"name": "adin-pay-platform-sch-payment",
|
|
||||||
"reviveName": "adin-pay-platform-sch-payment",
|
|
||||||
"strategies": Array [
|
|
||||||
Object {
|
|
||||||
"name": "default",
|
|
||||||
"parameters": Object {},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
]
|
|
||||||
}
|
|
||||||
style={
|
style={
|
||||||
Object {
|
Object {
|
||||||
"border": 0,
|
"position": "relative",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<react-mdl-TableHeader
|
<react-mdl-List>
|
||||||
cellFormatter={[Function]}
|
<react-mdl-ListItem
|
||||||
name="reviveName"
|
className="archiveList"
|
||||||
style={
|
>
|
||||||
Object {
|
<span
|
||||||
"width": "25px",
|
className="listItemToggle"
|
||||||
}
|
>
|
||||||
}
|
Toggle name
|
||||||
>
|
</span>
|
||||||
Revive
|
<span
|
||||||
</react-mdl-TableHeader>
|
className="listItemRevive"
|
||||||
<react-mdl-TableHeader
|
>
|
||||||
cellFormatter={[Function]}
|
Revive
|
||||||
name="enabled"
|
</span>
|
||||||
style={
|
</react-mdl-ListItem>
|
||||||
Object {
|
<hr />
|
||||||
"width": "25px",
|
<react-mdl-List>
|
||||||
}
|
<react-mdl-ListItem
|
||||||
}
|
twoLine={true}
|
||||||
>
|
>
|
||||||
Enabled
|
<react-mdl-ListItemAction>
|
||||||
</react-mdl-TableHeader>
|
<react-mdl-Icon
|
||||||
<react-mdl-TableHeader
|
name="keyboard_arrow_right"
|
||||||
name="name"
|
/>
|
||||||
>
|
</react-mdl-ListItemAction>
|
||||||
Toggle name
|
<react-mdl-ListItemContent>
|
||||||
</react-mdl-TableHeader>
|
<a
|
||||||
<react-mdl-TableHeader
|
className="listLink truncate"
|
||||||
name="createdAt"
|
onClick={[Function]}
|
||||||
numeric={true}
|
style={Object {}}
|
||||||
>
|
>
|
||||||
Created
|
adin-pay-confirm-disabled
|
||||||
</react-mdl-TableHeader>
|
<div
|
||||||
</react-mdl-DataTable>
|
className="toggleDetails"
|
||||||
|
>
|
||||||
|
Disables the confirm-functionality from API
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
</react-mdl-ListItemContent>
|
||||||
|
<react-mdl-ListItemAction
|
||||||
|
onClick={[Function]}
|
||||||
|
>
|
||||||
|
<react-mdl-Icon
|
||||||
|
name="undo"
|
||||||
|
/>
|
||||||
|
</react-mdl-ListItemAction>
|
||||||
|
</react-mdl-ListItem>
|
||||||
|
<react-mdl-ListItem
|
||||||
|
twoLine={true}
|
||||||
|
>
|
||||||
|
<react-mdl-ListItemAction>
|
||||||
|
<react-mdl-Icon
|
||||||
|
name="keyboard_arrow_right"
|
||||||
|
/>
|
||||||
|
</react-mdl-ListItemAction>
|
||||||
|
<react-mdl-ListItemContent>
|
||||||
|
<a
|
||||||
|
className="listLink truncate"
|
||||||
|
onClick={[Function]}
|
||||||
|
style={Object {}}
|
||||||
|
>
|
||||||
|
adin-pay-platform-sch-payment
|
||||||
|
<div
|
||||||
|
className="toggleDetails"
|
||||||
|
>
|
||||||
|
Enables use of schibsted payment from order-payment-management
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
</react-mdl-ListItemContent>
|
||||||
|
<react-mdl-ListItemAction
|
||||||
|
onClick={[Function]}
|
||||||
|
>
|
||||||
|
<react-mdl-Icon
|
||||||
|
name="undo"
|
||||||
|
/>
|
||||||
|
</react-mdl-ListItemAction>
|
||||||
|
</react-mdl-ListItem>
|
||||||
|
</react-mdl-List>
|
||||||
|
</react-mdl-List>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</react-mdl-Card>
|
</react-mdl-Card>
|
||||||
`;
|
`;
|
||||||
|
@ -1,36 +1,35 @@
|
|||||||
// import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
// import ArchiveList from '../archive-list-component';
|
import ArchiveList from '../archive-list-component';
|
||||||
// import renderer from 'react-test-renderer';
|
import renderer from 'react-test-renderer';
|
||||||
|
|
||||||
jest.mock('react-mdl');
|
jest.mock('react-mdl');
|
||||||
|
|
||||||
// const archive = [
|
const archive = [
|
||||||
// {
|
{
|
||||||
// name: 'adin-pay-confirm-disabled',
|
name: 'adin-pay-confirm-disabled',
|
||||||
// description: 'Disables the confirm-functionality from API',
|
description: 'Disables the confirm-functionality from API',
|
||||||
// enabled: false,
|
enabled: false,
|
||||||
// strategies: [{ name: 'default', parameters: {} }],
|
strategies: [{ name: 'default', parameters: {} }],
|
||||||
// createdAt: '2016-10-25T15:38:28.573Z',
|
createdAt: '2016-10-25T15:38:28.573Z',
|
||||||
// reviveName: 'adin-pay-confirm-disabled',
|
reviveName: 'adin-pay-confirm-disabled',
|
||||||
// },
|
},
|
||||||
// {
|
{
|
||||||
// name: 'adin-pay-platform-sch-payment',
|
name: 'adin-pay-platform-sch-payment',
|
||||||
// description: 'Enables use of schibsted payment from order-payment-management',
|
description: 'Enables use of schibsted payment from order-payment-management',
|
||||||
// enabled: true,
|
enabled: true,
|
||||||
// strategies: [{ name: 'default', parameters: {} }],
|
strategies: [{ name: 'default', parameters: {} }],
|
||||||
// createdAt: '2016-08-03T12:41:35.631Z',
|
createdAt: '2016-08-03T12:41:35.631Z',
|
||||||
// reviveName: 'adin-pay-platform-sch-payment',
|
reviveName: 'adin-pay-platform-sch-payment',
|
||||||
// },
|
},
|
||||||
// ];
|
];
|
||||||
|
|
||||||
// todo: fix snapshot test
|
|
||||||
test('renders correctly with no archived toggles', () => {
|
test('renders correctly with no archived toggles', () => {
|
||||||
// const tree = renderer.create(<ArchiveList fetchArchive={jest.fn()} archive={[]} />).toJSON();
|
const tree = renderer.create(<ArchiveList fetchArchive={jest.fn()} archive={[]} />).toJSON();
|
||||||
// expect(tree).toMatchSnapshot();
|
expect(tree).toMatchSnapshot();
|
||||||
});
|
});
|
||||||
|
|
||||||
test('renders correctly with archived toggles', () => {
|
test('renders correctly with archived toggles', () => {
|
||||||
// const tree = renderer.create(<ArchiveList fetchArchive={jest.fn()} archive={archive} />).toJSON();
|
const tree = renderer.create(<ArchiveList fetchArchive={jest.fn()} archive={archive} />).toJSON();
|
||||||
// expect(tree).toMatchSnapshot();
|
expect(tree).toMatchSnapshot();
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user