Skip to content

Commit 8d141f1

Browse files
committed
fix(material/testing): Rename MatButtonHarness "type" filter to
"buttonType" to avoid conflict with the reserved TS keyword
1 parent f3b4d99 commit 8d141f1

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/material/button/testing/button-harness-filters.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@ export interface ButtonHarnessFilters extends BaseHarnessFilters {
3232
disabled?: boolean;
3333

3434
/** Only find instances with the specified type. */
35-
type?: ButtonType;
35+
buttonType?: ButtonType;
3636
}

src/material/button/testing/button-harness.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ describe('MatButtonHarness', () => {
6060
});
6161

6262
it('should load button with type attribute', async () => {
63-
const buttons = await loader.getAllHarnesses(MatButtonHarness.with({type: 'submit'}));
63+
const buttons = await loader.getAllHarnesses(MatButtonHarness.with({buttonType: 'submit'}));
6464
expect(buttons.length).toBe(1);
6565
expect(await buttons[0].getText()).toBe('Submit button');
6666
expect(await buttons[0].getType()).toBe('submit');

src/material/button/testing/button-harness.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ export class MatButtonHarness extends ContentContainerComponentHarness {
5656
.addOption('disabled', options.disabled, async (harness, disabled) => {
5757
return (await harness.isDisabled()) === disabled;
5858
})
59-
.addOption('type', options.type, (harness, type) =>
60-
HarnessPredicate.stringMatches(harness.getType(), type),
59+
.addOption('buttonType', options.buttonType, (harness, buttonType) =>
60+
HarnessPredicate.stringMatches(harness.getType(), buttonType),
6161
);
6262
}
6363

0 commit comments

Comments
 (0)