Skip to content

Commit

Permalink
fix(extension-chrome): unit test for #getOffChainLocks and #getOnChai…
Browse files Browse the repository at this point in the history
…nLocks
  • Loading branch information
IronLu233 committed Mar 26, 2023
1 parent 0890442 commit cdd1710
Showing 1 changed file with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -387,4 +387,27 @@ describe('class FullOwnershipProvider', () => {
),
);
});

it('#getOffChainLocks and #getOnChainLocks', async () => {
const ckbRequest = jest.fn().mockReturnValue([]);
const provider = new FullOwnershipProvider({
ckb: {
request: ckbRequest,
} as any,
});

await expect(provider.getOffChainLocks({ change: 'internal' })).resolves.toEqual([]);
expect(ckbRequest).toBeCalledWith({
method: 'wallet_fullOwnership_getOffChainLocks',
params: { change: 'internal' },
});

await expect(provider.getOnChainLocks({ cursor: '0' })).resolves.toEqual([]);
expect(ckbRequest).toBeCalledWith({
method: 'wallet_fullOwnership_getOnChainLocks',
params: {
cursor: '0',
},
});
});
});

0 comments on commit cdd1710

Please sign in to comment.