Skip to content

Commit 991ddbe

Browse files
authored
fix: add Continuum E2Es for B2B My Company (#20341)
1 parent ab177a9 commit 991ddbe

15 files changed

+632
-4
lines changed

feature-libs/organization/account-summary/components/details/document/account-summary-document.component.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ <h2 id="regionTitle">
1313
[documentTypeOptions]="documentTypeOptions"
1414
[initialFilters]="_queryParams"
1515
(filterListEvent)="filterChange($event)"
16+
[cxNgSelectA11yAriaControls]="
17+
(accountSummary.orgDocuments ?? []).length > 0
18+
? 'cx-account-summary-document-table'
19+
: undefined
20+
"
1621
>
1722
</cx-account-summary-document-filter>
1823

feature-libs/organization/account-summary/components/details/document/filter/account-summary-document-filter.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@
108108
bindValue="code"
109109
[cxNgSelectA11y]="{
110110
ariaLabel: 'orgAccountSummary.filter.status' | cxTranslate,
111-
ariaControls: 'cx-account-summary-document-table',
111+
ariaControls: cxNgSelectA11yAriaControls,
112112
}"
113113
>
114114
</ng-select>
@@ -139,7 +139,7 @@
139139
bindValue="code"
140140
[cxNgSelectA11y]="{
141141
ariaLabel: 'orgAccountSummary.filter.filterBy' | cxTranslate,
142-
ariaControls: 'cx-account-summary-document-table',
142+
ariaControls: cxNgSelectA11yAriaControls,
143143
}"
144144
>
145145
</ng-select>

