~/talk

Angular Component Test Harnesses FTW

Talkat NG-BE 2023 · 2023-03-23..03-24· [angular, testing]
links:none on file
slides:none on file

Claims that using Angular CDK's test harnesses makes component unit tests simpler and more resilient, demonstrates built-in harnesses for Angular Material controls (available since Angular v12) and shows a custom harness for an app add comment component that is tested via TestbedHarnessEnvironment.loader and harness predicates. Examples use Karma unit tests, show the harness API (e.g. MatInputHarness setValue/getValue, locatorFor/locatorForAll), and report harness-based tests surviving the Angular v15 MDC changes.

AI-written summary · about

  1. 0:00The challenge of UI testing
  2. 2:34Understanding test harnesses
  3. 4:49Harnesses in action
  4. 8:46CDK testing API mechanics
  5. 13:45Writing custom harnesses
  6. 20:17Best practices and conclusion
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.