Skip to content

Commit 54bd20f

Browse files
[fix]UT
AI-GEN: 70% Cursor
1 parent c389b8d commit 54bd20f

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

‎test/mapboxgl/mapping/VideoMapSpec.js‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,15 +106,15 @@ describe('mapboxgl_videoMap', () => {
106106
videoMap.videoWidth = 100;
107107
videoMap.videoHeight = 100;
108108
spyOn(videoMap.coordTransfer, 'toSpatialCoordinate').and.returnValue([13358338.895192828, 3503549.8435043753, 0]);
109+
var projectedPoint = { x: 10, y: 20 };
110+
spyOn(videoMap.map, 'project').and.returnValue(projectedPoint);
109111
videoMap.map.fire('click', { lngLat: { lng: 120, lat: 30 }, point: { x: 10, y: 20 } });
110112
expect(clickEvent.lngLat.lng).toBeCloseTo(120, 6);
111113
expect(clickEvent.lngLat.lat).toBeCloseTo(30, 6);
112-
expect(clickEvent.point).toEqual({ x: 10, y: 20 });
114+
expect(clickEvent.point).toBe(projectedPoint);
113115
expect(clickEvent.mapEvent.lngLat).toEqual({ lng: 120, lat: 30 });
114116
var container = {};
115-
var projectedPoint = { x: 10, y: 20 };
116117
spyOn(videoMap.map, 'getContainer').and.returnValue(container);
117-
videoMap.map.project = jasmine.createSpy('project').and.returnValue(projectedPoint);
118118
spyOn(videoMap.coordTransfer, 'toVideoCoordinate').and.returnValue({ data64F: [50, 50] });
119119
expect(videoMap.getContainer()).toBe(container);
120120
expect(videoMap.project({ lng: 120, lat: 30 })).toBe(projectedPoint);

‎test/mapboxgl/overlay/VideoLayerSpec.js‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ describe('mapboxgl_VideoLayer', () => {
6262
},
6363
findHomography: function () {
6464
return {
65+
rows: 3,
66+
cols: 3,
6567
delete: function () { }
6668
}
6769
},

0 commit comments

Comments
 (0)