Skip to content

Commit 183a3d2

Browse files
committed
refactor(material/testing): Rename MatButtonHarness "icon" filter to
"iconName"
1 parent a8687aa commit 183a3d2

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

goldens/material/button/testing/index.api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export interface ButtonHarnessFilters extends BaseHarnessFilters {
1717
appearance?: ButtonAppearance;
1818
buttonType?: ButtonType;
1919
disabled?: boolean;
20-
icon?: string | RegExp;
20+
iconName?: string | RegExp;
2121
text?: string | RegExp;
2222
variant?: ButtonVariant;
2323
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,5 @@ export interface ButtonHarnessFilters extends BaseHarnessFilters {
3535
buttonType?: ButtonType;
3636

3737
/** Only find instances that contain an icon whose name matches the given value. */
38-
icon?: string | RegExp;
38+
iconName?: string | RegExp;
3939
}

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

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

118118
it('should be able to filter buttons containing a named icon', async () => {
119-
const favBtn = await loader.getHarness(MatButtonHarness.with({icon: 'favorite'}));
119+
const favBtn = await loader.getHarness(MatButtonHarness.with({iconName: 'favorite'}));
120120

121121
expect(await (await favBtn.host()).getAttribute('id')).toBe('favorite-icon');
122122
expect(await (await favBtn.getHarness(MatIconHarness)).getName()).toBe('favorite');

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ export class MatButtonHarness extends ContentContainerComponentHarness {
6060
.addOption('buttonType', options.buttonType, (harness, buttonType) =>
6161
HarnessPredicate.stringMatches(harness.getType(), buttonType),
6262
)
63-
.addOption('icon', options.icon, (harness, icon) => {
64-
return harness.hasHarness(MatIconHarness.with({name: icon}));
63+
.addOption('iconName', options.iconName, (harness, iconName) => {
64+
return harness.hasHarness(MatIconHarness.with({name: iconName}));
6565
});
6666
}
6767

0 commit comments

Comments
 (0)