1
0
mirror of https://github.com/xuthus83/pigallery2.git synced 2024-11-03 21:04:03 +08:00

update tests

This commit is contained in:
Braun Patrik 2016-05-05 18:14:11 +02:00
parent 10b47c45eb
commit 2cecdbda07
2 changed files with 2 additions and 2 deletions

View File

@ -45,8 +45,8 @@ describe('AuthenticationService', () => {
it('should have Authenticated use', inject([ AuthenticationService ], (authService) => { it('should have Authenticated use', inject([ AuthenticationService ], (authService) => {
spyOn(authService.OnAuthenticated,"trigger").and.callThrough(); spyOn(authService.OnAuthenticated,"trigger").and.callThrough();
authService.login(); authService.login();
expect(authService.OnAuthenticated.trigger).toHaveBeenCalled();
authService.OnAuthenticated.on(() =>{ authService.OnAuthenticated.on(() =>{
expect(authService.OnAuthenticated.trigger).toHaveBeenCalled();
expect(authService.getUser()).not.toBe(null); expect(authService.getUser()).not.toBe(null);
expect(authService.isAuthenticated()).toBe(true); expect(authService.isAuthenticated()).toBe(true);
}); });

View File

@ -35,7 +35,7 @@ describe('UserService', () => {
spyOn(networkService,"postJson"); spyOn(networkService,"postJson");
let credential = new LoginCredential("name","pass"); let credential = new LoginCredential("name","pass");
userService.login(credential); userService.login(credential);
expect(networkService.getJson).toHaveBeenCalled(); expect(networkService.postJson).toHaveBeenCalled();
expect(networkService.postJson.calls.argsFor(0)).toEqual(["/user/login",{"loginCredential": credential}]); expect(networkService.postJson.calls.argsFor(0)).toEqual(["/user/login",{"loginCredential": credential}]);
})); }));