Skip to content

Commit dddcdbb

Browse files
committed
Align account left accordion colors with center page treatment - PR_26163_057-account-aside-color-alignment
1 parent 749a720 commit dddcdbb

2 files changed

Lines changed: 41 additions & 2 deletions

File tree

assets/theme-v2/partials/account-side-nav.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<aside class="side-menu tool-column tool-group-platform" aria-label="Account pages" data-account-side-nav>
1+
<aside class="side-menu tool-column" aria-label="Account pages" data-account-side-nav>
22
<div class="tool-column-header">
33
<h2>Account</h2>
44
</div>

tests/playwright/tools/InputMappingV2Tool.spec.mjs

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1038,7 +1038,7 @@ test("Account navigation exposes User Controls in sorted browseable menus", asyn
10381038
});
10391039
expect(sideNavStructure).toEqual(expect.objectContaining({
10401040
ariaLabel: "Account pages",
1041-
classes: expect.arrayContaining(["side-menu", "tool-column", "tool-group-platform"]),
1041+
classes: expect.arrayContaining(["side-menu", "tool-column"]),
10421042
dataAttribute: "",
10431043
directAccordionCount: 2,
10441044
headerText: "Account",
@@ -1047,6 +1047,45 @@ test("Account navigation exposes User Controls in sorted browseable menus", asyn
10471047
stackTagName: "div",
10481048
tagName: "aside",
10491049
}));
1050+
expect(sideNavStructure.classes).not.toContain("tool-group-platform");
1051+
const accountColorTreatment = await page.locator(".account-panel").evaluate((panel) => {
1052+
const aside = panel.querySelector("[data-account-side-nav]");
1053+
const centerCard = panel.querySelector(":scope > .card");
1054+
const summary = aside?.querySelector("details.vertical-accordion summary");
1055+
const toggle = aside?.querySelector("[data-account-side-nav-collapse]");
1056+
const headerTitle = aside?.querySelector(".tool-column-header h2");
1057+
const asideStyles = aside ? getComputedStyle(aside) : null;
1058+
const centerStyles = centerCard ? getComputedStyle(centerCard) : null;
1059+
const summaryStyles = summary ? getComputedStyle(summary) : null;
1060+
const toggleStyles = toggle ? getComputedStyle(toggle) : null;
1061+
const headerTitleStyles = headerTitle ? getComputedStyle(headerTitle) : null;
1062+
return asideStyles && centerStyles && summaryStyles && toggleStyles && headerTitleStyles
1063+
? {
1064+
asideBackgroundImage: asideStyles.backgroundImage,
1065+
asideBorderColor: asideStyles.borderTopColor,
1066+
centerBackgroundImage: centerStyles.backgroundImage,
1067+
centerBorderColor: centerStyles.borderTopColor,
1068+
centerTextColor: centerStyles.color,
1069+
headerTitleColor: headerTitleStyles.color,
1070+
summaryColor: summaryStyles.color,
1071+
toggleColor: toggleStyles.color,
1072+
}
1073+
: null;
1074+
});
1075+
expect(accountColorTreatment).toEqual(expect.objectContaining({
1076+
asideBackgroundImage: expect.any(String),
1077+
asideBorderColor: expect.any(String),
1078+
centerBackgroundImage: expect.any(String),
1079+
centerBorderColor: expect.any(String),
1080+
centerTextColor: expect.any(String),
1081+
headerTitleColor: expect.any(String),
1082+
summaryColor: expect.any(String),
1083+
toggleColor: expect.any(String),
1084+
}));
1085+
expect(accountColorTreatment.asideBackgroundImage).toBe(accountColorTreatment.centerBackgroundImage);
1086+
expect(accountColorTreatment.asideBorderColor).toBe(accountColorTreatment.centerBorderColor);
1087+
expect(accountColorTreatment.summaryColor).toBe(accountColorTreatment.centerTextColor);
1088+
expect(accountColorTreatment.toggleColor).toBe(accountColorTreatment.headerTitleColor);
10501089
const collapseButton = page.locator("[data-account-side-nav-collapse]");
10511090
await expect(collapseButton).toBeVisible();
10521091
await expect(collapseButton).toHaveClass(/horizontal-accordion-toggle--left/);

0 commit comments

Comments
 (0)