Skip to content

Commit ef3ac7b

Browse files
[fix]UT
1 parent 933146d commit ef3ac7b

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

test/openlayers/overlay/GraphicSpec.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -683,7 +683,20 @@ describe('openlayers_GraphicLayer', () => {
683683
})
684684
});
685685
map.addLayer(graphicLayer);
686+
const source = graphicLayer.getSource();
687+
source._forEachFeatureAtCoordinate([0, 0], 1, (result) => {
688+
expect(result).not.toBeNull();
689+
});
690+
const res = source.findGraphicByPixel({pixel: [0,0]}, source);
691+
expect(res).toBeUndefined();
692+
const res1 = source.getDeckglArguments(source, {pixel: [0,0]}, graphics[0]);
693+
expect(res1).not.toBeNull();
694+
let pixel = map.getPixelFromCoordinate([0, 0]);
695+
map.forEachFeatureAtPixel(pixel, (graphic, layer) => {
696+
expect(graphic).toBe(graphics[0]);
697+
expect(layer).toBe(graphicLayer);
698+
});
686699
done();
687-
})
700+
});
688701
})
689702
});

0 commit comments

Comments
 (0)