Skip to content

Commit

Permalink
test: swipe
Browse files Browse the repository at this point in the history
  • Loading branch information
lvisei committed Mar 29, 2024
1 parent bf55b1b commit e343cb4
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
17 changes: 17 additions & 0 deletions packages/component/__tests__/swipe.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { TestScene } from '@antv/l7-test-utils';
import Swipe from '../src/control/swipe';

describe('swipe', () => {
const scene = TestScene();

it('life cycle', () => {
const swipe = new Swipe();
scene.addControl(swipe);

const container = swipe.getContainer();
expect(container.parentElement).toBeInstanceOf(HTMLElement);

scene.removeControl(swipe);
expect(container.parentElement).not.toBeInstanceOf(HTMLElement);
});
});
4 changes: 3 additions & 1 deletion packages/layers/__tests__/tile/raster-tile.spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import type { Scene } from '@antv/l7-scene';
import { TestScene } from '@antv/l7-test-utils';
import RasterLayer from '../../src/raster/index';

describe('raster-tile', () => {
let scene: any;
let scene: Scene;
beforeEach(() => {
scene = TestScene();
});
Expand All @@ -20,5 +21,6 @@ describe('raster-tile', () => {
});

scene.addLayer(layer1);
scene.setZoom(12);
});
});
1 change: 1 addition & 0 deletions packages/layers/__tests__/tile/vector-tile.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,6 @@ describe('vector-tile', () => {
.size(10);

scene.addLayer(layer);
scene.setZoom(12);
});
});

0 comments on commit e343cb4

Please sign in to comment.