@@ -27,6 +27,10 @@ describe('Project upgrade', () => {
27
27
billingAccountId : 1 ,
28
28
name : 'test1' ,
29
29
description : 'test project1' ,
30
+ icon : 'http://example.com/icon1.ico' ,
31
+ question : 'question 1' ,
32
+ info : 'info 1' ,
33
+ aliases : [ ] ,
30
34
status : 'draft' ,
31
35
details : {
32
36
name : 'a specific name' ,
@@ -50,6 +54,10 @@ describe('Project upgrade', () => {
50
54
name : 'template 1' ,
51
55
key : project . type ,
52
56
category : 'category 1' ,
57
+ icon : 'http://example.com/icon1.ico' ,
58
+ question : 'question 1' ,
59
+ info : 'info 1' ,
60
+ aliases : [ ] ,
53
61
scope : {
54
62
scope1 : {
55
63
subScope1A : 1 ,
@@ -239,7 +247,9 @@ describe('Project upgrade', () => {
239
247
const commonTest = async ( testCompleted , completedOnDate , additionalPhaseName ) => {
240
248
const migratedProject = await models . Project . find ( { id : project . id } ) ;
241
249
expect ( migratedProject . version ) . to . equal ( 'v3' ) ;
242
- const newProjectPhases = await models . ProjectPhase . findAll ( { projectId : project . id } ) ;
250
+ const newProjectPhases = await models . ProjectPhase . findAll ( {
251
+ where : { projectId : project . id } ,
252
+ } ) ;
243
253
for ( const newProjectPhase of newProjectPhases ) {
244
254
expect ( newProjectPhase ) . to . exist ;
245
255
expect ( newProjectPhase . name ) . to . be . oneOf ( [ 'phase 1' , 'phase 2' ] . concat ( additionalPhaseName || [ ] ) ) ;
@@ -255,7 +265,9 @@ describe('Project upgrade', () => {
255
265
expect ( newProjectPhase . progress ) . to . equal ( 0 ) ;
256
266
expect ( newProjectPhase . endDate ) . to . equal ( null ) ;
257
267
}
258
- const newPhaseProducts = await models . PhaseProduct . findAll ( { phaseId : newProjectPhase . id } ) ;
268
+ const newPhaseProducts = await models . PhaseProduct . findAll ( { where :
269
+ { phaseId : newProjectPhase . id } ,
270
+ } ) ;
259
271
for ( const newPhaseProduct of newPhaseProducts ) {
260
272
expect ( newPhaseProduct ) . to . exist ;
261
273
expect ( newPhaseProduct . projectId ) . to . equal ( project . id ) ;
@@ -278,9 +290,9 @@ describe('Project upgrade', () => {
278
290
}
279
291
}
280
292
281
- server . services . pubsub . publish . calledWith ( 'project.phase.added' ) . should . be . true ;
282
- server . services . pubsub . publish . calledWith ( 'project.phase.product.added' ) . should . be . true ;
283
- server . services . pubsub . publish . calledWith ( 'project.updated' ) . should . be . true ;
293
+ expect ( server . services . pubsub . publish . calledWith ( 'project.phase.added' ) ) . to . be . true ;
294
+ expect ( server . services . pubsub . publish . calledWith ( 'project.phase.product.added' ) ) . to . be . true ;
295
+ expect ( server . services . pubsub . publish . calledWith ( 'project.updated' ) ) . to . be . true ;
284
296
} ;
285
297
286
298
it ( 'should migrate a non completed project to the expected state' , async ( ) => {
0 commit comments