You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: adev/src/content/guide/aria/accordion.md
+47Lines changed: 47 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -158,6 +158,53 @@ Use the `ngAccordionContent` directive on an `ng-template` to defer rendering co
158
158
```
159
159
160
160
By default, content remains in the DOM after the panel collapses. Set `[preserveContent]="false"` to remove the content from the DOM when the panel closes.
161
+
## Testing
162
+
163
+
Angular Aria provides component harnesses for testing accordion components.
164
+
Here is an example of how to use the harnesses in a component test:
Copy file name to clipboardExpand all lines: adev/src/content/guide/aria/autocomplete.md
+50Lines changed: 50 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -148,6 +148,56 @@ Highlight mode allows the user to navigate options with arrow keys without chang
148
148
</docs-code-multifile>
149
149
</docs-tab>
150
150
</docs-tab-group>
151
+
## Testing
152
+
153
+
The autocomplete pattern can be tested using a combination of `ComboboxHarness` and `ListboxHarness` from `@angular/aria/combobox/testing` and `@angular/aria/listbox/testing`.
154
+
Here is an example of how to use the harnesses to test an autocomplete component:
Copy file name to clipboardExpand all lines: adev/src/content/guide/aria/combobox.md
+42-2Lines changed: 42 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -164,7 +164,7 @@ Combobox can coordinate with a two-dimensional grid to create accessible datepic
164
164
165
165
### Dialog popup
166
166
167
-
Popups sometimes need modal behavior with a backdrop and focus trap. The combobox dialog directive provides this pattern for specialized use cases.
167
+
Dialog popups combine the combobox trigger with standard dialog layouts and focus traps (such as CDK's `cdkTrapFocus`). Use dialog popups when the overlay requires modal behavior or backdrop interaction.
168
168
169
169
<docs-tab-group>
170
170
<docs-tablabel="Basic">
@@ -192,7 +192,47 @@ Popups sometimes need modal behavior with a backdrop and focus trap. The combobo
192
192
</docs-tab>
193
193
</docs-tab-group>
194
194
195
-
Dialog popups combine the combobox trigger with standard dialog layouts and focus traps (such as CDK's `cdkTrapFocus`). Use dialog popups when the overlay requires modal behavior or backdrop interaction.
195
+
## Testing
196
+
197
+
Angular Aria provides a `ComboboxHarness` for testing combobox components.
198
+
Here is an example of how to use the harness in a component test:
Copy file name to clipboardExpand all lines: adev/src/content/guide/aria/menu.md
+68Lines changed: 68 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -173,6 +173,74 @@ Disable specific menu items using the `disabled` input. Control focus behavior w
173
173
</docs-tab-group>
174
174
175
175
When `[softDisabled]="true"`, disabled items can receive focus but cannot be activated. When `[softDisabled]="false"`, disabled items are skipped during keyboard navigation.
176
+
## Testing
177
+
178
+
Angular Aria provides component harnesses for testing menu components.
179
+
Here is an example of how to use the harnesses in a component test:
0 commit comments