@@ -109,7 +109,6 @@ export const onFeature: CodyHook<Context> = async (feature: Node, ctx: Context)
109109}
110110
111111async function createTestFiles ( featureName : string , featureMeta : any , givenNodes : Array < Node > , whenCommand : Node , thenNodes : Array < Node > , ctx : Context ) : Promise < string > {
112- // if using a service from another board (e.g. Fleet Management), make sure to set this up in the test feature's metadata!
113112 const service = withErrorCheck ( detectService , [ whenCommand , ctx ] ) ;
114113
115114 let aggregate : Node | undefined ;
@@ -136,11 +135,10 @@ async function createTestFiles(featureName: string, featureMeta: any, givenNodes
136135 const syncedAggregate = withErrorCheck ( getNodeFromSyncedNodes , [ aggregate , ctx . syncedNodes ] ) ;
137136 const aggregateState = withErrorCheck ( findAggregateState , [ syncedAggregate , ctx ] ) ;
138137 const aggregateStateMeta = withErrorCheck ( getVoMetadata , [ aggregateState , ctx ] ) ;
139- const aggregateStateNames = names ( aggregateState . getName ( ) ) ;
138+ const givenNodeDescriptionObject = JSON . parse ( '{' + givenNode . getDescription ( ) . replaceAll ( '\'' , '"' ) + '}' ) ;
140139
141140 const thenNode = thenNodes [ 0 ] ;
142141 const body = '{' + thenNode . getDescription ( ) . replaceAll ( '\'' , '"' ) + '}' ;
143- console . log ( 'Json body: ' + body ) ;
144142 const thenNodeDescriptionObject = JSON . parse ( body ) ;
145143
146144 const aggregateIdentifierProperty = aggregateStateMeta . identifier as keyof typeof thenNodeDescriptionObject ;
@@ -156,6 +154,7 @@ async function createTestFiles(featureName: string, featureMeta: any, givenNodes
156154 "when" : featureMeta [ whenKey ] ,
157155 "then" : featureMeta [ thenKey ] ,
158156 "givenEvent" : names ( givenNode . getName ( ) ) ,
157+ "givenIdentifier" : givenNodeDescriptionObject [ aggregateIdentifierProperty ] ,
159158 "givenAggregateMetaType" : givenAggregateMetaType ,
160159 "whenEvent" : names ( whenCommand . getName ( ) ) ,
161160 "thenEvent" : names ( thenNodes [ 0 ] . getName ( ) ) ,
0 commit comments