summaryrefslogtreecommitdiffstats
path: root/devtools/client/application/test/node/components/manifest/components_application_panel-ManifestPage.test.js
diff options
context:
space:
mode:
Diffstat (limited to 'devtools/client/application/test/node/components/manifest/components_application_panel-ManifestPage.test.js')
-rw-r--r--devtools/client/application/test/node/components/manifest/components_application_panel-ManifestPage.test.js59
1 files changed, 59 insertions, 0 deletions
diff --git a/devtools/client/application/test/node/components/manifest/components_application_panel-ManifestPage.test.js b/devtools/client/application/test/node/components/manifest/components_application_panel-ManifestPage.test.js
new file mode 100644
index 0000000000..b479882924
--- /dev/null
+++ b/devtools/client/application/test/node/components/manifest/components_application_panel-ManifestPage.test.js
@@ -0,0 +1,59 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+// Import libs
+const { shallow } = require("enzyme");
+const { createFactory } = require("react");
+
+const {
+ setupStore,
+} = require("resource://devtools/client/application/test/node/helpers.js");
+const {
+ MANIFEST_SIMPLE,
+} = require("resource://devtools/client/application/test/node/fixtures/data/constants.js");
+
+const ManifestPage = createFactory(
+ require("resource://devtools/client/application/src/components/manifest/ManifestPage.js")
+);
+
+/**
+ * Test for ManifestPage.js component
+ */
+
+describe("ManifestPage", () => {
+ function buildStoreWithManifest(manifest, isLoading = false) {
+ return setupStore({
+ manifest: {
+ manifest,
+ errorMessage: "",
+ isLoading,
+ },
+ });
+ }
+
+ it("renders the expected snapshot when there is a manifest", () => {
+ const store = buildStoreWithManifest(MANIFEST_SIMPLE);
+ const wrapper = shallow(ManifestPage({ store })).dive();
+ expect(wrapper).toMatchSnapshot();
+ });
+
+ it("renders the expected snapshot when the manifest needs to load", () => {
+ const store = buildStoreWithManifest(undefined);
+ const wrapper = shallow(ManifestPage({ store })).dive();
+ expect(wrapper).toMatchSnapshot();
+ });
+
+ it("renders the expected snapshot when the manifest is loading", () => {
+ const store = buildStoreWithManifest(undefined, true);
+ const wrapper = shallow(ManifestPage({ store })).dive();
+ expect(wrapper).toMatchSnapshot();
+ });
+
+ it("renders the expected snapshot when there is no manifest", () => {
+ const store = buildStoreWithManifest(null);
+ const wrapper = shallow(ManifestPage({ store })).dive();
+ expect(wrapper).toMatchSnapshot();
+ });
+});