Skip to content

Commit 7ab5c76

Browse files
[fix]UT
1 parent 739a910 commit 7ab5c76

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

test/maplibregl/core/MapExtendSpec.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import maplibregl from 'maplibre-gl';
22
import '../../../src/maplibregl/core/MapExtend';
3+
import { FetchRequest } from '../../../src/common/util/FetchRequest';
34

45
describe('maplibregl MapExtend', () => {
56
var url = 'http://supermapiserver:8090/iserver/services/map-china400/rest/maps/China';
@@ -104,10 +105,6 @@ describe('maplibregl MapExtend', () => {
104105
)
105106
);
106107
}
107-
108-
if (url.includes('vectorstyles')) {
109-
return Promise.resolve(new Response(JSON.stringify({})));
110-
}
111108
});
112109
});
113110
afterAll(() => {
@@ -117,6 +114,8 @@ describe('maplibregl MapExtend', () => {
117114

118115
it('listLayers', (done) => {
119116
map.style._order = ['raster', 'fill-1', 'circle-1', 'l7_layer_1'];
117+
const mockLayer = { recalculate: () => {}, isHidden: () => true, setEventedParent: () => {} };
118+
map.style._layers = { raster: mockLayer, 'fill-1': mockLayer, 'circle-1': mockLayer, l7_layer_1: mockLayer };
120119
map.overlayLayersManager = { l7_layer_1: { id: 'l7_layer_1' }, heatmap_1: { id: 'heatmap_1' } };
121120
const layers = map.listLayers();
122121
expect(layers).toEqual(['raster', 'fill-1', 'circle-1', 'l7_layer_1', 'heatmap_1']);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy