Skip to content
This repository has been archived by the owner on Dec 16, 2021. It is now read-only.

Commit

Permalink
feat: new topup identity test (#53)
Browse files Browse the repository at this point in the history
  • Loading branch information
Konstantin Shuplenkov authored Jul 29, 2020
1 parent 92aad35 commit 075f09c
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion test/functional/platform/Identity.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,23 @@ describe('Platform', () => {
it('should be able to top-up credit balance', async () => {
await waitForBalanceToChange(walletAccount);

await client.platform.identities.topUp(identity.getId(), 10);
const identityBeforeTopUp = await client.platform.identities.get(
identity.getId(),
);
const balanceBeforeTopUp = identityBeforeTopUp.getBalance();
const topUpAmount = 100;
const topUpCredits = topUpAmount * 1000;

await client.platform.identities.topUp(identity.getId(), topUpAmount);

await waitForBalanceToChange(walletAccount);

const identityAfterTopUp = await client.platform.identities.get(
identity.getId(),
);

expect(identityAfterTopUp.getBalance()).to.be.greaterThan(balanceBeforeTopUp);
expect(identityAfterTopUp.getBalance()).to.be.lessThan(balanceBeforeTopUp + topUpCredits);
});

it('should be able to create more documents after the top-up', async () => {
Expand Down

0 comments on commit 075f09c

Please sign in to comment.