mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2025-06-21 07:58:25 +00:00
Merge branch 'master' into Extend-context-menu-with-option-to-duplicate
This commit is contained in:
@ -45,6 +45,8 @@ import { CapturingSettings } from '../../models/capturingSettings';
|
||||
import { LinkWidget } from '../../cartography/widgets/link';
|
||||
import { MapScaleService } from '../../services/mapScale.service';
|
||||
import { NodeCreatedLabelStylesFixer } from './helpers/node-created-label-styles-fixer';
|
||||
import { MapSettingService } from '../../services/mapsettings.service';
|
||||
import { ProjectMapMenuComponent } from './project-map-menu/project-map-menu.component';
|
||||
|
||||
export class MockedProgressService {
|
||||
public activate() {}
|
||||
@ -231,10 +233,11 @@ describe('ProjectMapComponent', () => {
|
||||
provide: RecentlyOpenedProjectService,
|
||||
useClass: RecentlyOpenedProjectService
|
||||
},
|
||||
{ provide: NodeCreatedLabelStylesFixer, useValue: nodeCreatedLabelStylesFixer},
|
||||
{ provide: MapScaleService },
|
||||
{ provide: NodeCreatedLabelStylesFixer, useValue: nodeCreatedLabelStylesFixer}
|
||||
],
|
||||
declarations: [ProjectMapComponent, D3MapComponent, ...ANGULAR_MAP_DECLARATIONS],
|
||||
declarations: [ProjectMapComponent, ProjectMapMenuComponent, D3MapComponent, ...ANGULAR_MAP_DECLARATIONS],
|
||||
schemas: [NO_ERRORS_SCHEMA]
|
||||
}).compileComponents();
|
||||
}));
|
||||
@ -242,6 +245,9 @@ describe('ProjectMapComponent', () => {
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(ProjectMapComponent);
|
||||
component = fixture.componentInstance;
|
||||
component.projectMapMenuComponent = {
|
||||
resetDrawToolChoice(){}
|
||||
} as ProjectMapMenuComponent;
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
@ -255,20 +261,12 @@ describe('ProjectMapComponent', () => {
|
||||
it('should hide draw tools when hide menu is called', () => {
|
||||
var dummyElement = document.createElement('map');
|
||||
document.getElementsByClassName = jasmine.createSpy('HTML element').and.callFake(() => {
|
||||
return [dummyElement];
|
||||
return [dummyElement];
|
||||
});
|
||||
spyOn(component, 'resetDrawToolChoice');
|
||||
spyOn(component.projectMapMenuComponent, 'resetDrawToolChoice').and.returnValue();
|
||||
|
||||
component.hideMenu();
|
||||
|
||||
expect(component.resetDrawToolChoice).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('should reset choice on draw menu after saving drawing', () => {
|
||||
spyOn(component, 'resetDrawToolChoice');
|
||||
|
||||
component.onDrawingSaved();
|
||||
|
||||
expect(component.resetDrawToolChoice).toHaveBeenCalled();
|
||||
expect(component.projectMapMenuComponent.resetDrawToolChoice).toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user