@@ -126,7 +126,7 @@ describe('openlayers_GraphicLayer', () => {
126126 } ) ;
127127 } ) ;
128128
129- xit ( 'constructor_webgl' , ( done ) => {
129+ it ( 'constructor_webgl' , ( done ) => {
130130 spyOn ( FetchRequest , 'commit' ) . and . callFake ( ( ) => {
131131 return Promise . resolve ( new Response ( escapedJson ) ) ;
132132 } ) ;
@@ -182,7 +182,7 @@ describe('openlayers_GraphicLayer', () => {
182182 } ) ;
183183 } ) ;
184184
185- xit ( 'CloverShape' , ( done ) => {
185+ it ( 'CloverShape' , ( done ) => {
186186 spyOn ( FetchRequest , 'commit' ) . and . callFake ( ( ) => {
187187 return Promise . resolve ( new Response ( escapedJson ) ) ;
188188 } ) ;
@@ -259,9 +259,9 @@ describe('openlayers_GraphicLayer', () => {
259259
260260 let pixel = map . getPixelFromCoordinate ( [ - 36.16 , 39.05 ] ) ;
261261 map . forEachFeatureAtPixel ( pixel ,
262- ( graphic ) => {
262+ ( graphic , layer ) => {
263263 expect ( graphic ) . not . toBeNull ( ) ;
264- console . log ( graphic ) ;
264+ expect ( layer ) . toEqual ( graphicLayer ) ;
265265 } ) ;
266266 // map.removeLayer(graphicLayer);
267267 done ( ) ;
@@ -299,6 +299,16 @@ describe('openlayers_GraphicLayer', () => {
299299 const graphicSource = graphicLayer . getSource ( ) ;
300300 graphicSource . addGraphics ( graphics ) ;
301301 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+ } ) ;
302312 done ( ) ;
303313 } , 4000 ) ;
304314 } ) ;
0 commit comments