Skip to content

Commit

Permalink
add tests to BoardList component
Browse files Browse the repository at this point in the history
  • Loading branch information
robisson committed Oct 13, 2018
1 parent 9dd867f commit 43c379c
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 2 deletions.
30 changes: 30 additions & 0 deletions src/client/components/Board/BoardList.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import React from "react";
import BoardList from "./BoardList";
import { createShallow } from "@material-ui/core/test-utils";
import Grid from '@material-ui/core/Grid';
import Typography from '@material-ui/core/Typography';

// setup file
import { configure } from "enzyme";
import Adapter from "enzyme-adapter-react-16";

configure({ adapter: new Adapter() });

describe("BoardList Component", () => {
let shallow;

beforeEach(() => {
shallow = createShallow();
});

it("should render a div", () => {
let wrapper = shallow(<BoardList />);
expect(wrapper.type()).toEqual("div");
});

it("should render 1 Typogragh and 2 Grid", () => {
let wrapper = shallow(<BoardList />);
expect(wrapper.find(Typography).length).toEqual(1);
expect(wrapper.find(Grid).length).toEqual(2);
});
});
4 changes: 2 additions & 2 deletions src/client/components/Board/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,6 @@ function LayoutApp(props: Props) {
);
}

const teste = withStyles(styles)(LayoutApp);
const Board = withStyles(styles)(LayoutApp);

export default teste;
export default Board;

0 comments on commit 43c379c

Please sign in to comment.