mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-29 16:10:07 +00:00
fix(map): keep the world-copy fix inside the CI ratchets
Moves the Leaflet map's event bridges (click, context menu, viewport, POI drop and the longitude-frame follower) out of MapView into leafletMapBridges, and shares one POI drop target between the Leaflet and GL maps, so both map files shrink instead of growing. The repair migration does its arithmetic in one UPDATE per table, and the new tests drop their non-null assertions and loops.
This commit is contained in:
@@ -60,7 +60,7 @@ async function seed(orm: MikroORM): Promise<void> {
|
||||
await rawExec(
|
||||
orm,
|
||||
`INSERT INTO place_contrib_outbox (id, contrib_key, field, value, place_id, place_name, lat, lng, cid, eligible_at, next_attempt_at)
|
||||
VALUES (1, 'k1', 'name', 'x', 1, 'right-hand copy', 10.14, 274.921875, 'c1', '2026-01-01', '2026-01-01')`,
|
||||
VALUES (1, 'k1', 'website', 'x', 1, 'right-hand copy', 10.14, 274.921875, 'c1', '2026-01-01', '2026-01-01')`,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -108,16 +108,28 @@ describe('longitude on write', () => {
|
||||
it('LNGWRITE-002: a place on the real world, the edges included, is written as it came', async () => {
|
||||
const { user } = createUser(testDb);
|
||||
const trip = createTrip(testDb, user.id);
|
||||
for (const lng of [-118.4, 180, -180]) {
|
||||
const id = await places.insertTourPlace({
|
||||
trip_id: trip.id,
|
||||
name: `At ${lng}`,
|
||||
lat: 0,
|
||||
lng,
|
||||
route_geometry: null,
|
||||
});
|
||||
expect(await storedLng(id)).toBe(lng);
|
||||
}
|
||||
const west = await places.insertTourPlace({
|
||||
trip_id: trip.id,
|
||||
name: 'West',
|
||||
lat: 0,
|
||||
lng: -118.4,
|
||||
route_geometry: null,
|
||||
});
|
||||
const edge = await places.insertTourPlace({
|
||||
trip_id: trip.id,
|
||||
name: 'Edge',
|
||||
lat: 0,
|
||||
lng: 180,
|
||||
route_geometry: null,
|
||||
});
|
||||
const otherEdge = await places.insertTourPlace({
|
||||
trip_id: trip.id,
|
||||
name: 'Other edge',
|
||||
lat: 0,
|
||||
lng: -180,
|
||||
route_geometry: null,
|
||||
});
|
||||
expect([await storedLng(west), await storedLng(edge), await storedLng(otherEdge)]).toEqual([-118.4, 180, -180]);
|
||||
});
|
||||
|
||||
it('LNGWRITE-003: tour places and their route rewrites wrap too', async () => {
|
||||
|
||||
Reference in New Issue
Block a user