@@ -3,8 +3,10 @@ import {
3
3
Priority ,
4
4
StopAreaInput ,
5
5
StopInsertInput ,
6
+ StopRegistryGeoJsonType ,
6
7
StopRegistryNameType ,
7
8
StopRegistryTransportModeType ,
9
+ TerminalInput ,
8
10
buildStop ,
9
11
buildTimingPlace ,
10
12
extractInfrastructureLinkIdsFromResponse ,
@@ -141,6 +143,35 @@ const stopAreaInput: Array<StopAreaInput> = [
141
143
} ,
142
144
] ;
143
145
146
+ const terminalH2003 : TerminalInput = {
147
+ terminal : {
148
+ privateCode : { type : 'HSL/TEST' , value : 'TH2003' } ,
149
+ name : { lang : 'fin' , value : 'E2ETH2003' } ,
150
+ description : { lang : 'fin' , value : 'E2E testiterminaali H2003' } ,
151
+ geometry : {
152
+ coordinates : [ 24.92596546020357 , 60.16993494912799 ] ,
153
+ type : StopRegistryGeoJsonType . Point ,
154
+ } ,
155
+ keyValues : [
156
+ { key : 'validityStart' , values : [ '2020-01-01' ] } ,
157
+ { key : 'validityEnd' , values : [ '2050-01-01' ] } ,
158
+ { key : 'streetAddress' , values : [ 'Mannerheimintie 22-24' ] } ,
159
+ { key : 'postalCode' , values : [ '00100' ] } ,
160
+ { key : 'municipality' , values : [ 'Helsinki' ] } ,
161
+ { key : 'fareZone' , values : [ 'A' ] } ,
162
+ { key : 'terminalType' , values : [ 'BusTerminal' ] } ,
163
+ { key : 'departurePlatforms' , values : [ '7' ] } ,
164
+ { key : 'arrivalPlatforms' , values : [ '6' ] } ,
165
+ { key : 'loadingPlatforms' , values : [ '3' ] } ,
166
+ { key : 'electricCharging' , values : [ '2' ] } ,
167
+ ] ,
168
+ externalLinks : [
169
+ { name : 'Terminaalin Testilinkki' , location : 'https://terminaltest.fi' } ,
170
+ ] ,
171
+ } ,
172
+ memberLabels : [ 'H2003' ] ,
173
+ } ;
174
+
144
175
const buildScheduledStopPoints = (
145
176
infrastructureLinkIds : UUID [ ] ,
146
177
) : StopInsertInput [ ] => [
@@ -223,9 +254,7 @@ describe('Stop details', () => {
223
254
insertToDbHelper ( dbResources ) ;
224
255
toast = new Toast ( ) ;
225
256
cy . task < InsertedStopRegistryIds > ( 'insertStopRegistryData' , {
226
- // Inserting the terminals here causes it's child stop H0003,
227
- // to generate extra versions of it's quay, which breaks info spots.
228
- // terminals: seedTerminals,
257
+ terminals : [ terminalH2003 ] ,
229
258
stopPlaces : stopAreaInput ,
230
259
organisations : seedOrganisations ,
231
260
infoSpots : seedInfoSpots ,
@@ -264,14 +293,15 @@ describe('Stop details', () => {
264
293
locationView . getLongitude ( ) . shouldHaveText ( '24.932072417514647' ) ;
265
294
locationView . getAltitude ( ) . shouldHaveText ( '0' ) ;
266
295
locationView . getFunctionalArea ( ) . shouldHaveText ( '20 m' ) ;
267
- locationView . getStopArea ( ) . shouldHaveText ( '-' ) ;
268
- locationView . getStopAreaName ( ) . shouldHaveText ( '-' ) ;
269
- locationView . getStopAreaStops ( ) . shouldHaveText ( '-' ) ;
270
296
locationView . getQuay ( ) . shouldHaveText ( '-' ) ;
271
297
locationView . getStopAreaQuays ( ) . shouldHaveText ( '-' ) ;
272
- locationView . getTerminal ( ) . shouldHaveText ( '-' ) ;
273
- locationView . getTerminalName ( ) . shouldHaveText ( '-' ) ;
274
- locationView . getTerminalStops ( ) . shouldHaveText ( '-' ) ;
298
+ locationView . getTerminalPrivateCode ( ) . shouldHaveText ( 'TH2003' ) ;
299
+ locationView
300
+ . getTerminalLink ( )
301
+ . shouldBeVisible ( )
302
+ . should ( 'have.attr' , 'href' , `/stop-registry/terminals/TH2003` ) ;
303
+ locationView . getTerminalName ( ) . shouldHaveText ( 'E2ETH2003' ) ;
304
+ locationView . getTerminalStops ( ) . shouldHaveText ( 'H2003' ) ;
275
305
} ;
276
306
277
307
const verifyInitialSignageDetails = ( ) => {
0 commit comments