2018-01-25 02:54:08 +02:00
|
|
|
import React from 'react';
|
|
|
|
import { toMatchImageSnapshot } from 'jest-image-snapshot';
|
|
|
|
import screenshot from 'react-screenshot-renderer';
|
|
|
|
|
|
|
|
import Menu from '../menu';
|
|
|
|
import Theme from '@mocks/theme';
|
|
|
|
|
|
|
|
expect.extend({
|
|
|
|
toMatchImageSnapshot
|
|
|
|
});
|
|
|
|
|
|
|
|
it('<Menu />', async () => {
|
|
|
|
expect(
|
|
|
|
await screenshot(
|
|
|
|
<Theme ss>
|
|
|
|
<Menu />
|
|
|
|
</Theme>
|
|
|
|
)
|
|
|
|
).toMatchImageSnapshot();
|
|
|
|
});
|
|
|
|
|
|
|
|
it('<Menu links />', async () => {
|
|
|
|
const links = [
|
|
|
|
{
|
|
|
|
name: 'summary',
|
2018-02-15 16:37:59 +02:00
|
|
|
pathname: '/:name/summary'
|
2018-01-25 02:54:08 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'tags',
|
2018-02-15 16:37:59 +02:00
|
|
|
pathname: '/:name/tags'
|
2018-01-25 02:54:08 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'metadata',
|
2018-02-15 16:37:59 +02:00
|
|
|
pathname: '/:name/metadata'
|
2018-01-25 02:54:08 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'networks',
|
2018-02-15 16:37:59 +02:00
|
|
|
pathname: '/:name/networks'
|
2018-01-25 02:54:08 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'firewall',
|
2018-02-15 16:37:59 +02:00
|
|
|
pathname: '/:name/firewall'
|
2018-01-25 02:54:08 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'dns',
|
2018-02-15 16:37:59 +02:00
|
|
|
pathname: '/:name/dns'
|
2018-01-25 02:54:08 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'snapshots',
|
2018-02-15 16:37:59 +02:00
|
|
|
pathname: '/:name/snapshots'
|
2018-01-25 02:54:08 +02:00
|
|
|
}
|
|
|
|
];
|
|
|
|
|
|
|
|
expect(
|
|
|
|
await screenshot(
|
|
|
|
<Theme ss>
|
|
|
|
<Menu links={links} />
|
|
|
|
</Theme>
|
|
|
|
)
|
|
|
|
).toMatchImageSnapshot();
|
|
|
|
});
|