forked from mozilla/gecko-dev
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1733632 - Update colorways section in about:addons to be a 3x6 gr…
…id. r=harry,mstriemer a=RyanVM Differential Revision: https://phabricator.services.mozilla.com/D127504
- Loading branch information
1 parent
3289766
commit 5bed092
Showing
3 changed files
with
79 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,8 +23,7 @@ add_task(async function testMonochromaticList() { | |
let doc = win.document; | ||
|
||
// Wait for the colorway themes list to render. | ||
let colorwayList = doc.querySelector("section[section='2']"); | ||
await colorwayList.cardsReady; | ||
let colorwayList = doc.querySelector(".monochromatic-addon-list"); | ||
await themeAddon.disable(); | ||
|
||
// Check that all the cards are visible. | ||
|
@@ -47,10 +46,10 @@ add_task(async function testMonochromaticList() { | |
is( | ||
subheading.getAttribute("data-l10n-id"), | ||
"theme-monochromatic-subheading", | ||
"Header string is correct." | ||
"Subheader string is correct." | ||
); | ||
|
||
// Check that an enabled theme moves to the enabled section & out of the colorways section. | ||
// Check that the test theme is in the colorways section. | ||
let card = colorwayList.querySelector( | ||
"addon-card[addon-id='[email protected]']" | ||
); | ||
|
@@ -60,45 +59,36 @@ add_task(async function testMonochromaticList() { | |
"Colorways section contains monochromatic theme" | ||
); | ||
|
||
// Check that the test theme is in the enabled section. | ||
let addon = await AddonManager.getAddonByID("[email protected]"); | ||
await addon.enable(); | ||
let enabledSection = doc.querySelector("section[section='0']"); | ||
|
||
// After enabling the theme the card will not move to the appropriate section until a mousemove. | ||
let mutationPromise = BrowserTestUtils.waitForMutationCondition( | ||
enabledSection, | ||
{ childList: true }, | ||
() => enabledSection.contains(card) | ||
() => | ||
enabledSection.children.length > 1 && | ||
enabledSection.children[1].getAttribute("addon-id") == | ||
"[email protected]" | ||
); | ||
|
||
await EventUtils.synthesizeMouseAtCenter(heading, { type: "mousemove" }, win); | ||
await addon.enable(); | ||
await mutationPromise; | ||
|
||
ok( | ||
enabledSection.contains(card), | ||
"Enabled section contains enabled colorway theme" | ||
let enabledCard = enabledSection.querySelector( | ||
"addon-card[addon-id='[email protected]']" | ||
); | ||
|
||
ok( | ||
!colorwayList.contains(card), | ||
"Colorway section no longer contains enabled theme" | ||
enabledSection.contains(enabledCard), | ||
"Enabled section contains enabled colorway theme" | ||
); | ||
|
||
// // Check that disabling a theme moves it back to the colorways section. | ||
// Check that disabling a theme removes it from the enabled section. | ||
await addon.disable(); | ||
|
||
// After disabling a theme the card will not move to the appropriate section until a mousemove. | ||
mutationPromise = BrowserTestUtils.waitForMutationCondition( | ||
colorwayList, | ||
enabledSection, | ||
{ childList: true }, | ||
() => colorwayList.contains(card) | ||
() => !enabledSection.contains(enabledCard) | ||
); | ||
|
||
await EventUtils.synthesizeMouseAtCenter( | ||
subheading, | ||
{ type: "mousemove" }, | ||
win | ||
); | ||
await mutationPromise; | ||
|
||
ok( | ||
|