// SPDX-FileCopyrightText: © 2024 LEDGER SAS // SPDX-License-Identifier: Apache-2.0 import { InvalidParameterError } from '../../errors' import { rejectBalanceOptions } from './rejectBalanceOptions' describe('rejectBalanceOptions', () => { it('should throw an exception when options is provided', async () => { const getBalance = jest.fn().mockResolvedValueOnce([]) await expect( rejectBalanceOptions(getBalance, { includeAssets: async () => true }) ).rejects.toThrow(InvalidParameterError) expect(getBalance).not.toHaveBeenCalled() }) it('should call getBalance when options is not provided', async () => { const getBalance = jest.fn().mockResolvedValueOnce([]) await expect(rejectBalanceOptions(getBalance)).resolves.toEqual([]) expect(getBalance).toHaveBeenCalledTimes(1) }) })