Commit 4ea6c3d
committed
feat(material/testing): Modify HarnessLoader with the addition of
`getHarnessAtIndex` and `countHarnesses`
These two new functions are intended to expand harness testing
functionality by providing built-in functions for commonly used
patterns.
* `getHarnessAtIndex` functions similarly to `getHarness`, but returns
a harness for the matching component instance with the given index.
An example use case is to fetch the nth MatOptionHarness on screen.
* `countHarnesses` simply counts the number of matching component
instances and returns the result.
Documentation is updated to reflect this changes, and adds a missing row
for the `hasHarness` function
Manually tested using the MatInputHarness tests1 parent 015a668 commit 4ea6c3d
File tree
2 files changed
+51
-10
lines changed- src/cdk/testing
2 files changed
+51
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
133 | 144 | | |
134 | 145 | | |
135 | 146 | | |
| |||
142 | 153 | | |
143 | 154 | | |
144 | 155 | | |
145 | | - | |
| 156 | + | |
146 | 157 | | |
147 | 158 | | |
148 | 159 | | |
| |||
520 | 531 | | |
521 | 532 | | |
522 | 533 | | |
523 | | - | |
524 | | - | |
| 534 | + | |
525 | 535 | | |
526 | | - | |
527 | | - | |
528 | | - | |
| 536 | + | |
| 537 | + | |
529 | 538 | | |
530 | 539 | | |
531 | 540 | | |
| |||
554 | 563 | | |
555 | 564 | | |
556 | 565 | | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
557 | 577 | | |
558 | 578 | | |
559 | 579 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
251 | 251 | | |
252 | 252 | | |
253 | 253 | | |
254 | | - | |
255 | | - | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
256 | 276 | | |
257 | 277 | | |
258 | 278 | | |
| |||
277 | 297 | | |
278 | 298 | | |
279 | 299 | | |
280 | | - | |
281 | | - | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
282 | 303 | | |
283 | 304 | | |
284 | 305 | | |
| |||
0 commit comments