Updating tests
This commit is contained in:
parent
3eb0689ff3
commit
f1a2dfdd34
@ -25,7 +25,19 @@ exports[`Index Page rendering 1`] = `
|
||||
<App
|
||||
expr=""
|
||||
permalinkUrl={null}
|
||||
syntax="js"
|
||||
syntax="testJs"
|
||||
syntaxList={
|
||||
Array [
|
||||
Object {
|
||||
"id": "testJS",
|
||||
"name": "Testing JS",
|
||||
},
|
||||
Object {
|
||||
"id": "other",
|
||||
"name": "Other",
|
||||
},
|
||||
]
|
||||
}
|
||||
/>
|
||||
</Fragment>
|
||||
`;
|
||||
@ -56,6 +68,18 @@ exports[`Index Page rendering with an expression on the URL 1`] = `
|
||||
expr="testing"
|
||||
permalinkUrl="http://example.com"
|
||||
syntax="test"
|
||||
syntaxList={
|
||||
Array [
|
||||
Object {
|
||||
"id": "testJS",
|
||||
"name": "Testing JS",
|
||||
},
|
||||
Object {
|
||||
"id": "other",
|
||||
"name": "Other",
|
||||
},
|
||||
]
|
||||
}
|
||||
/>
|
||||
</Fragment>
|
||||
`;
|
||||
|
@ -3,10 +3,22 @@ import { shallow } from 'enzyme';
|
||||
|
||||
import { IndexPage } from 'pages/index';
|
||||
|
||||
const queryResult = {
|
||||
site: {
|
||||
siteMetadata: {
|
||||
defaultSyntax: 'testJs',
|
||||
syntaxList: [
|
||||
{ id: 'testJS', name: 'Testing JS' },
|
||||
{ id: 'other', name: 'Other' }
|
||||
]
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
describe('Index Page', () => {
|
||||
test('rendering', () => {
|
||||
const component = shallow(
|
||||
<IndexPage location={{ hash: '' }} />
|
||||
<IndexPage location={{ hash: '' }} data={ queryResult } />
|
||||
);
|
||||
expect(component).toMatchSnapshot();
|
||||
});
|
||||
@ -16,7 +28,7 @@ describe('Index Page', () => {
|
||||
<IndexPage location={{
|
||||
hash: '#syntax=test&expr=testing',
|
||||
href: 'http://example.com'
|
||||
}} />
|
||||
}} data={ queryResult } />
|
||||
);
|
||||
expect(component).toMatchSnapshot();
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user