Files
sousa-gecko/browser/components/customizableui/test/browser_novaHelpSwitchDevicePromo.js
T
Nikki Sharpley 16e8802bf5 Bug 2023763 - Nova styles for application menu r=mstriemer,fluent-reviewers,desktop-theme-reviewers,ini,bolsson
- switched to moz-button for sign in
- the "zap" gradient under the account menu item is different
- new colored box with new styling for update message and the "switching to a new device" menu item under "Help"

You can see these changes by visiting the application menu, and navigating to Help for the last point

Differential Revision: https://phabricator.services.mozilla.com/D303488
2026-06-15 16:46:47 +00:00

77 lines
2.3 KiB
JavaScript

/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
add_setup(async function () {
await SpecialPowers.pushPrefEnv({ set: [["browser.nova.enabled", true]] });
});
registerCleanupFunction(async function () {
await SpecialPowers.popPrefEnv();
});
async function openHelpView() {
await gCUITestUtils.openMainMenu();
PanelUI.showHelpView(document.getElementById("PanelUI-menu-button"));
let helpView = document.getElementById("PanelUI-helpView");
await BrowserTestUtils.waitForEvent(helpView, "ViewShowing");
return helpView;
}
add_task(async function testNovaPromoReplacesHelpSwitchDevice() {
let helpView = await openHelpView();
ok(
!helpView.querySelector("#appMenu_helpSwitchDevice"),
"appMenu_helpSwitchDevice should not be present when nova is enabled"
);
let promo = helpView.querySelector("#appMenu-nova-switch-device-promo");
ok(promo, "Nova switch device promo should be present when nova is enabled");
await gCUITestUtils.hideMainMenu();
});
add_task(async function testSwitchDeviceButtonPresentWithoutNova() {
await SpecialPowers.pushPrefEnv({ set: [["browser.nova.enabled", false]] });
let helpView = await openHelpView();
ok(
helpView.querySelector("#appMenu_helpSwitchDevice"),
"appMenu_helpSwitchDevice should be present when nova is disabled"
);
ok(
!helpView.querySelector("#appMenu-nova-switch-device-promo"),
"Nova switch device promo should not be present when nova is disabled"
);
await gCUITestUtils.hideMainMenu();
await SpecialPowers.popPrefEnv();
});
add_task(
async function testNovaPromoSupportLinkCallsOpenSwitchingDevicesPage() {
let switchingDevicesPageOpened = false;
let originalFn = window.openSwitchingDevicesPage;
window.openSwitchingDevicesPage = () => {
switchingDevicesPageOpened = true;
};
let helpView = await openHelpView();
let link = helpView.querySelector("#appMenu-nova-switch-device-link");
ok(link, "Nova switch device support link should exist");
link.click();
ok(
switchingDevicesPageOpened,
"openSwitchingDevicesPage should be called when the support link is clicked"
);
window.openSwitchingDevicesPage = originalFn;
await gCUITestUtils.hideMainMenu();
}
);