components_application_panel-ManifestSection.test.js (1045B)
1 /* Any copyright is dedicated to the Public Domain. 2 http://creativecommons.org/publicdomain/zero/1.0/ */ 3 4 "use strict"; 5 6 // Import libs 7 const { shallow } = require("enzyme"); 8 const { createFactory } = require("react"); 9 const { 10 td, 11 tr, 12 } = require("resource://devtools/client/shared/vendor/react-dom-factories.js"); 13 14 const ManifestSection = createFactory( 15 require("resource://devtools/client/application/src/components/manifest/ManifestSection.js") 16 ); 17 18 /* 19 * Unit tests for the ManifestSection component 20 */ 21 22 describe("ManifestSection", () => { 23 it("renders the expected snapshot for a populated section", () => { 24 const content = tr({}, td({}, "foo")); 25 const wrapper = shallow(ManifestSection({ title: "Lorem ipsum" }, content)); 26 expect(wrapper).toMatchSnapshot(); 27 }); 28 29 it("renders the expected snapshot for a section with no children", () => { 30 const wrapper = shallow(ManifestSection({ title: "Lorem ipsum" })); 31 expect(wrapper).toMatchSnapshot(); 32 expect(wrapper.find(".manifest-section--empty")); 33 }); 34 });