From 102c4bf2a5639170d05db749ccb12ac35bcc2ea7 Mon Sep 17 00:00:00 2001 From: Jannis R Date: Tue, 19 Oct 2021 00:35:45 +0200 Subject: [PATCH] =?UTF-8?q?BVG/VBB:=20fix=20nearby()=20integration/E2E=20t?= =?UTF-8?q?est=20=E2=9C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/e2e/bvg.js | 8 ++++++-- test/e2e/vbb.js | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/test/e2e/bvg.js b/test/e2e/bvg.js index 49373a06..f19b42be 100644 --- a/test/e2e/bvg.js +++ b/test/e2e/bvg.js @@ -367,7 +367,10 @@ tap.test('nearby', async (t) => { type: 'location', latitude: 52.4873452, longitude: 13.3310411 - }, {distance: 300}) + }, { + // Even though HAFAS reports Landhausstr. to be 179m, we have to pass way more here. 🙄 + distance: 600, + }) validate(t, nearby, 'locations', 'nearby') @@ -376,7 +379,8 @@ tap.test('nearby', async (t) => { t.ok(nearby[0].distance > 0) t.ok(nearby[0].distance < 100) - t.equal(nearby[1].id, landhausstr) + const res = nearby.find(s => s.id === landhausstr) + t.ok(res, `Landhausstr. ${landhausstr} is not among the nearby stops`) t.equal(nearby[1].name, 'Landhausstr.') t.ok(nearby[1].distance > 100) t.ok(nearby[1].distance < 200) diff --git a/test/e2e/vbb.js b/test/e2e/vbb.js index 3ba83d6c..1dbfa38e 100644 --- a/test/e2e/vbb.js +++ b/test/e2e/vbb.js @@ -319,7 +319,10 @@ tap.test('nearby', async (t) => { type: 'location', latitude: 52.4873452, longitude: 13.3310411 - }, {distance: 250}) + }, { + // Even though HAFAS reports Landhausstr. to be 179m, we have to pass way more here. 🙄 + distance: 600, + }) validate(t, nearby, 'locations', 'nearby') @@ -328,7 +331,8 @@ tap.test('nearby', async (t) => { t.ok(nearby[0].distance > 0) t.ok(nearby[0].distance < 100) - t.equal(nearby[1].id, landhausstr) + const res = nearby.find(s => s.id === landhausstr) + t.ok(res, `Landhausstr. ${landhausstr} is not among the nearby stops`) t.equal(nearby[1].name, 'Landhausstr.') t.ok(nearby[1].distance > 100) t.ok(nearby[1].distance < 200)