ngrx-workshop
Search…
Testing Selectors
1
// Selector Test
2
describe('user selectors', () => {
3
it('should return all users', () => {
4
const state = createUsersState();
5
expect(getAllUsers(state)).toMatchSnapshot();
6
});
7
});
8
9
// Selector Test - Override the state
10
describe('user selectors', () => {
11
it('should return all users', () => {
12
const state = createUsersState();
13
14
state.users.entities['1'].firstName = 'Joe';
15
16
const users = getAllUsers(state);
17
18
expect(users[0]).toMatchSnapshot();
19
});
20
});
21
22
Copied!
Copy link