@@ -359,7 +359,7 @@ module.exports = () => {
359359
360360 const run = await runService . update (
361361 { runNumber } ,
362- { relations : { eorReasons : eorReasons } } ,
362+ { relations : { eorReasons } } ,
363363 ) ;
364364
365365 expect ( run . eorReasons ) . to . lengthOf ( 2 ) ;
@@ -391,7 +391,7 @@ module.exports = () => {
391391
392392 const run = await runService . update (
393393 { runNumber } ,
394- { relations : { eorReasons : eorReasons } } ,
394+ { relations : { eorReasons } } ,
395395 ) ;
396396
397397 expect ( run . eorReasons ) . to . lengthOf ( 2 ) ;
@@ -431,7 +431,7 @@ module.exports = () => {
431431
432432 const run = await runService . update (
433433 { runNumber } ,
434- { relations : { eorReasons : eorReasons } } ,
434+ { relations : { eorReasons } } ,
435435 ) ;
436436
437437 // Should only include the valid ones without throwing for invalid one (is simply excluded)
@@ -453,7 +453,7 @@ module.exports = () => {
453453
454454 const run = await runService . update (
455455 { runNumber } ,
456- { relations : { eorReasons : eorReasons } } ,
456+ { relations : { eorReasons } } ,
457457 ) ;
458458
459459 expect ( run . eorReasons ) . to . lengthOf ( 0 ) ;
@@ -485,7 +485,7 @@ module.exports = () => {
485485
486486 const run = await runService . update (
487487 { runNumber } ,
488- { relations : { eorReasons : eorReasons } } ,
488+ { relations : { eorReasons } } ,
489489 ) ;
490490
491491 // EorReasons should only include the one that does not have an id
@@ -733,4 +733,26 @@ module.exports = () => {
733733 expect ( run . userIdO2Stop ) . to . equal ( 2 ) ;
734734 expect ( run . flpRoles . map ( ( { name } ) => name ) ) . to . deep . equal ( [ 'fake-flp1' , 'fake-flp2' , 'fake-ctp-host' ] ) ;
735735 } ) ;
736+
737+ it ( 'should successfully update a run with provided EOR reasons via the createOrUpdate' , async ( ) => {
738+ const run = await runService . createOrUpdate (
739+ 1234 ,
740+ 'CmCvjNbg' ,
741+ { } ,
742+ {
743+ eorReasons : [
744+ {
745+ category : 'DETECTORS' ,
746+ title : 'TPC' ,
747+ description : 'Run stopped due to LHC dump' ,
748+ } ,
749+ ] ,
750+ } ,
751+ ) ;
752+ // console.log(run);
753+ expect ( run . eorReasons ) . to . have . lengthOf ( 1 ) ;
754+ expect ( run . eorReasons [ 0 ] . category ) . to . equal ( 'DETECTORS' ) ;
755+ expect ( run . eorReasons [ 0 ] . title ) . to . equal ( 'TPC' ) ;
756+ expect ( run . eorReasons [ 0 ] . description ) . to . equal ( 'Run stopped due to LHC dump' ) ;
757+ } ) ;
736758} ;
0 commit comments