test: 1.完善 LayerControl 单测

This commit is contained in:
yanxiong 2022-08-31 15:12:26 +08:00
parent 3bdaeb67cd
commit 0d18636ffa
1 changed files with 12 additions and 25 deletions

View File

@ -1,32 +1,19 @@
// import { LineLayer, PointLayer } from '@antv/l7-layers';
import { TestScene } from '@antv/l7-test-utils'; import { TestScene } from '@antv/l7-test-utils';
// import LayerControl from '../src/control/layerControl'; import LayerControl from '../src/control/layerControl';
describe('layerControl', () => { describe('layerControl', () => {
const scene = TestScene(); const scene = TestScene();
it('layerControl', () => { it('life cycle', () => {
// const pointLayer = new PointLayer(); const layerControl = new LayerControl();
// const lineLayer = new LineLayer(); scene.addControl(layerControl);
// const control = new LayerControl({});
// scene.addLayer(pointLayer); const container = layerControl.getContainer();
// scene.addControl(control); expect(container.parentElement).toBeInstanceOf(HTMLElement);
//
// const options = control.getOptions().options; expect(layerControl.getLayerVisible()).toEqual([]);
// expect(options.length).toBeGreaterThan(0);
// expect(control.getSelectValue()).toEqual( scene.removeControl(layerControl);
// 'mapbox://styles/mapbox/streets-v11', expect(container.parentElement).not.toBeInstanceOf(HTMLElement);
// );
//
// const optionList = ((control
// .getPopper()
// .getContent() as HTMLDivElement).querySelectorAll(
// '.l7-select-control-item',
// ) as unknown) as HTMLDivElement[];
// optionList[1].click();
//
// expect(control.getSelectValue()).toEqual(
// 'mapbox://styles/zcxduo/ck2ypyb1r3q9o1co1766dex29',
// );
}); });
}); });