1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-09-05 17:53:12 +02:00
unleash.unleash/frontend/src/component/archive/__tests__/archive-list-component-test.jsx
Simen Bekkhus 683ae7e6d8 Use prettier (#87)
* Use prettier

* Upgrade to 1.6 beta

* Update lint deps

* Upgrade to full 1.6
2017-08-28 19:15:47 +02:00

43 lines
1.2 KiB
JavaScript

import React from 'react';
import ArchiveList from '../archive-list-component';
import renderer from 'react-test-renderer';
jest.mock('react-mdl');
const archive = [
{
name: 'adin-pay-confirm-disabled',
description: 'Disables the confirm-functionality from API',
enabled: false,
strategies: [{ name: 'default', parameters: {} }],
createdAt: '2016-10-25T15:38:28.573Z',
reviveName: 'adin-pay-confirm-disabled',
},
{
name: 'adin-pay-platform-sch-payment',
description:
'Enables use of schibsted payment from order-payment-management',
enabled: true,
strategies: [{ name: 'default', parameters: {} }],
createdAt: '2016-08-03T12:41:35.631Z',
reviveName: 'adin-pay-platform-sch-payment',
},
];
test('renders correctly with no archived toggles', () => {
const tree = renderer
.create(<ArchiveList fetchArchive={jest.fn()} archive={[]} />)
.toJSON();
expect(tree).toMatchSnapshot();
});
test('renders correctly with archived toggles', () => {
const tree = renderer
.create(<ArchiveList fetchArchive={jest.fn()} archive={archive} />)
.toJSON();
expect(tree).toMatchSnapshot();
});