diff --git a/src/main/webapp/app/service/firebase/firebase-gene-review-service.spec.ts b/src/main/webapp/app/service/firebase/firebase-gene-review-service.spec.ts index f299456f..afdd5961 100644 --- a/src/main/webapp/app/service/firebase/firebase-gene-review-service.spec.ts +++ b/src/main/webapp/app/service/firebase/firebase-gene-review-service.spec.ts @@ -244,6 +244,7 @@ describe('Firebase Gene Review Service', () => { entrezGeneId: 0, }); + expect(mockFirebaseRepository.deleteFromArray).toHaveBeenCalledTimes(1); expect(mockFirebaseRepository.deleteFromArray).toHaveBeenCalledWith('Genes/BRAF/mutations', [0]); expect(mockFirebaseRepository.update.mock.calls[0][0]).toEqual('/'); expect(mockFirebaseRepository.update.mock.calls[0][1]).toMatchObject({ @@ -739,6 +740,7 @@ describe('Firebase Gene Review Service', () => { }); await firebaseGeneReviewService.rejectChanges(hugoSymbol, [reviewLevel], false); + expect(mockFirebaseRepository.deleteFromArray).toHaveBeenCalledTimes(1); expect(mockFirebaseRepository.deleteFromArray).toHaveBeenCalledWith('Genes/BRAF/mutations', [12]); // We expect both alterations (V600E and V600K) to be added to VUS list expect(mockFirebaseRepository.update.mock.calls[0][0]).toEqual('/'); diff --git a/src/main/webapp/app/service/firebase/firebase-gene-review-service.ts b/src/main/webapp/app/service/firebase/firebase-gene-review-service.ts index e8da51ff..881ae301 100644 --- a/src/main/webapp/app/service/firebase/firebase-gene-review-service.ts +++ b/src/main/webapp/app/service/firebase/firebase-gene-review-service.ts @@ -293,12 +293,10 @@ export class FirebaseGeneReviewService { try { // Todo: We should use multi-location updates for deletions once all our arrays use firebase auto-generated keys // instead of using sequential number indices. - this.processDeletion(reviewLevels.length, itemsToDelete); + return this.processDeletion(reviewLevels.length, itemsToDelete); } catch (error) { throw new SentryError('Failed to accept deletions in review mode', { hugoSymbol, reviewLevels, isGermline, itemsToDelete }); } - - return this.processDeletion(reviewLevels.length, itemsToDelete); }; rejectChanges = async (