Updating PageTemplate tests to use enzyme
This commit is contained in:
parent
637c9c2afd
commit
5f11a11ba2
@ -1,5 +1,5 @@
|
||||
import React from 'react';
|
||||
import renderer from 'react-test-renderer';
|
||||
import { shallow } from 'enzyme';
|
||||
|
||||
import PageTemplate from './PageTemplate';
|
||||
|
||||
@ -18,21 +18,19 @@ beforeEach(() => {
|
||||
});
|
||||
|
||||
test('PageTemplate rendering', () => {
|
||||
const component = renderer.create(
|
||||
const component = shallow(
|
||||
<PageTemplate>
|
||||
<p>Content</p>
|
||||
</PageTemplate>
|
||||
);
|
||||
let tree = component.toJSON();
|
||||
expect(tree).toMatchSnapshot();
|
||||
expect(component).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('PageTemplate rendering with title', () => {
|
||||
const component = renderer.create(
|
||||
const component = shallow(
|
||||
<PageTemplate title="Example">
|
||||
<p>Content</p>
|
||||
</PageTemplate>
|
||||
);
|
||||
let tree = component.toJSON();
|
||||
expect(tree).toMatchSnapshot();
|
||||
expect(component).toMatchSnapshot();
|
||||
});
|
||||
|
@ -41,7 +41,7 @@ exports[`PageTemplate rendering 1`] = `
|
||||
<a
|
||||
href="https://github.com/javallone/regexper-static"
|
||||
>
|
||||
mock SVG
|
||||
<Component />
|
||||
Source on GitHub
|
||||
</a>
|
||||
</li>
|
||||
@ -122,7 +122,7 @@ exports[`PageTemplate rendering with title 1`] = `
|
||||
<a
|
||||
href="https://github.com/javallone/regexper-static"
|
||||
>
|
||||
mock SVG
|
||||
<Component />
|
||||
Source on GitHub
|
||||
</a>
|
||||
</li>
|
||||
|
Loading…
Reference in New Issue
Block a user