mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2024-12-20 21:43:06 +00:00
Unit tests added
This commit is contained in:
parent
06290a2dec
commit
d7f4aeb7d8
@ -0,0 +1,47 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { MatCheckboxModule, MatIconModule, MatToolbarModule, MatMenuModule, MatTableModule } from '@angular/material';
|
||||
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
||||
import { CustomAdaptersComponent } from './custom-adapters.component';
|
||||
|
||||
describe('Custom adapters component', () => {
|
||||
let component: CustomAdaptersComponent;
|
||||
let fixture: ComponentFixture<CustomAdaptersComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [MatTableModule, MatIconModule, MatToolbarModule, MatMenuModule, MatCheckboxModule, CommonModule, NoopAnimationsModule],
|
||||
declarations: [
|
||||
CustomAdaptersComponent
|
||||
],
|
||||
schemas: [NO_ERRORS_SCHEMA]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(CustomAdaptersComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
|
||||
it('should emit event when apply clicked', () => {
|
||||
spyOn(component.saveConfigurationEmitter, 'emit');
|
||||
|
||||
component.configureCustomAdapters();
|
||||
|
||||
expect(component.saveConfigurationEmitter.emit).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('should emit event when cancel clicked', () => {
|
||||
spyOn(component.closeConfiguratorEmitter, 'emit');
|
||||
|
||||
component.cancelConfigureCustomAdapters();
|
||||
|
||||
expect(component.closeConfiguratorEmitter.emit).toHaveBeenCalled();
|
||||
});
|
||||
});
|
Loading…
Reference in New Issue
Block a user