Exercise 1: Reducers
Create test files at:
- src/app/state/dialog/dialog.reducer.spec.ts
- src/app/state/map/map.reducer.spec.ts
- src/app/state/resort/resort.reducer.spec.ts
Steps
- Assert an unknown action against each reducer.
- Assert each action that returns a new state object in the reducer function.
- Assert each expected state value change for each action.
Hints
- Use the
jest.fn()
function to mock out thecomponentType
when testing theShowDialog
action. - Use the
generateResort()
function available in src/app/models/resort.model.ts to generate a fake resort.