Skip to content

Commit

Permalink
Remove duplicate processDeletion call (#483)
Browse files Browse the repository at this point in the history
  • Loading branch information
calvinlu3 authored Dec 13, 2024
1 parent 77ead36 commit 8f60f5e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down Expand Up @@ -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('/');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down

0 comments on commit 8f60f5e

Please sign in to comment.