Skip to content

Commit 884f760

Browse files
crisbetoandrewseguin
authored andcommitted
docs(material/button): fix button harness example test (#24736)
We were declaring the harness being used as a variable unecessarily. These changes align the example closer with the other harness examples. Fixes #24732. (cherry picked from commit 2c64ae3)
1 parent 090404a commit 884f760

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/components-examples/material/button/button-harness/button-harness-example.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import {ButtonHarnessExample} from './button-harness-example';
88
describe('ButtonHarnessExample', () => {
99
let fixture: ComponentFixture<ButtonHarnessExample>;
1010
let loader: HarnessLoader;
11-
let buttonHarness = MatButtonHarness;
1211

1312
beforeEach(async () => {
1413
await TestBed.configureTestingModule({
@@ -26,13 +25,14 @@ describe('ButtonHarnessExample', () => {
2625
});
2726

2827
it('should load button with exact text', async () => {
29-
const buttons = await loader.getAllHarnesses(buttonHarness.with({text: 'Basic button'}));
28+
const buttons = await loader.getAllHarnesses(MatButtonHarness.with({text: 'Basic button'}));
3029
expect(buttons.length).toBe(1);
3130
expect(await buttons[0].getText()).toBe('Basic button');
3231
});
3332

3433
it('should click a button', async () => {
35-
const button = await loader.getHarness(buttonHarness.with({text: 'Basic button'}));
34+
const button = await loader.getHarness(MatButtonHarness.with({text: 'Basic button'}));
35+
expect(fixture.componentInstance.clicked).toBe(false);
3636
await button.click();
3737
expect(fixture.componentInstance.clicked).toBe(true);
3838
});

0 commit comments

Comments
 (0)