Skip to content

Instantly share code, notes, and snippets.

@azz0r
Last active October 24, 2017 15:56
Show Gist options
  • Save azz0r/e8c8a1fa4ae437d07b258cea49766dae to your computer and use it in GitHub Desktop.
Save azz0r/e8c8a1fa4ae437d07b258cea49766dae to your computer and use it in GitHub Desktop.
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