tor-browser

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

components_application_panel-ManifestUrlItem.test.js (840B)


      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 
     10 const ManifestUrlItem = createFactory(
     11  require("resource://devtools/client/application/src/components/manifest/ManifestUrlItem.js")
     12 );
     13 
     14 /*
     15 * Unit tests for the ManifestUrlItem component
     16 */
     17 
     18 describe("ManifestUrlItem", () => {
     19  it("renders the expected snapshot for a populated url", () => {
     20    const wrapper = shallow(
     21      ManifestUrlItem({ label: "foo" }, "https://example.com")
     22    );
     23    expect(wrapper).toMatchSnapshot();
     24  });
     25 
     26  it("renders the expected snapshot for an empty url", () => {
     27    const wrapper = shallow(ManifestUrlItem({ label: "foo" }));
     28    expect(wrapper).toMatchSnapshot();
     29  });
     30 });