summaryrefslogtreecommitdiffstats
path: root/browser/components/aboutwelcome/tests/unit/MultiStageAWProton.test.jsx
diff options
context:
space:
mode:
Diffstat (limited to 'browser/components/aboutwelcome/tests/unit/MultiStageAWProton.test.jsx')
-rw-r--r--browser/components/aboutwelcome/tests/unit/MultiStageAWProton.test.jsx103
1 files changed, 103 insertions, 0 deletions
diff --git a/browser/components/aboutwelcome/tests/unit/MultiStageAWProton.test.jsx b/browser/components/aboutwelcome/tests/unit/MultiStageAWProton.test.jsx
index a40af1c4a1..9b452d5c6b 100644
--- a/browser/components/aboutwelcome/tests/unit/MultiStageAWProton.test.jsx
+++ b/browser/components/aboutwelcome/tests/unit/MultiStageAWProton.test.jsx
@@ -385,6 +385,92 @@ describe("MultiStageAboutWelcomeProton module", () => {
assert.equal(textEl.at(0).prop("data-l10n-id"), "test-string-id");
assert.equal(textEl.at(1).prop("data-l10n-id"), "test-string-id-2");
});
+
+ it("should render above_button_content legal copy with MultiSelect tile", async () => {
+ const SCREEN_PROPS = {
+ content: {
+ tiles: {
+ type: "multiselect",
+ label: "Test Subtitle",
+ data: [
+ {
+ id: "checkbox-1",
+ type: "checkbox",
+ defaultValue: false,
+ label: { raw: "Checkbox 1" },
+ },
+ ],
+ },
+ above_button_content: [
+ {
+ type: "text",
+ text: {
+ string_id: "test-string-id",
+ },
+ font_styles: "legal",
+ link_keys: ["privacy_policy", "terms_of_use"],
+ },
+ ],
+ },
+ setScreenMultiSelects: sandbox.stub(),
+ setActiveMultiSelect: sandbox.stub(),
+ };
+
+ const wrapper = mount(<MultiStageProtonScreen {...SCREEN_PROPS} />);
+ assert.ok(wrapper.exists());
+ const legalText = wrapper.find(".legal-paragraph");
+ assert.equal(legalText.exists(), true);
+
+ const multiSelectContainer = wrapper.find(".multi-select-container");
+ assert.equal(multiSelectContainer.exists(), true);
+
+ sandbox.restore();
+ });
+
+ it("should not have no-rdm property when property is not in message content", () => {
+ const SCREEN_PROPS = {
+ content: {
+ title: "test title",
+ layout: "inline",
+ },
+ };
+ const wrapper = mount(<MultiStageProtonScreen {...SCREEN_PROPS} />);
+ assert.ok(wrapper.exists());
+ assert.notExists(wrapper.find("main").prop("no-rdm"));
+ });
+
+ it("should have no-rdm property when property is set in message content", () => {
+ const SCREEN_PROPS = {
+ content: {
+ title: "test title",
+ layout: "inline",
+ no_rdm: true,
+ },
+ };
+ const wrapper = mount(<MultiStageProtonScreen {...SCREEN_PROPS} />);
+ assert.ok(wrapper.exists());
+ assert.exists(wrapper.find("main").prop("no-rdm"));
+ });
+
+ it("should correctly set reverse-split prop", () => {
+ const SCREEN_PROPS = {
+ content: {
+ position: "split",
+ reverse_split: true,
+ title: "test title",
+ primary_button: {
+ label: "test primary button",
+ },
+ additional_button: {
+ label: "test additional button",
+ style: "link",
+ },
+ },
+ };
+ const wrapper = mount(<MultiStageProtonScreen {...SCREEN_PROPS} />);
+ assert.ok(wrapper.exists());
+ assert.equal(wrapper.find("main").prop("reverse-split"), "");
+ });
});
describe("AboutWelcomeDefaults for proton", () => {
@@ -568,4 +654,21 @@ describe("MultiStageAboutWelcomeProton module", () => {
);
});
});
+
+ describe("Embedded Migration Wizard", () => {
+ const SCREEN_PROPS = {
+ content: {
+ title: "test title",
+ tiles: {
+ type: "migration-wizard",
+ },
+ },
+ };
+
+ it("should render migration wizard", async () => {
+ const wrapper = mount(<MultiStageProtonScreen {...SCREEN_PROPS} />);
+ assert.ok(wrapper.exists());
+ assert.isTrue(wrapper.find("migration-wizard").exists());
+ });
+ });
});