UNPKG

@ledgerhq/live-common

Version:
20 lines 982 B
import { containsSubstringInEvent, getDelegateEvents, pressUntilTextFound } from "../speculos"; import { isTouchDevice } from "../speculosAppVersion"; import expect from "expect"; import { longPressAndRelease } from "../deviceInteraction/TouchDeviceSimulator"; import { DeviceLabels } from "../enum/DeviceLabels"; import { withDeviceController } from "../deviceInteraction/DeviceController"; export const delegateCelo = withDeviceController(({ getButtonsController }) => async (delegatingAccount) => { const buttons = getButtonsController(); const events = await getDelegateEvents(delegatingAccount); const isAmountCorrect = containsSubstringInEvent(delegatingAccount.amount, events); expect(isAmountCorrect).toBeTruthy(); if (isTouchDevice()) { await pressUntilTextFound(DeviceLabels.HOLD_TO_SIGN); await longPressAndRelease(DeviceLabels.HOLD_TO_SIGN, 3); } else { await buttons.both(); } }); //# sourceMappingURL=celo.js.map