diff --git a/playwright/e2e/row-group.spec.ts b/playwright/e2e/row-group.spec.ts new file mode 100644 index 000000000..78c990456 --- /dev/null +++ b/playwright/e2e/row-group.spec.ts @@ -0,0 +1,53 @@ +import { expect, test } from '../support/test-helpers'; + +test.describe('row grouping', () => { + const example = 'row-grouping'; + + test(example, async ({ ngx, page }) => { + await ngx.visitExample(example); + + await expect(page.getByText('Ethel Price')).toBeVisible(); + await ngx.runVisualAndA11yTests('default', [ + // interactive elements< (, etc) within table cells are failing + { + id: 'aria-required-children', + enabled: false + } + ]); + + const groupCheckbox = page.locator('.datatable-group-cell .datatable-checkbox input').first(); + groupCheckbox.check(); + + await expect(page.getByText('4 selected')).toBeVisible(); + + await ngx.runVisualAndA11yTests('group-selected', [ + { + id: 'aria-required-children', + enabled: false + } + ]); + }); + + test(example + ' expand/collapse', async ({ ngx, page }) => { + await ngx.visitExample(example); + + await expect(page.getByText('Ethel Price')).toBeVisible(); + const groupHeader = page.getByTitle('Expand/Collapse Group').first(); + groupHeader.click(); + await expect(page.getByText('Ethel Price')).not.toBeVisible(); + await ngx.runVisualAndA11yTests('group-collapsed', [ + { + id: 'aria-required-children', + enabled: false + } + ]); + groupHeader.click(); + await expect(page.getByText('Ethel Price')).toBeVisible(); + await ngx.runVisualAndA11yTests('group-expanded', [ + { + id: 'aria-required-children', + enabled: false + } + ]); + }); +}); diff --git a/playwright/e2e/static.spec.ts b/playwright/e2e/static.spec.ts deleted file mode 100644 index 6616557e4..000000000 --- a/playwright/e2e/static.spec.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { test } from '../support/test-helpers'; - -test('footer', ({ ngx: ngx }) => ngx.static({})); diff --git a/playwright/snapshots/e2e/row-group.spec.ts-snapshots/row-grouping--default-chromium-linux.png b/playwright/snapshots/e2e/row-group.spec.ts-snapshots/row-grouping--default-chromium-linux.png new file mode 100644 index 000000000..ccd72cc92 Binary files /dev/null and b/playwright/snapshots/e2e/row-group.spec.ts-snapshots/row-grouping--default-chromium-linux.png differ diff --git a/playwright/snapshots/e2e/row-group.spec.ts-snapshots/row-grouping--group-collapsed-chromium-linux.png b/playwright/snapshots/e2e/row-group.spec.ts-snapshots/row-grouping--group-collapsed-chromium-linux.png new file mode 100644 index 000000000..6d6d23343 Binary files /dev/null and b/playwright/snapshots/e2e/row-group.spec.ts-snapshots/row-grouping--group-collapsed-chromium-linux.png differ diff --git a/playwright/snapshots/e2e/row-group.spec.ts-snapshots/row-grouping--group-expanded-chromium-linux.png b/playwright/snapshots/e2e/row-group.spec.ts-snapshots/row-grouping--group-expanded-chromium-linux.png new file mode 100644 index 000000000..ccd72cc92 Binary files /dev/null and b/playwright/snapshots/e2e/row-group.spec.ts-snapshots/row-grouping--group-expanded-chromium-linux.png differ diff --git a/playwright/snapshots/e2e/row-group.spec.ts-snapshots/row-grouping--group-selected-chromium-linux.png b/playwright/snapshots/e2e/row-group.spec.ts-snapshots/row-grouping--group-selected-chromium-linux.png new file mode 100644 index 000000000..2e179b5d7 Binary files /dev/null and b/playwright/snapshots/e2e/row-group.spec.ts-snapshots/row-grouping--group-selected-chromium-linux.png differ diff --git a/playwright/snapshots/e2e/row-group.spec.ts-snapshots/row-grouping-chromium-linux.png b/playwright/snapshots/e2e/row-group.spec.ts-snapshots/row-grouping-chromium-linux.png new file mode 100644 index 000000000..ccd72cc92 Binary files /dev/null and b/playwright/snapshots/e2e/row-group.spec.ts-snapshots/row-grouping-chromium-linux.png differ diff --git a/src/app/basic/row-grouping.component.ts b/src/app/basic/row-grouping.component.ts index 50b5fc259..a0e123fa7 100644 --- a/src/app/basic/row-grouping.component.ts +++ b/src/app/basic/row-grouping.component.ts @@ -51,7 +51,7 @@ import { >
@@ -98,6 +99,7 @@ import { name="{{ rowIndex }}" value="1" class="expectedpayment2" + [attr.aria-label]="'ex pay2' + rowIndex" (change)="checkGroup($event, row, rowIndex, group)" [checked]="row.exppayno === 1" /> @@ -109,6 +111,7 @@ import { name="{{ rowIndex }}" value="2" class="expectedpayment3" + [attr.aria-label]="'ex pay3' + rowIndex" (change)="checkGroup($event, row, rowIndex, group)" [checked]="row.exppaypending === 1" /> @@ -139,6 +142,7 @@ import { (blur)="updateValue($event, 'comment', rowIndex)" type="text" name="comment" + aria-label="comment" [value]="value" />