Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand All @@ -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,
Expand All @@ -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];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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;

Expand Down Expand Up @@ -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;

Expand All @@ -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;

Expand Down
Loading