Bug 1945639 - Adding Solo to More from Mozilla - Add card r=settings-reviewers,desktop-theme-reviewers,omc-reviewers,Gijs,dao,pdahiya,jprickett
Differential Revision: https://phabricator.services.mozilla.com/D236377
This commit is contained in:
@@ -157,6 +157,18 @@ var gMoreFromMozillaPane = {
|
||||
products.push(relay);
|
||||
}
|
||||
|
||||
products.push({
|
||||
id: "solo-ai",
|
||||
title_string_id: "more-from-moz-solo-title",
|
||||
description_string_id: "more-from-moz-solo-description",
|
||||
region: "global",
|
||||
button: {
|
||||
id: "soloAI",
|
||||
label_string_id: "more-from-moz-solo-button",
|
||||
actionURL: "https://soloist.ai/?utm_type=more_from_mozilla",
|
||||
},
|
||||
});
|
||||
|
||||
this._productsContainer = document.getElementById(
|
||||
"moreFromMozillaCategory"
|
||||
);
|
||||
|
||||
@@ -11,7 +11,7 @@ let { TelemetryTestUtils } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/TelemetryTestUtils.sys.mjs"
|
||||
);
|
||||
|
||||
const TOTAL_PROMO_CARDS_COUNT = 4;
|
||||
const TOTAL_PROMO_CARDS_COUNT = 5;
|
||||
|
||||
async function clearPolicies() {
|
||||
// Ensure no active policies are set
|
||||
@@ -392,3 +392,30 @@ add_task(async function test_aboutpreferences_clickBtnRelay() {
|
||||
BrowserTestUtils.removeTab(gBrowser.selectedTab);
|
||||
BrowserTestUtils.removeTab(tab);
|
||||
});
|
||||
|
||||
add_task(async function show_solo_more_from_mozilla() {
|
||||
await clearPolicies();
|
||||
await SpecialPowers.pushPrefEnv({
|
||||
set: [
|
||||
["browser.preferences.moreFromMozilla", true],
|
||||
["browser.preferences.moreFromMozilla.template", "simple"],
|
||||
],
|
||||
});
|
||||
await openPreferencesViaOpenPreferencesAPI("paneMoreFromMozilla", {
|
||||
leaveOpen: true,
|
||||
});
|
||||
|
||||
let doc = gBrowser.contentDocument;
|
||||
let tab = gBrowser.selectedTab;
|
||||
|
||||
const soloCard = doc.getElementById("solo-ai");
|
||||
let soloBtn = doc.getElementById("simple-soloAI");
|
||||
|
||||
Assert.ok(BrowserTestUtils.isVisible(soloCard), "Solo card is shown");
|
||||
Assert.ok(
|
||||
BrowserTestUtils.isVisible(soloBtn),
|
||||
"Solo button rendered on page"
|
||||
);
|
||||
|
||||
BrowserTestUtils.removeTab(tab);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user