Commit f1a2dfdd authored by Jeff Avallone's avatar Jeff Avallone

Updating tests

parent 3eb0689f
Pipeline #43174314 (#45) passed with stages
in 4 minutes and 25 seconds
......@@ -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();
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment