Skip to content

Commit

Permalink
chore: add tests back
Browse files Browse the repository at this point in the history
  • Loading branch information
damienen committed Mar 19, 2024
1 parent 4cdad73 commit cedec73
Showing 1 changed file with 31 additions and 31 deletions.
62 changes: 31 additions & 31 deletions tests/bond.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,41 +39,41 @@ describe('Bond test', () => {
const acceptedCallers = await bondContract.viewAcceptedCallers();
expect(typeof acceptedCallers).toBe('object');

// const bond: Bond[] = await bondContract.viewBonds([1]);
// expect(bond).toMatchObject<Bond>;
// const sameBond: Bond[] = await bondContract.viewBonds(
// [tokenIdentifier],
// [76]
// );
// expect(sameBond).toMatchObject<Bond[]>;
// const sameBond2: Bond[] = await bondContract.viewBonds([
// createTokenIdentifier(tokenIdentifier, 76)
// ]);
// expect(sameBond2).toMatchObject<Bond[]>;
// expect(sameBond).toStrictEqual(sameBond2);
const bond: Bond[] = await bondContract.viewBonds([1]);
expect(bond).toMatchObject<Bond>;
const sameBond: Bond[] = await bondContract.viewBonds(
[tokenIdentifier],
[76]
);
expect(sameBond).toMatchObject<Bond[]>;
const sameBond2: Bond[] = await bondContract.viewBonds([
createTokenIdentifier(tokenIdentifier, 76)
]);
expect(sameBond2).toMatchObject<Bond[]>;
expect(sameBond).toStrictEqual(sameBond2);

// const singleBond: Bond = await bondContract.viewBond(1);
// expect(singleBond).toMatchObject<Bond>;
// expect(singleBond).toStrictEqual(sameBond2[0]);
const singleBond: Bond = await bondContract.viewBond(1);
expect(singleBond).toMatchObject<Bond>;
expect(singleBond).toStrictEqual(sameBond2[0]);

// const pagedBonds: Bond[] = await bondContract.viewPagedBonds(0, 2);
// expect(pagedBonds).toMatchObject<Bond[]>;
// expect(pagedBonds.length).toBe(3);
// expect(pagedBonds[0]).toStrictEqual(singleBond);
const pagedBonds: Bond[] = await bondContract.viewPagedBonds(0, 2);
expect(pagedBonds).toMatchObject<Bond[]>;
expect(pagedBonds.length).toBe(3);
expect(pagedBonds[0]).toStrictEqual(singleBond);

// const compensation: Compensation = await bondContract.viewCompensation(1);
// expect(compensation).toMatchObject<Compensation>;
const compensation: Compensation = await bondContract.viewCompensation(1);
expect(compensation).toMatchObject<Compensation>;

// const compensations: Compensation[] = await bondContract.viewCompensations([
// { tokenIdentifier: tokenIdentifier, nonce: 76 }
// ]);
// expect(compensations).toMatchObject<Compensation[]>;
// expect(compensations[0]).toStrictEqual(compensation);
const compensations: Compensation[] = await bondContract.viewCompensations([
{ tokenIdentifier: tokenIdentifier, nonce: 76 }
]);
expect(compensations).toMatchObject<Compensation[]>;
expect(compensations[0]).toStrictEqual(compensation);

// const pagedCompensations: Compensation[] =
// await bondContract.viewPagedCompensations(0, 2);
// expect(pagedCompensations).toMatchObject<Compensation[]>;
// expect(pagedCompensations.length).toBe(3);
// expect(pagedCompensations[0]).toStrictEqual(compensation);
const pagedCompensations: Compensation[] =
await bondContract.viewPagedCompensations(0, 2);
expect(pagedCompensations).toMatchObject<Compensation[]>;
expect(pagedCompensations.length).toBe(3);
expect(pagedCompensations[0]).toStrictEqual(compensation);
}, 20000);
});

0 comments on commit cedec73

Please sign in to comment.