2023-05-22 09:02:54 -07:00
|
|
|
import { Currency } from '@uniswap/sdk-core'
|
|
|
|
|
2022-09-09 14:54:54 -04:00
|
|
|
export const getTestSelector = (selectorId: string) => `[data-testid=${selectorId}]`
|
2022-12-15 10:16:15 -05:00
|
|
|
|
|
|
|
export const getTestSelectorStartsWith = (selectorId: string) => `[data-testid^=${selectorId}]`
|
2023-05-22 09:02:54 -07: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)))
|
|
|
|
}
|