feature-libs/organization/account-summary/components/details/document/filter/account-summary-document-filter.component.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ interface GroupValidator {
5252
export class AccountSummaryDocumentFilterComponent
5353
implements OnInit, OnDestroy
5454
{
55+
@Input()
56+
cxNgSelectA11yAriaControls?: string;
57+
5558
@Input()
5659
documentTypeOptions: Array<AccountSummaryDocumentType>;
5760

feature-libs/organization/administration/components/shared/card/card.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ <h4>
6060
</div>
6161

6262
<div class="main">
63-
<cx-org-message aria-aromic="true" aria-live="assertive"></cx-org-message>
63+
<cx-org-message aria-live="assertive"></cx-org-message>
6464
<ng-content select="[info]"></ng-content>
6565
<ng-content select="[main]"></ng-content>
6666
</div>

feature-libs/organization/administration/components/unit/details/unit-details.component.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@
6464
<label>{{ 'orgUnit.parentUnit' | cxTranslate }}</label>
6565
<a
6666
class="value"
67+
[ariaLabel]="
68+
model.parentOrgUnit?.name ?? ('orgUnit.parentUnit' | cxTranslate)
69+
"
6770
[routerLink]="
6871
{
6972
cxRoute: 'orgUnitDetails',

feature-libs/organization/administration/components/user/change-password-form/user-change-password-form.component.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<form *ngIf="form$ | async as form" [formGroup]="form" (submit)="save(form)">
2-
<cx-form-required-legend />
32
<cx-org-card
43
[previous]="false"
54
i18nRoot="orgUser.password"
@@ -18,6 +17,8 @@
1817
</button>
1918

2019
<section main class="details">
20+
<cx-form-required-legend />
21+
2122
<label class="full-width">
2223
<span class="label-content"
2324
>{{ 'orgUser.password.newPassword' | cxTranslate }}

feature-libs/organization/administration/components/user/details-cell/user-details-cell.component.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@
6767

6868
<button
6969
class="button btn btn-sm text"
70+
ariaLabel="{model?.name ?? ('orgUser.name' | cxTranslate)}"
7071
[cxPopover]="details"
7172
[cxPopoverOptions]="{
7273
placement: 'auto',
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
/*
2+
* SPDX-FileCopyrightText: 2025 SAP Spartacus team <[email protected]>
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
import { loginAsMyCompanyAdmin } from '../../../helpers/b2b/my-company/my-company.utils';
8+
9+
const MY_COMPANY_URL = '/organization/account-summary';
10+
export const SKELETON_SELECTOR =
11+
'main cx-view cx-table table cx-org-toggle-link-cell:not(:has(a))';
12+
13+
/**
14+
* This test checks accessibility concerns on the B2B My Company Account Summaries page using Access Continuum
15+
*/
16+
describe(
17+
'B2B / My Company / Account Summaries / Page Accessibility',
18+
{ testIsolation: false },
19+
() => {
20+
before(() => {
21+
cy.a11yContinuumSetup();
22+
loginAsMyCompanyAdmin();
23+
cy.visit(MY_COMPANY_URL);
24+
});
25+
26+
it('page loading (skeleton)', () => {
27+
cy.get(SKELETON_SELECTOR);
28+
cy.get('main').a11yRunContinuumTest();
29+
});
30+
31+
it('page loaded', () => {
32+
cy.get('#Rustic');
33+
cy.get('main').a11yRunContinuumTest();
34+
});
35+
36+
it('account summaries details / initial panel', () => {
37+
const EXPAND_BTN_SELECTOR = '.actions > button:nth-child(2)';
38+
cy.get(EXPAND_BTN_SELECTOR).click();
39+
cy.get('[id="Custom Retail"]').click();
40+
cy.get(
41+
'.cx-account-summary-document-row:nth-child(2) .cx-account-summary-document-label'
42+
);
43+
cy.get('main').a11yRunContinuumTest();
44+
});
45+
}
46+
);
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
/*
2+
* SPDX-FileCopyrightText: 2025 SAP Spartacus team <[email protected]>
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
import { loginAsMyCompanyAdmin } from '../../../helpers/b2b/my-company/my-company.utils';
8+
9+
const MY_COMPANY_URL = '/organization/budgets';
10+
const rowCellSelector =
11+
'cx-org-list.orgBudget table tr:last-child cx-org-status-cell span';
12+
const detailsActionsListSelector = 'cx-org-list.orgBudget .main .link-list';
13+
14+
/**
15+
* This test checks accessibility concerns on the B2B My Company Budgets page using Access Continuum
16+
*/
17+
describe(
18+
'B2B / My Company / Budgets / Page Accessibility',
19+
{ testIsolation: false },
20+
() => {
21+
before(() => {
22+
cy.a11yContinuumSetup();
23+
loginAsMyCompanyAdmin();
24+
cy.visit(MY_COMPANY_URL);
25+
});
26+
27+
it('list page loaded', () => {
28+
cy.get(rowCellSelector);
29+
cy.get('main').a11yRunContinuumTest();
30+
});
31+
32+
it('budgets / initial panel', () => {
33+
cy.get(rowCellSelector).click();
34+
cy.get(
35+
'cx-org-budget-details cx-org-card cx-view .main .details .property .value'
36+
);
37+
cy.get('cx-org-budget-details').a11yRunContinuumTest();
38+
});
39+
40+
it('budgets / edit panel', () => {
41+
const editdLink = 'cx-org-budget-details .header .actions a.edit';
42+
cy.get(editdLink).click();
43+
cy.get('cx-org-budget-details cx-org-budget-form form input');
44+
cy.get('cx-org-budget-details').a11yRunContinuumTest();
45+
});
46+
47+
it('budgets / const centers panel', () => {
48+
cy.get(`${detailsActionsListSelector} a:nth-child(1)`).click();
49+
cy.get(
50+
'cx-org-budget-cost-center-list table cx-org-cost-center-details-cell button'
51+
).click();
52+
cy.get('cx-org-budget-details').a11yRunContinuumTest();
53+
});
54+
}
55+
);
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
/*
2+
* SPDX-FileCopyrightText: 2025 SAP Spartacus team <[email protected]>
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
import { loginAsMyCompanyAdmin } from '../../../helpers/b2b/my-company/my-company.utils';
8+
9+
const MY_COMPANY_URL = '/organization/cost-centers';
10+
const rowCellSelector =
11+
'main cx-view cx-table table tr:nth-child(2) .unit cx-org-unit-cell [title="Custom Retail"]';
12+
const detailsActionsListSelector =
13+
'cx-org-cost-center-details .main .link-list';
14+
15+
/**
16+
* This test checks accessibility concerns on the B2B My Company Cost Centers page using Access Continuum
17+
*/
18+
describe(
19+
'B2B / My Company / Cost Centers / Page Accessibility',
20+
{ testIsolation: false },
21+
() => {
22+
before(() => {
23+
cy.a11yContinuumSetup();
24+
loginAsMyCompanyAdmin();
25+
cy.visit(MY_COMPANY_URL);
26+
});
27+
28+
it('list page loaded', () => {
29+
cy.get(rowCellSelector);
30+
cy.get('main').a11yRunContinuumTest();
31+
});
32+
33+
it('cost centers / initial panel', () => {
34+
cy.get(rowCellSelector).click();
35+
cy.get(
36+
'cx-org-cost-center-details cx-org-card cx-view .main .details .property .value'
37+
);
38+
cy.get('cx-org-cost-center-details').a11yRunContinuumTest();
39+
});
40+
41+
it('cost centers / edit panel', () => {
42+
const editdLink = 'cx-org-cost-center-details .header .actions a.edit';
43+
cy.get(editdLink).click();
44+
cy.get('cx-org-cost-center-details cx-org-cost-center-form form input');
45+
cy.get('cx-org-cost-center-details').a11yRunContinuumTest();
46+
});
47+
48+
it('cost centers / budgets panel', () => {
49+
cy.get(`${detailsActionsListSelector} a:nth-child(1)`).click();
50+
cy.get(
51+
'cx-org-cost-center-assigned-budget-list table cx-org-assign-cell button'
52+
);
53+
cy.get(
54+
'cx-org-cost-center-assigned-budget-list table cx-org-budget-details-cell button'
55+
).click();
56+
cy.get('cx-org-cost-center-details').a11yRunContinuumTest();
57+
});
58+
59+
it('cost centers / budgets / manage budgets panel', () => {
60+
const manageLink =
61+
'cx-org-cost-center-assigned-budget-list .header .actions a.btn';
62+
cy.get(manageLink).click();
63+
const assignButtonCell =
64+
'cx-org-cost-center-budget-list .main table tr:nth-child(2) cx-org-assign-cell button';
65+
cy.get(assignButtonCell);
66+
cy.get('cx-org-cost-center-budget-list').a11yRunContinuumTest();
67+
});
68+
}
69+
);

0 commit comments

Comments
 (0)