@@ -186,7 +186,7 @@ describe('updateRelationshipSet', () => {
186186
187187 const result = await bookshelf . transaction ( async ( trx ) => {
188188 const sets = await updateRelationshipSets (
189- bookbrainzData , trx , null , [ relationshipData ]
189+ bookbrainzData , trx , null , [ { ... relationshipData , isAdded : true } ]
190190 ) ;
191191
192192 return promiseProps (
@@ -213,7 +213,7 @@ describe('updateRelationshipSet', () => {
213213 const firstResult = await bookshelf . transaction ( async ( trx ) => {
214214 const sets = await updateRelationshipSets (
215215 bookbrainzData , trx , null ,
216- [ firstRelationshipData , secondRelationshipData ]
216+ [ { ... firstRelationshipData , isAdded : true } , { ... secondRelationshipData , isAdded : true } ]
217217 ) ;
218218
219219 const updatedEntitiesPromise = Promise . all (
@@ -246,8 +246,11 @@ describe('updateRelationshipSet', () => {
246246 . map ( ( relationship ) =>
247247 _ . pick ( relationship , [ 'typeId' , 'sourceBbid' , 'targetBbid' , 'attributeSetId' ] ) ) ;
248248
249+ const firstRel = firstSetRelationships [ 1 ] ;
250+ firstSetRelationships . push ( { ...firstRel , isRemoved : true } ) ;
249251 firstSetRelationships [ 1 ] . targetBbid = dBBID ;
250- const thirdRelationshipData = firstSetRelationships [ 1 ] ;
252+ firstSetRelationships [ 1 ] . isAdded = true ;
253+ const thirdRelationshipData = _ . omit ( firstSetRelationships [ 1 ] , 'isAdded' ) ;
251254
252255 const result = await bookshelf . transaction ( async ( trx ) => {
253256 const sets = await updateRelationshipSets (
@@ -284,7 +287,7 @@ describe('updateRelationshipSet', () => {
284287 const firstResult = await bookshelf . transaction ( async ( trx ) => {
285288 const sets = await updateRelationshipSets (
286289 bookbrainzData , trx , null ,
287- [ firstRelationshipData , secondRelationshipData ]
290+ [ { ... firstRelationshipData , isAdded : true } , { isAdded : true , ... secondRelationshipData } ]
288291 ) ;
289292
290293 const updatedEntitiesPromise = Promise . all (
0 commit comments