diff --git a/apps/backend/src/application/usecases/transaction/__tests__/getTransactionById.test.ts b/apps/backend/src/application/usecases/transaction/__tests__/getTransactionById.test.ts index 9935c39..c5b563c 100644 --- a/apps/backend/src/application/usecases/transaction/__tests__/getTransactionById.test.ts +++ b/apps/backend/src/application/usecases/transaction/__tests__/getTransactionById.test.ts @@ -50,7 +50,7 @@ describe('GetTransactionByIdUseCase', () => { const mockOperation2: OperationDbRow = { accountId: Id.create().valueOf(), - amount: Amount.create('500').valueOf(), + amount: Amount.create('-1000').valueOf(), createdAt: Timestamp.create().valueOf(), description: 'Operation 2', id: Id.create().valueOf(), @@ -59,14 +59,14 @@ describe('GetTransactionByIdUseCase', () => { transactionId, updatedAt: Timestamp.create().valueOf(), userId, - value: Amount.create('500').valueOf(), + value: Amount.create('-1000').valueOf(), }; const mockOperation3: OperationDbRow = { accountId: Id.create().valueOf(), - amount: Amount.create('-500').valueOf(), + amount: Amount.create('500').valueOf(), createdAt: Timestamp.create().valueOf(), - description: 'Operation 2', + description: 'Deleted Operation 1', id: Id.create().valueOf(), isSystem: false, isTombstone: true, @@ -80,14 +80,14 @@ describe('GetTransactionByIdUseCase', () => { accountId: Id.create().valueOf(), amount: Amount.create('-500').valueOf(), createdAt: Timestamp.create().valueOf(), - description: 'Operation 2', + description: 'Deleted Operation 2', id: Id.create().valueOf(), isSystem: false, isTombstone: true, transactionId, updatedAt: Timestamp.create().valueOf(), userId, - value: Amount.create('500').valueOf(), + value: Amount.create('-500').valueOf(), }; const deletedOperations = [mockOperation3, mockOperation4]; diff --git a/apps/backend/src/infrastructure/db/transaction/transaction.repository.test.ts b/apps/backend/src/infrastructure/db/transaction/transaction.repository.test.ts index 91474c6..d27729c 100644 --- a/apps/backend/src/infrastructure/db/transaction/transaction.repository.test.ts +++ b/apps/backend/src/infrastructure/db/transaction/transaction.repository.test.ts @@ -162,6 +162,9 @@ describe('TransactionRepository', () => { }); }); + it.todo('should return null when transaction does not exist'); + it.todo('should return null when transaction belongs to another user'); + it('should not retrieve a tombstone transaction', async () => { const transaction = data.transaction; @@ -180,6 +183,8 @@ describe('TransactionRepository', () => { }); describe('create', () => { + it.todo('should not create a transaction when user does not exist'); + it('should create a new transaction', async () => { const transaction = data.transaction; @@ -326,6 +331,8 @@ describe('TransactionRepository', () => { ); }); + it.todo('should not update transaction belonging to another user'); + it('should not update isTombstone field when saving', async () => { const transaction = data.transaction; @@ -346,6 +353,8 @@ describe('TransactionRepository', () => { }); describe('softDelete', () => { + it.todo('should not soft delete a transaction belonging to another user'); + it('should soft delete the transaction and its operations', async () => { const transaction = data.transaction;