@@ -49,6 +49,7 @@ class ImportProjectsSpec extends StubbedCasSpec {
49
49
and :
50
50
List rows2 = projectResults()
51
51
rows2. size() == 2
52
+ rows2[1 ]. success == ' Yes'
52
53
53
54
when :
54
55
to Organisation , ' test_organisation'
@@ -75,6 +76,8 @@ class ImportProjectsSpec extends StubbedCasSpec {
75
76
and : " The data is relevant to the projects loaded"
76
77
List rows = projectResults()
77
78
rows. size() == 3
79
+ rows[1 ]. success == ' Yes'
80
+ rows[2 ]. success == ' Yes'
78
81
79
82
when :
80
83
importProjects()
@@ -125,6 +128,7 @@ class ImportProjectsSpec extends StubbedCasSpec {
125
128
and :
126
129
List rows2 = projectResults()
127
130
rows2. size() == 2
131
+ rows2[1 ]. success == ' Yes'
128
132
129
133
when : " We navigate to the program page to find the new imported project, then open it"
130
134
to ProgramPage , ' configurable_meri_plan'
@@ -152,4 +156,59 @@ class ImportProjectsSpec extends StubbedCasSpec {
152
156
adminContent. meriPlan. budget[0 ]. budgetAmounts()* . value() == [" 20000" , " 10000" ]
153
157
154
158
}
159
+
160
+ def " Projects can be updated via import with only the fields provided in the spreadsheet being updated" () {
161
+
162
+ setup :
163
+ File csv = new File (getClass(). getResource(" /grants-hub-update-data.csv" ). toURI())
164
+ loginAsMeritAdmin(browser)
165
+
166
+ when :
167
+ to ProjectImport
168
+ checkUpdateCheckbox()
169
+ attachFile(csv)
170
+
171
+ then : " The projects are validated and the validation results are displayed"
172
+ waitFor{validateComplete()}
173
+
174
+ and : " The data is relevant to the projects loaded"
175
+ projectResults(). size() == 2
176
+
177
+ when :
178
+ importProjects()
179
+
180
+ then :
181
+ waitFor{loadComplete()}
182
+ and :
183
+ List rows2 = projectResults()
184
+ rows2. size() == 2
185
+ rows2[1 ]. success == ' Yes'
186
+
187
+ when : " We navigate to the program page to find the new imported project, then open it"
188
+ to ProgramPage , ' configurable_meri_plan'
189
+ openProjectByGrantId(' cep-1' )
190
+
191
+ then :
192
+ at RlpProjectPage
193
+
194
+ when :
195
+ displayOverview()
196
+
197
+ then :
198
+ overview. program. text() == " Configurable MERI Plan Program"
199
+ overview. projectId. text() == " cep-1"
200
+ overview. status. text(). equalsIgnoreCase(" Active" )
201
+ overview. externalIds* . text() == [" 1234" ]
202
+ overview. description. text() == " Grants project description - updated"
203
+
204
+ when :
205
+ openMeriPlanEditTab()
206
+
207
+ then :
208
+ adminContent. meriPlan. budget. size() == 1
209
+ adminContent. meriPlan. budget[0 ]. description. value() == " Project funding"
210
+ adminContent. meriPlan. budget[0 ]. budgetAmounts()* . value() == [" 1" , " 2" ]
211
+
212
+ }
213
+
155
214
}
0 commit comments