70373: Fix existing texts

This commit is contained in:
Kristof De Langhe
2020-04-15 15:35:41 +02:00
parent c48bb2cbb0
commit 4cd11bcbca
8 changed files with 94 additions and 36 deletions

View File

@@ -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
}));