From f1a2dfdd34e6e26805cd9ff9eea0336f0501c36d Mon Sep 17 00:00:00 2001 From: Jeff Avallone Date: Sun, 13 Jan 2019 11:56:07 -0500 Subject: [PATCH] Updating tests --- src/pages/__snapshots__/index.test.js.snap | 26 +++++++++++++++++++++- src/pages/index.test.js | 16 +++++++++++-- 2 files changed, 39 insertions(+), 3 deletions(-) diff --git a/src/pages/__snapshots__/index.test.js.snap b/src/pages/__snapshots__/index.test.js.snap index 1efe07c..3a71349 100644 --- a/src/pages/__snapshots__/index.test.js.snap +++ b/src/pages/__snapshots__/index.test.js.snap @@ -25,7 +25,19 @@ exports[`Index Page rendering 1`] = ` `; @@ -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", + }, + ] + } /> `; diff --git a/src/pages/index.test.js b/src/pages/index.test.js index b2e5179..e2f6f9f 100644 --- a/src/pages/index.test.js +++ b/src/pages/index.test.js @@ -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( - + ); expect(component).toMatchSnapshot(); }); @@ -16,7 +28,7 @@ describe('Index Page', () => { + }} data={ queryResult } /> ); expect(component).toMatchSnapshot(); });