Created
April 3, 2019 06:57
-
-
Save shashankvivek/db16fbdea28f8b1041d3ed50f73cf2e7 to your computer and use it in GitHub Desktop.
Test case for stuudent component
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
it('should set Error message when getUserDetails() is errored out', () => { | |
expect(component.err_msg).toBeUndefined(); | |
spyOn(component._userService, 'getUserDetails').and.returnValue(throwError('Error')); | |
const ele = fixture.debugElement.nativeElement.querySelector('#usr-1'); | |
ele.click(); | |
expect(component.err_msg).toBe('Error while loading User Details'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment