mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2024-12-19 04:57:51 +00:00
Tests updated
This commit is contained in:
parent
4bb9b98154
commit
f92894d4c2
@ -1,5 +1,5 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { MatIconModule, MatSortModule, MatTableModule, MatTooltipModule, MatDialogModule, MatFormFieldModule, MatInputModule, MatDialogRef } from '@angular/material';
|
||||
import { MatIconModule, MatSortModule, MatTableModule, MatTooltipModule, MatDialogModule, MatFormFieldModule, MatInputModule, MatDialogRef, MatDialogContainer } from '@angular/material';
|
||||
import { RouterTestingModule } from '@angular/router/testing';
|
||||
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||
|
||||
@ -21,6 +21,7 @@ import { NO_ERRORS_SCHEMA } from '@angular/core';
|
||||
import { ProjectsFilter } from '../../filters/projectsFilter.pipe';
|
||||
import { ChooseNameDialogComponent } from './choose-name-dialog/choose-name-dialog.component';
|
||||
import { BrowserDynamicTestingModule } from '@angular/platform-browser-dynamic/testing';
|
||||
import { OverlayRef } from '@angular/cdk/overlay';
|
||||
|
||||
describe('ProjectsComponent', () => {
|
||||
let component: ProjectsComponent;
|
||||
@ -97,15 +98,12 @@ describe('ProjectsComponent', () => {
|
||||
expect(mockedProjectService.delete).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('should call open dialog after duplicate action', () => {
|
||||
spyOn(component.dialog, 'open').and.callThrough();
|
||||
let project = new Project();
|
||||
project.project_id = '1';
|
||||
project.status = 'closed';
|
||||
it('should call list on refresh', () => {
|
||||
mockedProjectService.list = jasmine.createSpy().and.returnValue(of([]));
|
||||
|
||||
component.duplicate(project);
|
||||
component.refresh();
|
||||
|
||||
expect(component.dialog.open).toHaveBeenCalled();
|
||||
expect(mockedProjectService.list).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
describe('ProjectComponent open', () => {
|
||||
|
@ -79,10 +79,7 @@ describe('ServerService', () => {
|
||||
const upgradeCallback = openDatabaseSpy.calls.first().args[1];
|
||||
upgradeCallback(evnt);
|
||||
|
||||
expect(evnt.currentTarget.result.createObjectStore).toHaveBeenCalledWith('servers', {
|
||||
keyPath: 'id',
|
||||
autoIncrement: true
|
||||
});
|
||||
expect(evnt.currentTarget.result.createObjectStore).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
describe('operations on records', () => {
|
||||
|
Loading…
Reference in New Issue
Block a user