mirror of
https://github.com/strapi/strapi.git
synced 2025-09-25 16:29:34 +00:00
Add test for nav
This commit is contained in:
parent
3dadfe51b9
commit
738a4567d6
@ -0,0 +1,37 @@
|
|||||||
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||||
|
|
||||||
|
exports[`<ContentTypeBuilderNav /> renders and matches the snapshot 1`] = `
|
||||||
|
.c0 {
|
||||||
|
border: 0;
|
||||||
|
-webkit-clip: rect(0 0 0 0);
|
||||||
|
clip: rect(0 0 0 0);
|
||||||
|
height: 1px;
|
||||||
|
margin: -1px;
|
||||||
|
overflow: hidden;
|
||||||
|
padding: 0;
|
||||||
|
position: absolute;
|
||||||
|
width: 1px;
|
||||||
|
}
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<div
|
||||||
|
class="c0"
|
||||||
|
>
|
||||||
|
<p
|
||||||
|
aria-live="polite"
|
||||||
|
id="live-region-log"
|
||||||
|
role="log"
|
||||||
|
/>
|
||||||
|
<p
|
||||||
|
aria-live="polite"
|
||||||
|
id="live-region-status"
|
||||||
|
role="status"
|
||||||
|
/>
|
||||||
|
<p
|
||||||
|
aria-live="assertive"
|
||||||
|
id="live-region-alert"
|
||||||
|
role="alert"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
`;
|
@ -0,0 +1,42 @@
|
|||||||
|
/**
|
||||||
|
*
|
||||||
|
* Tests for ContentTypeBuilderNav
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
import React from 'react';
|
||||||
|
import { render } from '@testing-library/react';
|
||||||
|
import { Router, Route } from 'react-router-dom';
|
||||||
|
import { createMemoryHistory } from 'history';
|
||||||
|
import Theme from '../../../../../../admin/admin/src/components/Theme';
|
||||||
|
import LanguageProvider from '../../../../../../admin/admin/src/components/LanguageProvider';
|
||||||
|
import en from '../../../../../../admin/admin/src/translations/en.json';
|
||||||
|
|
||||||
|
import ContentTypeBuilderNav from '../index';
|
||||||
|
|
||||||
|
const makeApp = () => {
|
||||||
|
const history = createMemoryHistory();
|
||||||
|
const messages = { en };
|
||||||
|
const localeNames = { en: 'English' };
|
||||||
|
|
||||||
|
return (
|
||||||
|
<LanguageProvider messages={messages} localeNames={localeNames}>
|
||||||
|
<Theme>
|
||||||
|
<Router history={history}>
|
||||||
|
<Route path="/plugins/content-type-builder">
|
||||||
|
<ContentTypeBuilderNav />
|
||||||
|
</Route>
|
||||||
|
</Router>
|
||||||
|
</Theme>
|
||||||
|
</LanguageProvider>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
describe('<ContentTypeBuilderNav />', () => {
|
||||||
|
it('renders and matches the snapshot', () => {
|
||||||
|
const App = makeApp(ContentTypeBuilderNav);
|
||||||
|
const { container } = render(App);
|
||||||
|
|
||||||
|
expect(container).toMatchSnapshot();
|
||||||
|
});
|
||||||
|
});
|
Loading…
x
Reference in New Issue
Block a user