SectionTitle.test.jsx (610B)
1 import React from "react"; 2 import { SectionTitle } from "content-src/components/DiscoveryStreamComponents/SectionTitle/SectionTitle"; 3 import { shallow } from "enzyme"; 4 5 describe("<SectionTitle>", () => { 6 let wrapper; 7 8 beforeEach(() => { 9 wrapper = shallow(<SectionTitle header={{}} />); 10 }); 11 12 it("should render", () => { 13 assert.ok(wrapper.exists()); 14 assert.ok(wrapper.find(".ds-section-title").exists()); 15 }); 16 17 it("should render a subtitle", () => { 18 wrapper.setProps({ header: { title: "Foo", subtitle: "Bar" } }); 19 20 assert.equal(wrapper.find(".subtitle").text(), "Bar"); 21 }); 22 });