diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:34:50 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:34:50 +0000 |
commit | def92d1b8e9d373e2f6f27c366d578d97d8960c6 (patch) | |
tree | 2ef34b9ad8bb9a9220e05d60352558b15f513894 /browser/components/aboutwelcome/tests/unit | |
parent | Adding debian version 125.0.3-1. (diff) | |
download | firefox-def92d1b8e9d373e2f6f27c366d578d97d8960c6.tar.xz firefox-def92d1b8e9d373e2f6f27c366d578d97d8960c6.zip |
Merging upstream version 126.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'browser/components/aboutwelcome/tests/unit')
3 files changed, 96 insertions, 7 deletions
diff --git a/browser/components/aboutwelcome/tests/unit/MultiStageAWProton.test.jsx b/browser/components/aboutwelcome/tests/unit/MultiStageAWProton.test.jsx index 9b452d5c6b..ed0260bf30 100644 --- a/browser/components/aboutwelcome/tests/unit/MultiStageAWProton.test.jsx +++ b/browser/components/aboutwelcome/tests/unit/MultiStageAWProton.test.jsx @@ -671,4 +671,27 @@ describe("MultiStageAboutWelcomeProton module", () => { assert.isTrue(wrapper.find("migration-wizard").exists()); }); }); + + describe("Custom main content inner custom justify content", () => { + const SCREEN_PROPS = { + content: { + title: "test title", + position: "split", + split_content_justify_content: "flex-start", + }, + }; + + it("should render split screen with custom justify-content", async () => { + const wrapper = mount(<MultiStageProtonScreen {...SCREEN_PROPS} />); + assert.ok(wrapper.exists()); + assert.equal(wrapper.find("main").prop("pos"), "split"); + assert.exists(wrapper.find(".main-content-inner")); + assert.ok( + wrapper + .find(".main-content-inner") + .prop("style") + .justifyContent.includes("flex-start") + ); + }); + }); }); diff --git a/browser/components/aboutwelcome/tests/unit/MultiStageAboutWelcome.test.jsx b/browser/components/aboutwelcome/tests/unit/MultiStageAboutWelcome.test.jsx index b4593a45f3..2fb897125d 100644 --- a/browser/components/aboutwelcome/tests/unit/MultiStageAboutWelcome.test.jsx +++ b/browser/components/aboutwelcome/tests/unit/MultiStageAboutWelcome.test.jsx @@ -383,6 +383,72 @@ describe("MultiStageAboutWelcome module", () => { ); }); }); + + describe("Wallpaper screen", () => { + let WALLPAPER_SCREEN_PROPS; + beforeEach(() => { + WALLPAPER_SCREEN_PROPS = { + content: { + title: "test title", + subtitle: "test subtitle", + tiles: { + type: "theme", + category: { + type: "wallpaper", + action: { + type: "MULTI_ACTION", + data: { + actions: [ + { + type: "SET_PREF", + data: { + pref: { + name: "test-dark", + }, + }, + }, + { + type: "SET_PREF", + data: { + pref: { + name: "test-light", + }, + }, + }, + ], + }, + }, + }, + action: { + theme: "<event>", + }, + data: [ + { + theme: "mountain", + type: "light", + }, + ], + }, + primary_button: { + action: {}, + label: "test button", + }, + }, + navigate: sandbox.stub(), + setActiveTheme: sandbox.stub(), + }; + sandbox.stub(AboutWelcomeUtils, "handleUserAction").resolves(); + }); + it("should handle wallpaper click", () => { + const wrapper = mount(<WelcomeScreen {...WALLPAPER_SCREEN_PROPS} />); + const wallpaperOptions = wrapper.find( + ".tiles-theme-section .theme input[name='mountain']" + ); + wallpaperOptions.simulate("click"); + assert.calledTwice(AboutWelcomeUtils.handleUserAction); + }); + }); + describe("#handleAction", () => { let SCREEN_PROPS; let TEST_ACTION; diff --git a/browser/components/aboutwelcome/tests/unit/unit-entry.js b/browser/components/aboutwelcome/tests/unit/unit-entry.js index fb70eeb843..3da6964c53 100644 --- a/browser/components/aboutwelcome/tests/unit/unit-entry.js +++ b/browser/components/aboutwelcome/tests/unit/unit-entry.js @@ -97,8 +97,8 @@ const TEST_GLOBAL = { JSWindowActorParent, JSWindowActorChild, AboutReaderParent: { - addMessageListener: (messageName, listener) => {}, - removeMessageListener: (messageName, listener) => {}, + addMessageListener: (_messageName, _listener) => {}, + removeMessageListener: (_messageName, _listener) => {}, }, AboutWelcomeTelemetry: class { submitGleanPingForPing() {} @@ -281,8 +281,8 @@ const TEST_GLOBAL = { }, dump() {}, EveryWindow: { - registerCallback: (id, init, uninit) => {}, - unregisterCallback: id => {}, + registerCallback: (_id, _init, _uninit) => {}, + unregisterCallback: _id => {}, }, setTimeout: window.setTimeout.bind(window), clearTimeout: window.clearTimeout.bind(window), @@ -402,7 +402,7 @@ const TEST_GLOBAL = { }, urlFormatter: { formatURL: str => str, formatURLPref: str => str }, mm: { - addMessageListener: (msg, cb) => this.receiveMessage(), + addMessageListener: (_msg, _cb) => this.receiveMessage(), removeMessageListener() {}, }, obs: { @@ -412,7 +412,7 @@ const TEST_GLOBAL = { }, telemetry: { setEventRecordingEnabled: () => {}, - recordEvent: eventDetails => {}, + recordEvent: _eventDetails => {}, scalarSet: () => {}, keyedScalarAdd: () => {}, }, @@ -570,7 +570,7 @@ const TEST_GLOBAL = { finish: () => {}, }, Sampling: { - ratioSample(seed, ratios) { + ratioSample(_seed, _ratios) { return Promise.resolve(0); }, }, |