54 lines
1.1 KiB
JavaScript
54 lines
1.1 KiB
JavaScript
import React from 'react';
|
|
import { toMatchImageSnapshot } from 'jest-image-snapshot';
|
|
import renderer from 'react-test-renderer';
|
|
import screenshot from 'react-screenshot-renderer';
|
|
|
|
import { NameIcon } from 'joyent-ui-toolkit';
|
|
|
|
import Title from '../title';
|
|
import Theme from '@mocks/theme';
|
|
|
|
expect.extend({
|
|
toMatchImageSnapshot
|
|
});
|
|
|
|
it('<Title />', async () => {
|
|
expect(
|
|
await screenshot(
|
|
<Theme ss>
|
|
<Title />
|
|
</Theme>
|
|
)
|
|
).toMatchImageSnapshot();
|
|
});
|
|
|
|
it('<Title label="Test"/>', async () => {
|
|
expect(
|
|
await screenshot(
|
|
<Theme ss>
|
|
<Title label="Test" />
|
|
</Theme>
|
|
)
|
|
).toMatchImageSnapshot();
|
|
});
|
|
|
|
it('<Title icon="NameIcon"/>', async () => {
|
|
expect(
|
|
await screenshot(
|
|
<Theme ss>
|
|
<Title icon={<NameIcon />} />
|
|
</Theme>
|
|
)
|
|
).toMatchImageSnapshot();
|
|
});
|
|
|
|
it('<Title icon="Test" label="Instance name"/>', async () => {
|
|
expect(
|
|
await screenshot(
|
|
<Theme ss>
|
|
<Title icon={<NameIcon />} label="Instance name" />
|
|
</Theme>
|
|
)
|
|
).toMatchImageSnapshot();
|
|
});
|