2023-05-22 19:02:54 +03:00
|
|
|
import { Currency } from '@uniswap/sdk-core'
|
|
|
|
|
2022-09-09 21:54:54 +03:00
|
|
|
export const getTestSelector = (selectorId: string) => `[data-testid=${selectorId}]`
|
2022-12-15 18:16:15 +03:00
|
|
|
|
|
|
|
export const getTestSelectorStartsWith = (selectorId: string) => `[data-testid^=${selectorId}]`
|
2023-05-22 19:02:54 +03:00
|
|
|
|
|
|
|
/** Gets the balance of a token as a Chainable. */
|
|
|
|
export function getBalance(token: Currency) {
|
|
|
|
return cy
|
|
|
|
.hardhat()
|
|
|
|
.then((hardhat) => hardhat.getBalance(hardhat.wallet, token))
|
|
|
|
.then((balance) => Number(balance.toFixed(1)))
|
|
|
|
}
|