mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-08 10:34:15 +00:00
Refactored components' name and added missing tests
This commit is contained in:
@@ -25,6 +25,8 @@ import { RemoteDataBuildService } from '../cache/builders/remote-data-build.serv
|
||||
import { getMockRemoteDataBuildService } from '../../shared/mocks/mock-remote-data-build.service';
|
||||
import { routeServiceStub } from '../../shared/testing/route-service-stub';
|
||||
import { RouteService } from '../services/route.service';
|
||||
import { authMethodsMock } from '../../shared/testing/auth-service-stub';
|
||||
import { AuthMethod } from './models/auth.method';
|
||||
|
||||
describe('AuthService test', () => {
|
||||
|
||||
@@ -128,6 +130,26 @@ describe('AuthService test', () => {
|
||||
expect(authService.logout.bind(null)).toThrow();
|
||||
});
|
||||
|
||||
it('should return the authentication status object to check an Authentication Cookie', () => {
|
||||
authService.checkAuthenticationCookie().subscribe((status: AuthStatus) => {
|
||||
expect(status).toBeDefined();
|
||||
});
|
||||
});
|
||||
|
||||
it('should return the authentication methods available', () => {
|
||||
const authStatus = new AuthStatus();
|
||||
|
||||
authService.retrieveAuthMethods(authStatus).subscribe((authMethods: AuthMethod[]) => {
|
||||
expect(authMethods).toBeDefined();
|
||||
expect(authMethods.length).toBe(0);
|
||||
});
|
||||
|
||||
authStatus.authMethods = authMethodsMock;
|
||||
authService.retrieveAuthMethods(authStatus).subscribe((authMethods: AuthMethod[]) => {
|
||||
expect(authMethods).toBeDefined();
|
||||
expect(authMethods.length).toBe(2);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('', () => {
|
||||
|
Reference in New Issue
Block a user