Skip to content

Commit

Permalink
feat: fix failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
pranavkparti committed Aug 10, 2023
1 parent dfba65f commit 3271bd6
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions server/repositories/TransferRepository.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,18 +67,24 @@ describe('TransferRepository', () => {
it('getByFilter', async () => {
tracker.uninstall();
tracker.install();

tracker.on('query', function sendResult(query, step) {
[
function firstQuery() {
expect(query.sql).match(
/select.*transfer.*originating_wallet.*source_wallet.*destination_wallet/,
);
query.response([{ id: uuid.v4() }]);
expect(query.sql).match(/select.*count.*transfer.*originating_wallet.*source_wallet.*destination_wallet.*p/);
query.response([{count: '1'}]);
},
function secondQuery() {
expect(query.sql).match(/select.*transfer.*originating_wallet.*source_wallet.*destination_wallet/);
query.response([{id: uuid.v4()}])
},
][step - 1]();
});

const result = await transferRepository.getByFilter({});
expect(result[0]).property('id').a('string');
expect(result).property('count').a('number')
expect(result).property('result').a('array')
expect(result.result[0]).property('id').a('string');
});

it('getPendingTransfers', async () => {
Expand Down

0 comments on commit 3271bd6

Please sign in to comment.