Bug 1639980 - Hide Pocket saved pages if Pocket is disabled. r=Mardak

Differential Revision: https://phabricator.services.mozilla.com/D79750
This commit is contained in:
Michael Kaply 2020-06-17 17:22:20 +00:00
Родитель cce0439cc1
Коммит 7571dc2667
3 изменённых файлов: 12 добавлений и 0 удалений

Просмотреть файл

@ -245,6 +245,7 @@ this.AboutPreferences = class AboutPreferences {
linkPref(subcheck, nested.name, "bool");
subChecks.push(subcheck);
subcheck.disabled = !pref._value;
subcheck.hidden = nested.hidden;
});
// Disable any nested checkboxes if the parent pref is not enabled.

Просмотреть файл

@ -111,6 +111,10 @@ const BUILT_IN_SECTIONS = {
{
name: "section.highlights.includePocket",
titleString: "home-prefs-highlights-option-saved-to-pocket",
hidden: !Services.prefs.getBoolPref(
"extensions.pocket.enabled",
true
),
},
],
},

Просмотреть файл

@ -305,6 +305,13 @@ describe("AboutPreferences Feed", () => {
assert.calledWith(node.setAttribute, "data-l10n-id", titleString);
});
it("should set node hidden to true", () => {
prefStructure[0].pref.nestedPrefs[0].hidden = true;
testRender();
assert.isTrue(node.hidden);
});
it("should add a change event", () => {
testRender();