Skip to content

Commit 7a14a2a

Browse files
[fix]UT
1 parent 89c7455 commit 7a14a2a

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

test/mapboxgl/overlay/GraticuleLayerSpec.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -174,18 +174,20 @@ describe('mapboxgl_GraticuleLayer', () => {
174174
expect(points[0][1]).toEqual(80);
175175
});
176176

177-
it('onRemove', () => {
178-
graticuleLayer.onRemove();
179-
expect(graticuleLayer.renderer.canvas).toBeNull();
180-
});
181-
182177
it('_initialize visible', (done) => {
183-
setTimeout(() => {
178+
try {
184179
const graticuleLayer = new GraticuleLayer({ layerID: 'graticuleLayer_test', visible: false });
185180
map.addLayer(graticuleLayer);
186181
var visible = map.getLayoutProperty('graticuleLayer_test_line', 'visibility');
187182
expect(visible).toBe('none');
188183
done();
189-
}, 0);
184+
} catch (error) {
185+
console.log(error);
186+
}
187+
});
188+
189+
it('onRemove', () => {
190+
graticuleLayer.onRemove();
191+
expect(graticuleLayer.renderer.canvas).toBeNull();
190192
});
191193
});

0 commit comments

Comments
 (0)