mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2024-12-30 17:56:55 +00:00
I complete unit test case to confirmations for delete all project
This commit is contained in:
parent
3bbd755d0a
commit
845f1f1ad8
@ -1,13 +1,42 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { MatCheckboxModule } from '@angular/material/checkbox';
|
||||
import { MatDialogModule, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
|
||||
import { MatIconModule } from '@angular/material/icon';
|
||||
import { MatMenuModule } from '@angular/material/menu';
|
||||
import { MatToolbarModule } from '@angular/material/toolbar';
|
||||
import { MockedProjectService } from '../../../services/project.service.spec';
|
||||
import { MockedToasterService } from '../../../services/toaster.service.spec';
|
||||
import { ProjectService } from '../../../services/project.service';
|
||||
import { ServerService } from '../../../services/server.service';
|
||||
import { MockedServerService } from '../../../services/server.service.spec';
|
||||
import { ToasterService } from '../../../services/toaster.service';
|
||||
|
||||
import { ConfirmationDeleteAllProjectsComponent } from './confirmation-delete-all-projects.component';
|
||||
|
||||
describe('ConfirmationDeleteAllProjectsComponent', () => {
|
||||
let component: ConfirmationDeleteAllProjectsComponent;
|
||||
let fixture: ComponentFixture<ConfirmationDeleteAllProjectsComponent>;
|
||||
let mockedServerService = new MockedServerService();
|
||||
let mockedImageManagerService = new MockedProjectService()
|
||||
let mockedToasterService = new MockedToasterService()
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [
|
||||
MatIconModule,
|
||||
MatToolbarModule,
|
||||
MatMenuModule,
|
||||
MatCheckboxModule,
|
||||
MatDialogModule,
|
||||
],
|
||||
providers: [
|
||||
{ provide: ServerService, useValue: mockedServerService },
|
||||
{ provide: ProjectService, useValue: mockedImageManagerService },
|
||||
{ provide: MAT_DIALOG_DATA, useValue: {} },
|
||||
{ provide: MatDialogRef, useValue: {} },
|
||||
{ provide: ToasterService, useValue: mockedToasterService },
|
||||
|
||||
],
|
||||
declarations: [ ConfirmationDeleteAllProjectsComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { Component, Inject, OnInit } from '@angular/core';
|
||||
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
|
||||
import { ProjectService } from '@services/project.service';
|
||||
import { ToasterService } from '@services/toaster.service';
|
||||
import { ProjectService } from '../../../services/project.service';
|
||||
import { ToasterService } from '../../../services/toaster.service';
|
||||
import { Observable, of } from 'rxjs';
|
||||
import { catchError } from 'rxjs/operators';
|
||||
|
||||
|
@ -4,7 +4,7 @@ import { MatBottomSheet } from '@angular/material/bottom-sheet';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { MatSort, MatSortable } from '@angular/material/sort';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { ExportPortableProjectComponent } from '@components/export-portable-project/export-portable-project.component';
|
||||
import { ExportPortableProjectComponent } from '../../components/export-portable-project/export-portable-project.component';
|
||||
import { ElectronService } from 'ngx-electron';
|
||||
import { BehaviorSubject, merge, Observable } from 'rxjs';
|
||||
import { map } from 'rxjs//operators';
|
||||
|
Loading…
Reference in New Issue
Block a user