Skip to content

Commit

Permalink
fix: tests
Browse files Browse the repository at this point in the history
  • Loading branch information
OlhaD committed Jul 7, 2023
1 parent 51ce44a commit d2543a2
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
12 changes: 8 additions & 4 deletions server/models/Wallet.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,14 @@ describe('Wallet Model', () => {
});

expect(result).eql([{ id: walletId, wallet }]);
expect(walletRepositoryStub.getAllWallets).calledOnceWithExactly(walletId, {
limit: 1,
offset: 1,
});
expect(walletRepositoryStub.getAllWallets).calledOnceWithExactly(
walletId,
{
limit: 1,
offset: 1,
},
'',
);
});

describe('hasControlOver function', async () => {
Expand Down
13 changes: 13 additions & 0 deletions server/repositories/WalletRepository.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,17 @@ describe('WalletRepository', () => {
const entity = await walletRepository.getAllWallets(uuid.v4());
expect(entity).to.be.a('array');
});

it('getAllWalletsCount', async () => {
tracker.uninstall();
tracker.install();
tracker.on('query', (query) => {
expect(query.sql).match(
/select.*wallet.*where.*actor_wallet_id.*request_type.*/,
);
query.response([{ id: 1 }]);
});
const entity = await walletRepository.getAllWallets(uuid.v4());
expect(entity).to.be.a('array');
});
});

0 comments on commit d2543a2

Please sign in to comment.