4
4
timingPlaces ,
5
5
} from '@hsl/jore4-test-db-manager' ;
6
6
import { Tag } from '../enums' ;
7
- import { ChangeValidityForm , ModalMap } from '../pageObjects' ;
7
+ import { ChangeValidityForm , MapModal } from '../pageObjects' ;
8
8
import { FilterPanel } from '../pageObjects/FilterPanel' ;
9
9
import { insertToDbHelper , removeFromDbHelper } from '../utils' ;
10
10
import { deleteStopsByLabels } from './utils' ;
@@ -26,22 +26,22 @@ const clearDatabase = () => {
26
26
} ;
27
27
28
28
describe ( 'Stop creation tests' , ( ) => {
29
- let modalMap : ModalMap ;
29
+ let mapModal : MapModal ;
30
30
let mapFilterPanel : FilterPanel ;
31
31
let changeValidityForm : ChangeValidityForm ;
32
32
33
33
beforeEach ( ( ) => {
34
34
clearDatabase ( ) ;
35
35
insertToDbHelper ( dbResources ) ;
36
36
37
- modalMap = new ModalMap ( ) ;
37
+ mapModal = new MapModal ( ) ;
38
38
mapFilterPanel = new FilterPanel ( ) ;
39
39
changeValidityForm = new ChangeValidityForm ( ) ;
40
40
41
41
cy . setupMapTiles ( ) ;
42
42
cy . mockLogin ( ) ;
43
43
44
- modalMap . map . visit ( {
44
+ mapModal . map . visit ( {
45
45
zoom : 15 ,
46
46
lat : 60.164074274478054 ,
47
47
lng : 24.93021804533524 ,
@@ -56,7 +56,7 @@ describe('Stop creation tests', () => {
56
56
'Should create stop on map' ,
57
57
{ tags : [ Tag . Map , Tag . Stops , Tag . Smoke ] , scrollBehavior : 'bottom' } ,
58
58
( ) => {
59
- modalMap . createStopAtLocation ( {
59
+ mapModal . createStopAtLocation ( {
60
60
stopFormInfo : {
61
61
label : testStopLabels . testLabel1 ,
62
62
validityStartISODate : '2022-01-01' ,
@@ -68,9 +68,9 @@ describe('Stop creation tests', () => {
68
68
} ,
69
69
} ) ;
70
70
71
- modalMap . gqlStopShouldBeCreatedSuccessfully ( ) ;
71
+ mapModal . gqlStopShouldBeCreatedSuccessfully ( ) ;
72
72
73
- modalMap . checkStopSubmitSuccessToast ( ) ;
73
+ mapModal . checkStopSubmitSuccessToast ( ) ;
74
74
75
75
mapFilterPanel . toggleShowStops ( ReusableComponentsVehicleModeEnum . Bus ) ;
76
76
@@ -85,7 +85,7 @@ describe('Stop creation tests', () => {
85
85
{ tags : [ Tag . Stops , Tag . Map ] , scrollBehavior : 'bottom' } ,
86
86
( ) => {
87
87
// Create stop
88
- modalMap . createStopAtLocation ( {
88
+ mapModal . createStopAtLocation ( {
89
89
stopFormInfo : {
90
90
label : testStopLabels . manualCoordinatesLabel ,
91
91
// Actual coordinates will be on Topeliuksenkatu
@@ -100,12 +100,12 @@ describe('Stop creation tests', () => {
100
100
} ,
101
101
} ) ;
102
102
103
- modalMap . gqlStopShouldBeCreatedSuccessfully ( ) ;
103
+ mapModal . gqlStopShouldBeCreatedSuccessfully ( ) ;
104
104
105
- modalMap . checkStopSubmitSuccessToast ( ) ;
105
+ mapModal . checkStopSubmitSuccessToast ( ) ;
106
106
107
107
// Change map position to created stop location
108
- modalMap . map . visit ( {
108
+ mapModal . map . visit ( {
109
109
zoom : 15 ,
110
110
lat : 60.1805636468358 ,
111
111
lng : 24.918451016960763 ,
@@ -123,7 +123,7 @@ describe('Stop creation tests', () => {
123
123
'Should create stop with end time on map' ,
124
124
{ tags : [ Tag . Stops , Tag . Map ] , scrollBehavior : 'bottom' } ,
125
125
( ) => {
126
- modalMap . createStopAtLocation ( {
126
+ mapModal . createStopAtLocation ( {
127
127
stopFormInfo : {
128
128
label : testStopLabels . endDateLabel ,
129
129
validityStartISODate : '2022-01-01' ,
@@ -136,17 +136,17 @@ describe('Stop creation tests', () => {
136
136
} ,
137
137
} ) ;
138
138
139
- modalMap . gqlStopShouldBeCreatedSuccessfully ( ) ;
139
+ mapModal . gqlStopShouldBeCreatedSuccessfully ( ) ;
140
140
141
- modalMap . checkStopSubmitSuccessToast ( ) ;
141
+ mapModal . checkStopSubmitSuccessToast ( ) ;
142
142
143
143
mapFilterPanel . toggleShowStops ( ReusableComponentsVehicleModeEnum . Bus ) ;
144
144
145
145
cy . getByTestId (
146
146
`Map::Stops::stopMarker::${ testStopLabels . endDateLabel } _Standard` ,
147
147
) . click ( ) ;
148
148
149
- modalMap . map . stopPopUp . getEditButton ( ) . click ( ) ;
149
+ mapModal . map . stopPopUp . getEditButton ( ) . click ( ) ;
150
150
151
151
changeValidityForm . getEndDateInput ( ) . should ( 'have.value' , '2040-12-31' ) ;
152
152
} ,
@@ -161,7 +161,7 @@ describe('Stop creation tests', () => {
161
161
defaultCommandTimeout : 10000 ,
162
162
} ,
163
163
( ) => {
164
- modalMap . createStopAtLocation ( {
164
+ mapModal . createStopAtLocation ( {
165
165
stopFormInfo : {
166
166
label : testStopLabels . timingPlaceLabel ,
167
167
// seed timing places should always have label defined
@@ -177,19 +177,19 @@ describe('Stop creation tests', () => {
177
177
} ,
178
178
} ) ;
179
179
180
- modalMap . gqlStopShouldBeCreatedSuccessfully ( ) ;
180
+ mapModal . gqlStopShouldBeCreatedSuccessfully ( ) ;
181
181
182
- modalMap . checkStopSubmitSuccessToast ( ) ;
182
+ mapModal . checkStopSubmitSuccessToast ( ) ;
183
183
184
184
mapFilterPanel . toggleShowStops ( ReusableComponentsVehicleModeEnum . Bus ) ;
185
185
186
186
cy . getByTestId (
187
187
`Map::Stops::stopMarker::${ testStopLabels . timingPlaceLabel } _Standard` ,
188
188
) . click ( ) ;
189
189
190
- modalMap . map . stopPopUp . getEditButton ( ) . click ( ) ;
190
+ mapModal . map . stopPopUp . getEditButton ( ) . click ( ) ;
191
191
192
- modalMap . stopForm
192
+ mapModal . stopForm
193
193
. getTimingPlaceDropdown ( )
194
194
. should ( 'contain' , timingPlaces [ 0 ] . label ) ;
195
195
} ,
0 commit comments