From 40ec157869354a088cdd5e214d7d196ddc6fd9a1 Mon Sep 17 00:00:00 2001 From: Jannis R Date: Thu, 20 May 2021 16:40:36 +0100 Subject: [PATCH] =?UTF-8?q?BVG/VBB=20integration/E2E=20tests:=20don'=20try?= =?UTF-8?q?=20to=20identify=20stations=20=E2=9C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 3 +-- test/e2e/bvg.js | 8 -------- test/e2e/lib/vbb-bvg-validators.js | 33 ++++-------------------------- 3 files changed, 5 insertions(+), 39 deletions(-) diff --git a/package.json b/package.json index 56d75721..3ab1abae 100644 --- a/package.json +++ b/package.json @@ -69,8 +69,7 @@ "replayer": "^2.2.3", "tap-spec": "^5.0.0", "tape": "^5.0.0", - "validate-fptf": "^3.0.0", - "vbb-stations-autocomplete": "^4.1.0" + "validate-fptf": "^3.0.0" }, "scripts": { "lint": "eslint .", diff --git a/test/e2e/bvg.js b/test/e2e/bvg.js index 818d593d..20b126eb 100644 --- a/test/e2e/bvg.js +++ b/test/e2e/bvg.js @@ -2,8 +2,6 @@ // todo: DRY with vbb tests -const stations = require('vbb-stations-autocomplete') -const shorten = require('vbb-short-station-name') const isRoughlyEqual = require('is-roughly-equal') const {DateTime} = require('luxon') const flatMap = require('lodash/flatMap') @@ -37,12 +35,6 @@ const testReachableFrom = require('./lib/reachable-from') const when = cfg.when -const validateDirection = (dir, name) => { - if (!stations(dir, true, false)[0]) { - console.error(name + `: station "${dir}" is unknown`) - } -} - const validate = createValidate(cfg, { station: validateStation, line: validateLine, diff --git a/test/e2e/lib/vbb-bvg-validators.js b/test/e2e/lib/vbb-bvg-validators.js index 4cbcace8..049bea93 100644 --- a/test/e2e/lib/vbb-bvg-validators.js +++ b/test/e2e/lib/vbb-bvg-validators.js @@ -1,8 +1,6 @@ 'use strict' -const stations = require('vbb-stations-autocomplete') const a = require('assert') -const shorten = require('vbb-short-station-name') const products = require('../../../p/bvg/products') const {createWhen} = require('./util') @@ -22,19 +20,8 @@ const cfg = { products } -const validateDirection = (dir, name) => { - if (!stations(dir, true, false)[0]) { - console.error(name + `: station "${dir}" is unknown`) - } -} - // todo: coordsOptional = false -const _validateStation = createValidateStation(cfg) -const validateStation = (validate, s, name) => { - _validateStation(validate, s, name) - // todo: find station by ID - a.equal(s.name, shorten(s.name), name + '.name must be shortened') -} +const validateStation = createValidateStation(cfg) const _validateLine = createValidateLine(cfg) const validateLine = (validate, l, name) => { @@ -58,23 +45,11 @@ const validateLine = (validate, l, name) => { } } -const _validateJourneyLeg = createValidateJourneyLeg(cfg) -const validateJourneyLeg = (validate, l, name) => { - _validateJourneyLeg(validate, l, name) - if (!l.walking) validateDirection(l.direction, name + '.direction') -} +const validateJourneyLeg = createValidateJourneyLeg(cfg) -const _validateDeparture = createValidateDeparture(cfg) -const validateDeparture = (validate, dep, name) => { - _validateDeparture(validate, dep, name) - validateDirection(dep.direction, name + '.direction') -} +const validateDeparture = createValidateDeparture(cfg) -const _validateMovement = createValidateMovement(cfg) -const validateMovement = (validate, m, name) => { - _validateMovement(validate, m, name) - validateDirection(m.direction, name + '.direction') -} +const validateMovement = createValidateMovement(cfg) module.exports = { cfg,