From 02784279cc98c2a94af90dfa1d96c06fd5177276 Mon Sep 17 00:00:00 2001 From: Jeason Centaure Date: Tue, 16 Jan 2018 11:42:16 +0100 Subject: [PATCH] feat(React): Add a Home Component --- pages/Home.js | 10 ++++++++++ pages/index.js | 7 ++++++- pages/index.test.js | 5 +++-- 3 files changed, 19 insertions(+), 3 deletions(-) create mode 100644 pages/Home.js diff --git a/pages/Home.js b/pages/Home.js new file mode 100644 index 0000000..6c2d967 --- /dev/null +++ b/pages/Home.js @@ -0,0 +1,10 @@ +import React from 'react' + +const Home = () => ( +
+

React Quizz

+ +
+) + +export default Home diff --git a/pages/index.js b/pages/index.js index 0643860..d025d1d 100644 --- a/pages/index.js +++ b/pages/index.js @@ -1 +1,6 @@ -export default () => 'Hello world!' +import React from 'react' +import Home from './Home' + +const firstComp = () => + +export default firstComp diff --git a/pages/index.test.js b/pages/index.test.js index 1708ab2..8322bf1 100644 --- a/pages/index.test.js +++ b/pages/index.test.js @@ -1,10 +1,11 @@ import React from 'react' import { shallow } from 'enzyme' +import Home from './Home' import Index from './index' describe('Index', () => { - it('should display "Hello world!"', () => { + it('should render the HomeComponent', () => { const wrapper = shallow() - expect(wrapper.equals('Hello world!')).toBe(true) + expect(wrapper.contains()).toBe(true) }) })