Testable Angular Forms
summary
Repository is an Angular 14 Reactive Forms workshop that actually builds a contact form, focuses tests on the email control, and shows concrete assertions: use patchValue and detectChanges to exercise the FormGroup, inspect validity with fixture.componentInstance.form.get('email'), and target DOM nodes with form control name selectors or fixture.debugElement.querySelector. Tests parameterize valid/invalid cases, check touched state to reveal error messages, and run Lighthouse or Accessibility Insights to verify labels, tab order, and ARIA fixes.
AI-written summary · about
chapters (10)
- 0:00Angular forms testing intro
- 2:59Why unit test Angular forms
- 10:13Test environment setup
- 14:24First unit test: email required
- 25:50Invalid email validation
- 32:06Parameterized email tests
- 45:47DOM field presence
- 51:54Error messages for invalid inputs
- 1:04:28Accessibility in form testing
- 1:15:51Summary
related talks
43mAngular Reactive Forms - Developing Forms and Validation with Angular
48mHandling Angular Forms Without Losing Your Sanity
21mComparing Angular Forms
20mLet’s Build A Form Around It
35mLet's Build a Form Around It
28mHandling Angular Forms Without Losing Your Sanity
35mIndiana Jones and the Hidden Secrets of the Forms API
36mUnleash the Power of Angular Reactive Form
