Advertisement
Guest User

Untitled

a guest
Dec 16th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import React from "react";
  2.  
  3. import Page from "./Page.js";
  4.  
  5. const exampleLinkFactory = () => (
  6.   <a href={`#`} />
  7. );
  8.  
  9. describe("Pagination/Page", () => {
  10.   const defaultProps = { linkFactory: exampleLinkFactory };
  11.  
  12.   rendersComponent(Page, defaultProps);
  13.  
  14.   const wrapper = mount(
  15.     <Page { ...defaultProps } />
  16.   );
  17.  
  18.   it("renders a div with the guc-page class", () => {
  19.     expect(wrapper.find("div.guc-page").exists()).toEqual(true);
  20.   });
  21.  
  22.   it("renders the link generated by the linkFactory", () => {
  23.     expect(wrapper.html()).toContain(`<a href=\"#\"></a>`);
  24.  });
  25. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement