Skip to content

Commit

Permalink
fix(material/paginator): fix spec test
Browse files Browse the repository at this point in the history
changed paginator harness test to look for aria-disabled instead of disabled

fixes b/286098030
  • Loading branch information
DBowen33 committed Jul 8, 2024
1 parent 83901bd commit 150e63d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/material/paginator/testing/paginator-harness.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,13 @@ describe('MatPaginatorHarness', () => {

it('should return whether or not the previous page is disabled', async () => {
const paginator = await loader.getHarness(MatPaginatorHarness);
expect(await paginator.isPreviousPageDisabled()).toBe(false);
expect(await paginator.isPreviousPageDisabled()).toBe(true);
});

it('should return whether or not the next page is disabled', async () => {
const paginator = await loader.getHarness(MatPaginatorHarness);
await paginator.goToLastPage();
expect(await paginator.isNextPageDisabled()).toBe(false);
expect(await paginator.isNextPageDisabled()).toBe(true);
});

it('should throw an error if the last page button is not available', async () => {
Expand Down
4 changes: 2 additions & 2 deletions src/material/paginator/testing/paginator-harness.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,13 @@ export class MatPaginatorHarness extends ComponentHarness {

/** Returns whether or not the next page button is disabled. */
async isNextPageDisabled(): Promise<boolean> {
const disabledValue = await (await this._nextButton()).getAttribute('disabled');
const disabledValue = await (await this._nextButton()).getAttribute('aria-disabled');
return disabledValue == 'true';
}

/* Returns whether or not the previous page button is disabled. */
async isPreviousPageDisabled(): Promise<boolean> {
const disabledValue = await (await this._previousButton()).getAttribute('disabled');
const disabledValue = await (await this._previousButton()).getAttribute('aria-disabled');
return disabledValue == 'true';
}

Expand Down

0 comments on commit 150e63d

Please sign in to comment.