mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-15 22:13:02 +00:00
70373: Fix existing texts
This commit is contained in:
@@ -12,6 +12,8 @@ import { AppState } from '../../../app.reducer';
|
||||
import { MockTranslateLoader } from '../../mocks/mock-translate-loader';
|
||||
import { cold } from 'jasmine-marbles';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { AuthService } from '../../../core/auth/auth.service';
|
||||
import { of } from 'rxjs';
|
||||
|
||||
describe('UserMenuComponent', () => {
|
||||
|
||||
@@ -20,6 +22,13 @@ describe('UserMenuComponent', () => {
|
||||
let deUserMenu: DebugElement;
|
||||
let authState: AuthState;
|
||||
let authStateLoading: AuthState;
|
||||
let authService: AuthService;
|
||||
|
||||
function serviceInit() {
|
||||
authService = jasmine.createSpyObj('authService', {
|
||||
getAuthenticatedUserFromStore: of(EPersonMock)
|
||||
});
|
||||
}
|
||||
|
||||
function init() {
|
||||
authState = {
|
||||
@@ -27,18 +36,19 @@ describe('UserMenuComponent', () => {
|
||||
loaded: true,
|
||||
loading: false,
|
||||
authToken: new AuthTokenInfo('test_token'),
|
||||
user: EPersonMock
|
||||
userId: EPersonMock.id
|
||||
};
|
||||
authStateLoading = {
|
||||
authenticated: true,
|
||||
loaded: true,
|
||||
loading: true,
|
||||
authToken: null,
|
||||
user: EPersonMock
|
||||
userId: EPersonMock.id
|
||||
};
|
||||
}
|
||||
|
||||
beforeEach(async(() => {
|
||||
serviceInit();
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
StoreModule.forRoot(authReducer),
|
||||
@@ -49,6 +59,9 @@ describe('UserMenuComponent', () => {
|
||||
}
|
||||
})
|
||||
],
|
||||
providers: [
|
||||
{ provide: AuthService, useValue: authService }
|
||||
],
|
||||
declarations: [
|
||||
UserMenuComponent
|
||||
],
|
||||
@@ -93,7 +106,7 @@ describe('UserMenuComponent', () => {
|
||||
b: true
|
||||
}));
|
||||
|
||||
expect(component.user$).toBeObservable(cold('c', {
|
||||
expect(component.user$).toBeObservable(cold('(c|)', {
|
||||
c: EPersonMock
|
||||
}));
|
||||
|
||||
@@ -132,7 +145,7 @@ describe('UserMenuComponent', () => {
|
||||
b: false
|
||||
}));
|
||||
|
||||
expect(component.user$).toBeObservable(cold('c', {
|
||||
expect(component.user$).toBeObservable(cold('(c|)', {
|
||||
c: EPersonMock
|
||||
}));
|
||||
|
||||
|
Reference in New Issue
Block a user