Skip to content

Commit 8e1815e

Browse files
committed
fix(material/paginator): tests
1 parent 58d2cac commit 8e1815e

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/material/paginator/paginator.spec.ts

+3-5
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,9 @@ describe('MatPaginator', () => {
107107
expect(getNextButton(fixture).getAttribute('aria-label')).toBe('Next page');
108108

109109
const select = fixture.nativeElement.querySelector('.mat-mdc-select');
110-
const selectLabelIds = select.getAttribute('aria-labelledby')?.split(/\s/g) as string[];
111-
const selectLabelTexts = selectLabelIds?.map(labelId => {
112-
return fixture.nativeElement.querySelector(`#${labelId}`)?.textContent?.trim();
113-
});
114-
expect(selectLabelTexts).toContain('Items per page:');
110+
const selectLabelId = select.getAttribute('aria-labelledby').trim();
111+
const selectLabelText = fixture.nativeElement.querySelector(`#${selectLabelId}`)?.textContent;
112+
expect(selectLabelText).toContain('Items per page:');
115113
});
116114

117115
it('should re-render when the i18n labels change', () => {

0 commit comments

Comments
 (0)