feat: remove portfolio and add conditional intro

This commit is contained in:
Ahmad Abdolsaheb
2019-10-22 13:38:19 +03:00
committed by Mrugesh Mohapatra
parent 3483a04ba1
commit 2352c0b1d9
14 changed files with 272 additions and 252 deletions

View File

@@ -0,0 +1,42 @@
/* global expect */
import React from 'react';
import renderer from 'react-test-renderer';
// import ShallowRenderer from 'react-test-renderer/shallow';
import 'jest-dom/extend-expect';
import Intro from './';
describe('<Intro />', () => {
it('has no blockquotes when loggedOut', () => {
const container = renderer.create(<Intro {...loggedOutProps} />).root;
expect(container.findAllByType('blockquote').length === 0).toBeTruthy();
expect(container.findAllByType('h1').length === 1).toBeTruthy();
});
it('has a blockquote when loggedIn', () => {
const container = renderer.create(<Intro {...loggedInProps} />).root;
expect(container.findAllByType('blockquote').length === 1).toBeTruthy();
expect(container.findAllByType('h1').length === 1).toBeTruthy();
});
});
const loggedInProps = {
complete: true,
isSignedIn: true,
name: 'Developement User',
navigate: () => {},
pending: false,
slug: '/',
username: 'DevelopmentUser'
};
const loggedOutProps = {
complete: true,
isSignedIn: false,
name: '',
navigate: () => {},
pending: false,
slug: '/',
username: ''
};