Fixing unit tests

This commit is contained in:
Piotr Pekala 2019-02-20 04:55:12 -08:00
parent cc1d255de9
commit 5b621e9468
2 changed files with 12 additions and 2 deletions

View File

@ -36,6 +36,7 @@ import { MapDrawingToDrawingConverter } from '../../cartography/converters/map/m
import { MapLabelToLabelConverter } from '../../cartography/converters/map/map-label-to-label-converter';
import { SelectionManager } from '../../cartography/managers/selection-manager';
import { SelectionTool } from '../../cartography/tools/selection-tool';
import { RecentlyOpenedProjectService } from '../../services/recentlyOpenedProject.service';
export class MockedProgressService {
public activate() {}
@ -149,7 +150,11 @@ describe('ProjectMapComponent', () => {
{ provide: SettingsService, useClass: MockedSettingsService },
{ provide: ToolsService },
{ provide: SelectionManager },
{ provide: SelectionTool }
{ provide: SelectionTool },
{
provide: RecentlyOpenedProjectService,
useClass: RecentlyOpenedProjectService
},
],
declarations: [ProjectMapComponent, D3MapComponent, ...ANGULAR_MAP_DECLARATIONS],
schemas: [NO_ERRORS_SCHEMA]

View File

@ -10,13 +10,14 @@ import { ServerManagementService, ServerStateEvent } from '../../services/server
import { ToasterService } from '../../services/toaster.service';
import { MockedToasterService } from '../../services/toaster.service.spec';
import { Subject } from 'rxjs';
import { RecentlyOpenedProjectService } from '../../services/recentlyOpenedProject.service';
class ElectronServiceMock {
public isElectronApp: boolean;
}
fdescribe('DefaultLayoutComponent', () => {
describe('DefaultLayoutComponent', () => {
let component: DefaultLayoutComponent;
let fixture: ComponentFixture<DefaultLayoutComponent>;
let electronServiceMock: ElectronServiceMock;
@ -44,6 +45,10 @@ fdescribe('DefaultLayoutComponent', () => {
provide: ToasterService,
useClass: MockedToasterService
},
{
provide: RecentlyOpenedProjectService,
useClass: RecentlyOpenedProjectService
},
ProgressService
]
}).compileComponents();