Skip to content

Commit

Permalink
chore: remove duplicated tests (#617)
Browse files Browse the repository at this point in the history
# Motivation

I guess there was a merge conflicts at some point, I spotted two tests that were duplicated.

# Changes

- Remove duplicate suite `describe(balance)` in Index canister test.
  • Loading branch information
peterpeterparker authored Apr 29, 2024
1 parent d77f0e5 commit 5226dbb
Showing 1 changed file with 0 additions and 39 deletions.
39 changes: 0 additions & 39 deletions packages/ledger-icrc/src/index-ng.canister.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,43 +132,4 @@ describe("Index canister", () => {
expect(res).toEqual(balance);
});
});

describe("balance", () => {
it("should return the balance of main account", async () => {
const service = mock<ActorSubclass<IcrcIndexNgService>>();
const balance = BigInt(100);
service.icrc1_balance_of.mockResolvedValue(balance);

const canister = IcrcIndexNgCanister.create({
canisterId: ledgerCanisterIdMock,
certifiedServiceOverride: service,
});

const owner = Principal.fromText("aaaaa-aa");
const res = await canister.balance({
owner,
});
expect(service.icrc1_balance_of).toBeCalled();
expect(res).toEqual(balance);
});

it("should return the balance of subaccount", async () => {
const service = mock<ActorSubclass<IcrcIndexNgService>>();
const balance = BigInt(100);
service.icrc1_balance_of.mockResolvedValue(balance);

const canister = IcrcIndexNgCanister.create({
canisterId: ledgerCanisterIdMock,
certifiedServiceOverride: service,
});

const owner = Principal.fromText("aaaaa-aa");
const subaccount = arrayOfNumberToUint8Array([0, 0, 1]);
const res = await canister.balance({
owner,
subaccount,
});
expect(res).toEqual(balance);
});
});
});

0 comments on commit 5226dbb

Please sign in to comment.