mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-26 12:20:56 +00:00
Bug 1766167 - AddonSitePermissionsList list should only be visible for sitepermission addon type. r=zombie
Differential Revision: https://phabricator.services.mozilla.com/D144523
This commit is contained in:
parent
2613268e81
commit
94b5004200
@ -2843,7 +2843,11 @@ class AddonDetails extends HTMLElement {
|
||||
|
||||
// Set the add-on for the sitepermissions section.
|
||||
this.sitePermissionsList = this.querySelector("addon-sitepermissions-list");
|
||||
this.sitePermissionsList.setAddon(addon);
|
||||
if (addon.type == "sitepermission") {
|
||||
this.sitePermissionsList.setAddon(addon);
|
||||
}
|
||||
this.querySelector(".addon-detail-sitepermissions").hidden =
|
||||
addon.type !== "sitepermission";
|
||||
|
||||
// Set the add-on for the preferences section.
|
||||
this.inlineOptions = this.querySelector("inline-options-browser");
|
||||
|
@ -510,6 +510,15 @@ add_task(async function testFullDetails() {
|
||||
"The full description replaces newlines with <br>"
|
||||
);
|
||||
|
||||
let sitepermissionsRow = details.querySelector(
|
||||
".addon-detail-sitepermissions"
|
||||
);
|
||||
is(
|
||||
sitepermissionsRow.hidden,
|
||||
true,
|
||||
"AddonSitePermissionsList should be hidden for this addon type"
|
||||
);
|
||||
|
||||
let contrib = details.querySelector(".addon-detail-contribute");
|
||||
ok(contrib, "The contribution section is visible");
|
||||
|
||||
@ -821,6 +830,13 @@ add_task(async function testSitePermission() {
|
||||
let rows = getDetailRows(card);
|
||||
is(rows.length, 4, "There are 4 rows");
|
||||
|
||||
let sitepermissionsRow = card.querySelector(".addon-detail-sitepermissions");
|
||||
is(
|
||||
sitepermissionsRow.hidden,
|
||||
false,
|
||||
"AddonSitePermissionsList should be visible for this addon type"
|
||||
);
|
||||
|
||||
// Automatic updates.
|
||||
let row = rows.shift();
|
||||
checkLabel(row, "updates");
|
||||
|
Loading…
x
Reference in New Issue
Block a user