diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
commit | 40a355a42d4a9444dc753c04c6608dade2f06a23 (patch) | |
tree | 871fc667d2de662f171103ce5ec067014ef85e61 /browser/components/aboutwelcome/tests/unit | |
parent | Adding upstream version 124.0.1. (diff) | |
download | firefox-40a355a42d4a9444dc753c04c6608dade2f06a23.tar.xz firefox-40a355a42d4a9444dc753c04c6608dade2f06a23.zip |
Adding upstream version 125.0.1.upstream/125.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'browser/components/aboutwelcome/tests/unit')
-rw-r--r-- | browser/components/aboutwelcome/tests/unit/MultiStageAWProton.test.jsx | 103 |
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()); + }); + }); }); |