1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-09-24 17:51:14 +02:00
unleash.unleash/frontend/src/component/menu/Footer/ApiDetails/ApiDetails.test.tsx
olav ff0d55b6cc fix: improve HTML landmarks (#886)
* fix: improve HTML landmarks

* refactor: footer headers should use h2

* refactor: fix header order on the feature overview page

* fix: make drawer logo clickable

* fix: wrap header links in <nav>

* fix: label breadcrumbs nav element

* refactor: remove unused breadcrumb.jsx

* fix: add search role to SearchField

* fix: correct heading order on form pages
2022-04-21 09:52:43 +02:00

54 lines
1.4 KiB
TypeScript

import React from 'react';
import { ApiDetails } from 'component/menu/Footer/ApiDetails/ApiDetails';
import { render } from 'utils/testRenderer';
test('renders correctly with empty version', () => {
const uiConfig = {
name: 'Unleash',
slogan: 'We are the best!',
environment: 'test',
version: '',
};
render(<ApiDetails uiConfig={uiConfig} />);
expect(document.body).toMatchSnapshot();
});
test('renders correctly with ui-config', () => {
const uiConfig = {
name: 'Unleash',
slogan: 'We are the best!',
environment: 'test',
version: '1.1.0',
};
render(<ApiDetails uiConfig={uiConfig} />);
expect(document.body).toMatchSnapshot();
});
test('renders correctly without uiConfig', () => {
const uiConfig = {
name: 'Unleash',
version: '1.1.0',
};
render(<ApiDetails uiConfig={uiConfig} />);
expect(document.body).toMatchSnapshot();
});
test('renders correctly with versionInfo', () => {
const uiConfig = {
name: 'Unleash',
version: '1.2.3',
versionInfo: {
instanceId: '1',
isLatest: false,
current: { enterprise: '1.2.3', oss: '1.2.3' },
latest: { enterprise: '1.2.4', oss: '1.2.4' },
},
};
render(<ApiDetails uiConfig={uiConfig} />);
expect(document.body).toMatchSnapshot();
});