Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: TT-310 Testing implementation fixed
  • Loading branch information
jcalarcon98 committed Aug 17, 2021
commit e6b350431e20e42f3103ee641edf70409fc30a66
6 changes: 3 additions & 3 deletions src/app/modules/users/store/user.effects.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,9 @@ describe('UserEffects', () => {
});

spyOn(toastrService, 'success');
spyOn(service, 'revokeRole').and.returnValue(throwError({ error: { message: 'error' } }));
spyOn(service, 'revokeRole').and.returnValue(of(user));

effects.grantUserRole$.subscribe((action) => {
effects.revokeUserRole$.subscribe((action) => {
expect(toastrService.success).toHaveBeenCalledWith('User role successfully revoked');
expect(action.type).toEqual(UserActionTypes.REVOKE_USER_ROLE_SUCCESS);
});
Expand All @@ -194,7 +194,7 @@ describe('UserEffects', () => {
spyOn(toastrService, 'error');
spyOn(service, 'revokeRole').and.returnValue(throwError({ error: { message: 'error' } }));

effects.grantUserRole$.subscribe((action) => {
effects.revokeUserRole$.subscribe((action) => {
expect(toastrService.error).toHaveBeenCalled();
expect(action.type).toEqual(UserActionTypes.REVOKE_USER_ROLE_FAIL);
});
Expand Down