diff --git a/adev/src/content/guide/testing/using-component-harnesses.md b/adev/src/content/guide/testing/using-component-harnesses.md index 5c2f01ff3d6..3c0c3e0ecda 100644 --- a/adev/src/content/guide/testing/using-component-harnesses.md +++ b/adev/src/content/guide/testing/using-component-harnesses.md @@ -25,7 +25,7 @@ Additional testing environments require custom bindings. See the [adding harness ### Using the loader from `TestbedHarnessEnvironment` for unit tests -For unit tests you can create a harness loader from [TestbedHarnessEnvironment](/api/cdk/testing/TestbedHarnessEnvironment). This environment uses a [component fixture](api/core/testing/ComponentFixture) created by Angular's `TestBed`. +For unit tests you can create a harness loader from [TestbedHarnessEnvironment](/api/cdk/testing/testbed/TestbedHarnessEnvironment). This environment uses a [component fixture](api/core/testing/ComponentFixture) created by Angular's `TestBed`. To create a harness loader rooted at the fixture's root element, use the `loader()` method: @@ -68,7 +68,7 @@ To get `ComponentHarness` for the first instance of the element, use the `getHar const myComponentHarness = await loader.getHarness(MyComponent); // Get harnesses for all instances of the element -const myComponentHarnesses = await loader.getHarnesses(MyComponent); +const myComponentHarnesses = await loader.getAllHarnesses(MyComponent); ``` In addition to `getHarness` and `getAllHarnesses`, `HarnessLoader` has several other useful methods for querying for harnesses: