Testing NgRX
summary
Uses Cypress to tap the NgRx store in the browser (exposed only when window.cypress is true) so tests can assert last action type and its props and dispatch actions via window.store.invoke dispatch rather than only inspecting the DOM. Example app is a favorite TV show demo (github.comcreate this dot ngrx testing) where page load triggers a shows api get all shows success with four shows and clicking favorite dispatches favorite show clicked then an effect produces favorite show success with the expected show id.
AI-written summary · about
chapters (8)
- 0:00Start
- 0:32Why End-to-End Testing for Ngrx
- 2:44Testing Approach
- 4:46Asserting on Ngrx Actions
- 14:59The Cypress Test Runner in Action
- 16:39Validating the Favorite Show Clicked Action and Effect
- 17:37Validate via the Ngrx Store
- 18:36Resources
related talks
01h 04mRedux for Angular -- Introduction to Ngrx Ecosystem
45mReactive Testing Strategies with NgRx
28mUsing MockStore in NgRx 8
41mNgRx Mobile with Ionic
35mAdvanced NgRx Techniques
27mngRx the last piece in the Angular architecture puzzle
44mAngular + Redux ... stop, what?
37mTesting with MockStore in NgRx 9
