tor-browser

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

components_application_panel-ManifestIssue.test.js (882B)


      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 ManifestIssue = createFactory(
     11  require("resource://devtools/client/application/src/components/manifest/ManifestIssue.js")
     12 );
     13 
     14 /*
     15 * Tests for the ManifestIssue component
     16 */
     17 
     18 describe("ManifestIssue", () => {
     19  it("renders the expected snapshot for a warning", () => {
     20    const issue = { level: "warning", message: "Lorem ipsum" };
     21    const wrapper = shallow(ManifestIssue(issue));
     22    expect(wrapper).toMatchSnapshot();
     23  });
     24 
     25  it("renders the expected snapshot for an error", () => {
     26    const issue = { level: "error", message: "Lorem ipsum" };
     27    const wrapper = shallow(ManifestIssue(issue));
     28    expect(wrapper).toMatchSnapshot();
     29  });
     30 });