Skip to content

Commit c708cd1

Browse files
committed
test(wallet): fix send about the call of the getPublicKey
1 parent 9d1683f commit c708cd1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

test/unit/modules/wallet.test.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,7 @@ describe('Wallet class', () => {
238238
wallet.info = jest.fn().mockResolvedValue(info);
239239
blocksMock.create.mockResolvedValue({ hash: 'createdSendHash' } as any);
240240
blocksMock.process.mockResolvedValue('processedSendHash');
241+
KeyService.getPublicKey = jest.fn().mockReturnValue('publicKey');
241242

242243
const result = await wallet.send('destinationAddress', '1');
243244
expect(wallet.info).toHaveBeenCalledWith({
@@ -249,9 +250,10 @@ describe('Wallet class', () => {
249250
previous: 'frontierHash',
250251
representative: 'representative',
251252
balance: '4000000000000000000000000000000', // Adjusted for unit conversion in test setup
252-
link: 'destinationAddress',
253+
link: 'publicKey',
253254
key: privateKey,
254255
});
256+
expect(KeyService.getPublicKey).toHaveBeenCalledWith('destinationAddress');
255257
expect(blocksMock.process).toHaveBeenCalledWith({ hash: 'createdSendHash' }, 'send');
256258
expect(result).toBe('processedSendHash');
257259
});

0 commit comments

Comments
 (0)