tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

MoreRecommendations.test.jsx (897B)


      1 import { MoreRecommendations } from "content-src/components/MoreRecommendations/MoreRecommendations";
      2 import React from "react";
      3 import { shallow } from "enzyme";
      4 
      5 describe("<MoreRecommendations>", () => {
      6  it("should render a MoreRecommendations element", () => {
      7    const wrapper = shallow(<MoreRecommendations />);
      8    assert.ok(wrapper.exists());
      9  });
     10  it("should render a link when provided with read_more_endpoint prop", () => {
     11    const wrapper = shallow(
     12      <MoreRecommendations read_more_endpoint="https://endpoint.com" />
     13    );
     14 
     15    const link = wrapper.find(".more-recommendations");
     16    assert.lengthOf(link, 1);
     17  });
     18  it("should not render a link when provided with read_more_endpoint prop", () => {
     19    const wrapper = shallow(<MoreRecommendations read_more_endpoint="" />);
     20 
     21    const link = wrapper.find(".more-recommendations");
     22    assert.lengthOf(link, 0);
     23  });
     24 });