@@ -101,13 +101,15 @@ describe('/reports/{REPORTID}/observed-variant-annotations', () => {
101101 variantType : 'cnv' ,
102102 variantIdent : variant . ident ,
103103 annotations : { rapidReportTableTag : 'cancerRelevance' } ,
104+ flags : [ 'test' ] ,
104105 } )
105106 . expect ( StatusCodes . CREATED ) ;
106107
107108 const checkVar = await getVariantByIdent ( variant . ident , rapidReportIdent . ident ) ;
108109 const annotation = checkVar . observedVariantAnnotation ;
109110 expect ( annotation . variantType ) . toEqual ( 'cnv' ) ;
110111 expect ( annotation . annotations . rapidReportTableTag ) . toEqual ( 'cancerRelevance' ) ;
112+ expect ( annotation . flags ) . toEqual ( [ 'test' ] ) ;
111113 } ) ;
112114
113115 test ( 'Does not create new annotation with no matching variant - OK' , async ( ) => {
@@ -119,6 +121,7 @@ describe('/reports/{REPORTID}/observed-variant-annotations', () => {
119121 variantType : 'mut' ,
120122 variantIdent : 'hello' ,
121123 annotations : { rapidReportTableTag : 'therapeuticAssociation' } ,
124+ flags : [ 'test' ] ,
122125 } )
123126 . expect ( StatusCodes . BAD_REQUEST ) ;
124127 } ) ;
@@ -132,6 +135,7 @@ describe('/reports/{REPORTID}/observed-variant-annotations', () => {
132135 variantType : 'test' ,
133136 variantIdent : 'hello' ,
134137 annotations : { rapidReportTableTag : 'therapeuticAssociation' } ,
138+ flags : [ 'test' ] ,
135139 } )
136140 . expect ( StatusCodes . BAD_REQUEST ) ;
137141 } ) ;
@@ -157,6 +161,7 @@ describe('/reports/{REPORTID}/observed-variant-annotations', () => {
157161 variantType : 'mut' ,
158162 variantIdent : variant . ident ,
159163 annotations : { rapidReportTableTag : 'therapeuticAssociation' } ,
164+ flags : [ 'test' ] ,
160165 } )
161166 . expect ( StatusCodes . CREATED ) ;
162167
@@ -168,6 +173,7 @@ describe('/reports/{REPORTID}/observed-variant-annotations', () => {
168173 variantType : 'mut' ,
169174 variantIdent : variant . ident ,
170175 annotations : { rapidReportTableTag : 'cancerRelevance' } ,
176+ flags : [ 'test' ] ,
171177 } )
172178 . expect ( StatusCodes . CONFLICT ) ;
173179 } ) ;
@@ -198,32 +204,36 @@ describe('/reports/{REPORTID}/observed-variant-annotations', () => {
198204 variantType : 'mut' ,
199205 variantIdent : origVariant . ident ,
200206 annotations,
207+ flags : [ 'test' ] ,
201208 } )
202209 . expect ( StatusCodes . CREATED ) ;
203- console . log ( 'here in test at 205' ) ;
204210
205211 // get the created variant annotation and check it's correct
206212 const createdVar = await getVariantByIdent ( origVariant . ident , rapidReportIdent . ident ) ;
207213 expect ( createdVar . observedVariantAnnotation . annotations . secondTag ) . toEqual ( annotations . secondTag ) ;
208214 expect ( createdVar . observedVariantAnnotation . annotations . rapidReportTableTag ) . toEqual ( annotations . rapidReportTableTag ) ;
215+ expect ( createdVar . observedVariantAnnotation . flags ) . toEqual ( [ 'test' ] ) ;
209216
210217 // do the update
211218 const updatedSecondTag = 'testValue2' ;
212219 annotations . secondTag = updatedSecondTag ;
220+ const updatedFlags = [ 'updated' ] ;
213221
214222 await request
215223 . put ( `/api/reports/${ rapidReportIdent . ident } /observed-variant-annotations/${ createdVar . observedVariantAnnotation . ident } ` )
216224 . auth ( username , password )
217225 . type ( 'json' )
218226 . send ( {
219227 annotations,
228+ flags : updatedFlags ,
220229 } )
221230 . expect ( StatusCodes . OK ) ;
222231
223232 // get the new variant data
224233 const updatedVar = await getVariantByIdent ( origVariant . ident , rapidReportIdent . ident ) ;
225234 expect ( updatedVar . observedVariantAnnotation . annotations . secondTag ) . toEqual ( updatedSecondTag ) ;
226235 expect ( updatedVar . observedVariantAnnotation . annotations . rapidReportTableTag ) . toEqual ( annotations . rapidReportTableTag ) ;
236+ expect ( updatedVar . observedVariantAnnotation . flags ) . toEqual ( updatedFlags ) ;
227237 } ) ;
228238 } ) ;
229239
@@ -260,6 +270,7 @@ describe('/reports/{REPORTID}/observed-variant-annotations', () => {
260270 variantType,
261271 variantIdent : record . ident ,
262272 annotations,
273+ flags : [ 'test' ] ,
263274 } )
264275 . expect ( StatusCodes . CREATED ) ;
265276
@@ -275,6 +286,7 @@ describe('/reports/{REPORTID}/observed-variant-annotations', () => {
275286 . expect ( StatusCodes . OK ) ;
276287 const record2 = res2 . body ;
277288 expect ( record2 . observedVariantAnnotation . annotations . testTag ) . toEqual ( annotations . testTag ) ;
289+ expect ( record2 . observedVariantAnnotation . flags ) . toEqual ( [ 'test' ] ) ;
278290 } ) ;
279291
280292 test ( 'Annotations delivered with variants endpt - OK' , async ( ) => {
@@ -305,6 +317,7 @@ describe('/reports/{REPORTID}/observed-variant-annotations', () => {
305317 variantType : record . variantType ,
306318 variantIdent : record . ident ,
307319 annotations,
320+ flags : [ 'test' ] ,
308321 } )
309322 . expect ( StatusCodes . CREATED ) ;
310323
@@ -317,6 +330,7 @@ describe('/reports/{REPORTID}/observed-variant-annotations', () => {
317330 return variant . ident === record . ident ;
318331 } ) [ 0 ] ;
319332 expect ( updatedRecord . observedVariantAnnotation . annotations . testTag ) . toEqual ( annotations . testTag ) ;
333+ expect ( updatedRecord . observedVariantAnnotation . flags ) . toEqual ( [ 'test' ] ) ;
320334 } ) ;
321335
322336 // skipping test as rapid report tagging now works through different endpoint
@@ -346,6 +360,7 @@ describe('/reports/{REPORTID}/observed-variant-annotations', () => {
346360 variantType : record . variantType ,
347361 variantIdent : record . ident ,
348362 annotations : { rapidReportTableTag : 'cancerRelevance' , testTag : 'testValue' } ,
363+ flags : [ 'test' ] ,
349364 } )
350365 . expect ( StatusCodes . CREATED ) ;
351366
0 commit comments