Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- it('should save user', () => {
- const expectedUser = {
- id: 7,
- firstName: 'Grzegorz',
- lastName: 'Pluta',
- email: 'grzegorz.pluta@gmail.com',
- login: 'gpluta',
- password: 'gpluta',
- role: 'user'
- };
- userService.addUser(expectedUser).subscribe(
- user => expect(user.firstName).toEqual('Grzegorz', 'first name should be equal'),
- );
- const req = httpTestingController.expectOne(userService.userUrl);
- expect(req.request.method).toEqual('POST');
- req.flush(expectedUser);
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement