Skip to content

Instantly share code, notes, and snippets.

@reime005
Created September 8, 2019 20:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save reime005/47800b2daab1a1fb38a4a0e7e8051637 to your computer and use it in GitHub Desktop.
Save reime005/47800b2daab1a1fb38a4a0e7e8051637 to your computer and use it in GitHub Desktop.
/* src/store/__tests__/ui.test.js */
import React from "react";
import Enzyme, { shallow } from "enzyme";
import Adapter from "enzyme-adapter-react-16";
import { Home } from "../../Home";
Enzyme.configure({ adapter: new Adapter() });
it('should display counter value "42"', () => {
const app = shallow(<Home counter={42} />);
const counter = app.find({ id: "testCounter" });
expect(counter.text()).toEqual("42");
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment