mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
Fixing unit test
This commit is contained in:
@@ -41,8 +41,7 @@ describe('LibraryFavoriteDirective', () => {
|
|||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [HttpClientTestingModule, TestComponent],
|
imports: [HttpClientTestingModule, TestComponent, LibraryFavoriteDirective]
|
||||||
declarations: [LibraryFavoriteDirective]
|
|
||||||
});
|
});
|
||||||
fixture = TestBed.createComponent(TestComponent);
|
fixture = TestBed.createComponent(TestComponent);
|
||||||
component = fixture.componentInstance;
|
component = fixture.componentInstance;
|
||||||
|
@@ -18,7 +18,6 @@
|
|||||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
import { AboutServerSettingsComponent } from './about-server-settings.component';
|
import { AboutServerSettingsComponent } from './about-server-settings.component';
|
||||||
import { AppConfigService } from '../../app-config/app-config.service';
|
import { AppConfigService } from '../../app-config/app-config.service';
|
||||||
import { aboutGithubDetails } from '../about.mock';
|
|
||||||
import { TranslateModule } from '@ngx-translate/core';
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
import { HttpClientTestingModule } from '@angular/common/http/testing';
|
import { HttpClientTestingModule } from '@angular/common/http/testing';
|
||||||
import { AppConfigServiceMock } from '../../common';
|
import { AppConfigServiceMock } from '../../common';
|
||||||
|
@@ -50,4 +50,8 @@ export class AuthenticationMock extends AuthenticationService {
|
|||||||
|
|
||||||
return throwError('Fake server error');
|
return throwError('Fake server error');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
logout(): Observable<any> {
|
||||||
|
return of({});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -33,7 +33,7 @@ import { HttpClientModule } from '@angular/common/http';
|
|||||||
import { directionalityConfigFactory } from '../common/services/directionality-config-factory';
|
import { directionalityConfigFactory } from '../common/services/directionality-config-factory';
|
||||||
import { DirectionalityConfigService } from '../common/services/directionality-config.service';
|
import { DirectionalityConfigService } from '../common/services/directionality-config.service';
|
||||||
import { AuthModule, RedirectAuthService } from '../auth';
|
import { AuthModule, RedirectAuthService } from '../auth';
|
||||||
import { EMPTY } from 'rxjs';
|
import { EMPTY, of } from 'rxjs';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
@@ -56,7 +56,7 @@ import { EMPTY } from 'rxjs';
|
|||||||
deps: [DirectionalityConfigService],
|
deps: [DirectionalityConfigService],
|
||||||
multi: true
|
multi: true
|
||||||
},
|
},
|
||||||
{ provide: RedirectAuthService, useValue: { onLogin: EMPTY, init: () => {} } }
|
{ provide: RedirectAuthService, useValue: { onLogin: EMPTY, init: () => {}, onTokenReceived: of() } }
|
||||||
],
|
],
|
||||||
exports: [NoopAnimationsModule, CoreModule, TranslateModule, RouterTestingModule]
|
exports: [NoopAnimationsModule, CoreModule, TranslateModule, RouterTestingModule]
|
||||||
})
|
})
|
||||||
|
Reference in New Issue
Block a user