components icon indicating copy to clipboard operation
components copied to clipboard

docs-bug(COMPONENT): TITLE

Open michahell opened this issue 3 years ago • 2 comments

Documentation Feedback

I can't find specific documentation around Test harness API's for specific components...

on the main test harness documentation page there is an example for a select component:

const select = await loader.getHarness(MatSelectHarness);
    await select.open();
    const bugOption = await select.getOption({text: 'Bug'});
    await bugOption.click();

This does not work similarly for MatAutocompleteHarness: There is a .selectOption() method which does not accept {text: string} but instead only {selector: string, ancestor: string} but nowhere this is explained.

Affected documentation page

https://material.angular.io/guide/using-component-harnesses

michahell avatar Nov 11 '22 14:11 michahell

Each component on the docs site has one live example showing how to use its harness. Here's the one for the autocomplete: https://material.angular.io/components/autocomplete/examples#autocomplete-harness. There's also a "Testing" section in the API reference: https://material.angular.io/components/autocomplete/api#classes

crisbeto avatar Nov 14 '22 08:11 crisbeto

Thanks, I now see why I missed this: I don't think it's a very obvious place to put documentation around test harnesses in the middle of component usage examples. I would have expected a tab up top stating "testing" or "harness" or something similar.

michahell avatar Nov 15 '22 09:11 michahell

On the top right hand side for the API page, you can see the testing section in the table of contents. I'll add a comment to #25614 to make sure we track making the harness documentation more discoverable.

amysorto avatar Nov 18 '22 18:11 amysorto

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.