Skip to content

Commit

Permalink
[fix]UT
Browse files Browse the repository at this point in the history
  • Loading branch information
luoxiao-supermap committed Aug 12, 2024
1 parent 89c7455 commit 7a14a2a
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions test/mapboxgl/overlay/GraticuleLayerSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,18 +174,20 @@ describe('mapboxgl_GraticuleLayer', () => {
expect(points[0][1]).toEqual(80);
});

it('onRemove', () => {
graticuleLayer.onRemove();
expect(graticuleLayer.renderer.canvas).toBeNull();
});

it('_initialize visible', (done) => {
setTimeout(() => {
try {
const graticuleLayer = new GraticuleLayer({ layerID: 'graticuleLayer_test', visible: false });
map.addLayer(graticuleLayer);
var visible = map.getLayoutProperty('graticuleLayer_test_line', 'visibility');
expect(visible).toBe('none');
done();
}, 0);
} catch (error) {
console.log(error);
}
});

it('onRemove', () => {
graticuleLayer.onRemove();
expect(graticuleLayer.renderer.canvas).toBeNull();
});
});

0 comments on commit 7a14a2a

Please sign in to comment.