Skip to content

Commit c5e3710

Browse files
authored
refactor(material/button): use static string for selector (#23537)
Uses a static string for the selector of the button harness since the `join` call we had previouly was showing up in the docs.
1 parent 881edec commit c5e3710

File tree

2 files changed

+4
-18
lines changed

2 files changed

+4
-18
lines changed

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

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,8 @@ import {ButtonHarnessFilters} from '@angular/material/button/testing';
1414
/** Harness for interacting with a MDC-based mat-button in tests. */
1515
export class MatButtonHarness extends ContentContainerComponentHarness {
1616
// TODO(jelbourn) use a single class, like `.mat-button-base`
17-
static hostSelector = [
18-
'[mat-button]',
19-
'[mat-raised-button]',
20-
'[mat-flat-button]',
21-
'[mat-icon-button]',
22-
'[mat-stroked-button]',
23-
'[mat-fab]',
24-
'[mat-mini-fab]',
25-
].join(',');
17+
static hostSelector = `[mat-button], [mat-raised-button], [mat-flat-button],
18+
[mat-icon-button], [mat-stroked-button], [mat-fab], [mat-mini-fab]`;
2619

2720
/**
2821
* Gets a `HarnessPredicate` that can be used to search for a button with specific attributes.

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

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,8 @@ import {ButtonHarnessFilters} from './button-harness-filters';
1515
export class MatButtonHarness extends ContentContainerComponentHarness {
1616
// TODO(jelbourn) use a single class, like `.mat-button-base`
1717
/** The selector for the host element of a `MatButton` instance. */
18-
static hostSelector = [
19-
'[mat-button]',
20-
'[mat-raised-button]',
21-
'[mat-flat-button]',
22-
'[mat-icon-button]',
23-
'[mat-stroked-button]',
24-
'[mat-fab]',
25-
'[mat-mini-fab]',
26-
].join(',');
18+
static hostSelector = `[mat-button], [mat-raised-button], [mat-flat-button], [mat-icon-button],
19+
[mat-stroked-button], [mat-fab], [mat-mini-fab]`;
2720

2821
/**
2922
* Gets a `HarnessPredicate` that can be used to search for a `MatButtonHarness` that meets

0 commit comments

Comments
 (0)