From 669a7781cb2dc9b76a1daf01c3dfd546726215bc Mon Sep 17 00:00:00 2001 From: HarelM Date: Wed, 21 Aug 2024 16:40:00 +0300 Subject: [PATCH] Fix tests --- .../src/application/services/poi.service.spec.ts | 3 +++ .../src/application/services/spatial.service.spec.ts | 10 +++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/IsraelHiking.Web/src/application/services/poi.service.spec.ts b/IsraelHiking.Web/src/application/services/poi.service.spec.ts index ff37afdac..4598209fa 100644 --- a/IsraelHiking.Web/src/application/services/poi.service.spec.ts +++ b/IsraelHiking.Web/src/application/services/poi.service.spec.ts @@ -265,6 +265,9 @@ describe("Poi Service", () => { offlineState: { poisLastModifiedDate: Date.now(), uploadPoiQueue: [] + }, + configuration: { + language: { code: "he", rtl: false } } }); (runningContextService as any).isCapacitor = true; diff --git a/IsraelHiking.Web/src/application/services/spatial.service.spec.ts b/IsraelHiking.Web/src/application/services/spatial.service.spec.ts index 97810bd6a..6a967dc54 100644 --- a/IsraelHiking.Web/src/application/services/spatial.service.spec.ts +++ b/IsraelHiking.Web/src/application/services/spatial.service.spec.ts @@ -61,20 +61,20 @@ describe("Spatial service", () => { expect(clippedLines[0].geometry.coordinates[0]).toEqual([0,0]); }); - it("Should change a line that is crosses the entire tile boundary", () => { + it("Should change a line that crosses the entire tile boundary", () => { const lines = [lineString([[-1,-1], [5,5]])]; const clippedLines = SpatialService.clipLinesToTileBoundary(lines, {x: 128,y: 127}, 8); expect(clippedLines[0].geometry.coordinates[0]).toEqual([0,0]); expect(clippedLines[0].geometry.coordinates[1]).not.toEqual([5,5]); }); - it("Should split a line that is crosses the tile boundary multiple times to several lines", () => { + it("Should split a line that crosses the tile boundary multiple times to several lines", () => { const lines = [lineString([[-1,-1], [0.5,0.5], [-1, 0.5], [0.5, 0.6], [-1, 0.6], [0.7, 0.7]])]; const clippedLines = SpatialService.clipLinesToTileBoundary(lines, {x: 128,y: 127}, 8); expect(clippedLines.length).toBe(3); - expect(clippedLines[0].geometry.coordinates[0]).toEqual([0,0]); - expect(clippedLines[0].geometry.coordinates[2]).toEqual([0,0.5]); - expect(clippedLines[1].geometry.coordinates[2]).toEqual([0,0.6]); + expect(clippedLines[1].geometry.coordinates[0]).toEqual([0,0]); + expect(clippedLines[1].geometry.coordinates[2]).toEqual([0,0.5]); + expect(clippedLines[0].geometry.coordinates[2]).toEqual([0,0.6]); expect(clippedLines[2].geometry.coordinates[1]).toEqual([0.7,0.7]); });