Skip to content

docs-bug(button): button-harness-example has wrong assignment #24732

@Bishares

Description

@Bishares

Documentation Feedback

I just noticed an error in your button-harness-example.spec.ts

In line 11 it has the following assignment

let buttonHarness = MatButtonHarness;

which was meant to be a declaration

let buttonHarness: MatButtonHarness;

But it turns out the buttonHarness variable is never assigned. The usages of that variable later on in the it() functions will also not work. The variable is not needed at all!

The it() blocks can just use MatButtonHarness.with() directly.

The following changes to that spec file should be made

  1. remove the let buttonHarness = MatButtonHarness; assignment in line 11
  2. adjust the usages of the buttonHarness variables in the second and third it() function. from buttonHarness.with() to MatButtonHarness.with()

Affected documentation page

https://material.angular.io/components/button/examples#button-harness

Metadata

Metadata

Assignees

Labels

P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: material/buttondocsThis issue is related to documentation

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions