UNPKG

@ledgerhq/live-common

Version:
18 lines (15 loc) 668 B
import expect from "expect"; import { pressBoth, pressUntilTextFound, waitFor, containsSubstringInEvent } from "../speculos"; import { DeviceLabels } from "../enum/DeviceLabels"; import { Delegate } from "../models/Delegate"; export async function sendAptos() { await pressUntilTextFound(DeviceLabels.APPROVE); await pressBoth(); } export async function delegateAptos(delegatingAccount: Delegate) { await waitFor(DeviceLabels.REVIEW_OPERATION); const events = await pressUntilTextFound(DeviceLabels.APPROVE); const isAmountCorrect = containsSubstringInEvent(delegatingAccount.amount, events); expect(isAmountCorrect).toBeTruthy(); await pressBoth(); }