Last active
October 24, 2017 15:56
-
-
Save azz0r/e8c8a1fa4ae437d07b258cea49766dae to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { expect } from 'chai'; | |
import shallow from 'react-test-renderer/shallow'; | |
import sinon from 'sinon'; | |
import Page from '../src/pages/dashboard/dashboard'; | |
import HeaderOne from '../src/components/h1/h1'; | |
import Ranking from '../src/components/ranking/ranking'; | |
import Wrestlers from "./wrestlers.json" | |
const STYLE = { | |
color: "red", | |
backgroundColor: "orange" | |
} | |
const PROPS = { | |
style: STYLE, | |
expensiveWrestlers: Wrestlers, | |
cheapWrestlers: Wrestlers, | |
rankedMaleWrestlers: Wrestlers, | |
rankedFemaleWrestlers: Wrestlers, | |
} | |
const render = (props) => shallow(<Page { ...props } />) | |
describe('Given a dashboard page', function () { | |
describe('and the page has been rendered', function () { | |
let component; | |
beforeEach(component = render(PROPS)); | |
it('should render an HeaderOne component', function () { | |
expect(HeaderOne).to.have.length(1); | |
}); | |
it('should render an Ranking component', function () { | |
expect(Ranking).to.have.length(4); | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment