mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2025-06-22 16:39:00 +00:00
Drop shared directories
This commit is contained in:
48
src/app/common/progress/progress.component.spec.ts
Normal file
48
src/app/common/progress/progress.component.spec.ts
Normal file
@ -0,0 +1,48 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { ProgressComponent } from './progress.component';
|
||||
import { MatProgressSpinnerModule } from "@angular/material";
|
||||
import { ProgressService } from "./progress.service";
|
||||
|
||||
describe('ProgressComponent', () => {
|
||||
let component: ProgressComponent;
|
||||
let fixture: ComponentFixture<ProgressComponent>;
|
||||
let progressService: ProgressService;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
MatProgressSpinnerModule,
|
||||
],
|
||||
providers: [ ProgressService ],
|
||||
declarations: [ ProgressComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
|
||||
progressService = TestBed.get(ProgressService);
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(ProgressComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create and be invisible', () => {
|
||||
expect(component).toBeTruthy();
|
||||
expect(component.visible).toEqual(false);
|
||||
});
|
||||
|
||||
it( 'should change visibility when activated', () => {
|
||||
progressService.activate();
|
||||
expect(component.visible).toEqual(true);
|
||||
});
|
||||
|
||||
it( 'should change visibility when deactivated', () => {
|
||||
component.visible = true;
|
||||
|
||||
progressService.deactivate();
|
||||
expect(component.visible).toEqual(false);
|
||||
});
|
||||
|
||||
});
|
Reference in New Issue
Block a user