@@ -126,7 +126,7 @@ describe('openlayers_GraphicLayer', () => {
126
126
} ) ;
127
127
} ) ;
128
128
129
- xit ( 'constructor_webgl' , ( done ) => {
129
+ it ( 'constructor_webgl' , ( done ) => {
130
130
spyOn ( FetchRequest , 'commit' ) . and . callFake ( ( ) => {
131
131
return Promise . resolve ( new Response ( escapedJson ) ) ;
132
132
} ) ;
@@ -182,7 +182,7 @@ describe('openlayers_GraphicLayer', () => {
182
182
} ) ;
183
183
} ) ;
184
184
185
- xit ( 'CloverShape' , ( done ) => {
185
+ it ( 'CloverShape' , ( done ) => {
186
186
spyOn ( FetchRequest , 'commit' ) . and . callFake ( ( ) => {
187
187
return Promise . resolve ( new Response ( escapedJson ) ) ;
188
188
} ) ;
@@ -259,9 +259,9 @@ describe('openlayers_GraphicLayer', () => {
259
259
260
260
let pixel = map . getPixelFromCoordinate ( [ - 36.16 , 39.05 ] ) ;
261
261
map . forEachFeatureAtPixel ( pixel ,
262
- ( graphic ) => {
262
+ ( graphic , layer ) => {
263
263
expect ( graphic ) . not . toBeNull ( ) ;
264
- console . log ( graphic ) ;
264
+ expect ( layer ) . toEqual ( graphicLayer ) ;
265
265
} ) ;
266
266
// map.removeLayer(graphicLayer);
267
267
done ( ) ;
@@ -299,6 +299,16 @@ describe('openlayers_GraphicLayer', () => {
299
299
const graphicSource = graphicLayer . getSource ( ) ;
300
300
graphicSource . addGraphics ( graphics ) ;
301
301
expect ( graphicSource . graphics . length ) . toEqual ( 10 ) ;
302
+ graphicLayer . getSource ( ) . _forEachFeatureAtCoordinate ( [ - 35.16 , 38.05 ] , 1 , ( result ) => {
303
+ expect ( result ) . not . toBeNull ( ) ;
304
+ } ) ;
305
+
306
+ let pixel = map . getPixelFromCoordinate ( [ - 35.16 , 38.05 ] ) ;
307
+ map . forEachFeatureAtPixel ( pixel ,
308
+ ( graphic , layer ) => {
309
+ expect ( graphic ) . toBe ( graphics [ 0 ] ) ;
310
+ expect ( layer ) . toBe ( graphicLayer ) ;
311
+ } ) ;
302
312
done ( ) ;
303
313
} , 4000 ) ;
304
314
} ) ;
0 commit comments