Skip to content

Commit

Permalink
feat: add amount test
Browse files Browse the repository at this point in the history
  • Loading branch information
ntheile committed Nov 4, 2022
1 parent 57cb908 commit acc7187
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import { CommonActions } from "@react-navigation/native"
import useMainQuery from "@app/hooks/use-main-query"
import { useI18nContext } from "@app/i18n/i18n-react"
import { logPaymentAttempt, logPaymentResult } from "@app/utils/analytics"
import { testProps } from "../../../utils/testProps"

const styles = StyleSheet.create({
scrollView: {
Expand Down Expand Up @@ -556,6 +557,7 @@ const SendBitcoinConfirmationScreen = ({
) : null}
<View style={styles.buttonContainer}>
<Button
{...testProps(LL.SendBitcoinConfirmationScreen.title())}
loading={isLoading}
title={LL.SendBitcoinConfirmationScreen.title()}
buttonStyle={styles.button}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import Icon from "react-native-vector-icons/Ionicons"
import NoteIcon from "@app/assets/icons/note.svg"
import { Button } from "react-native-elements"
import { useI18nContext } from "@app/i18n/i18n-react"
import { testProps } from "utils/testProps"
import { testProps } from "../../../utils/testProps"

const Styles = StyleSheet.create({
scrollView: {
Expand Down
27 changes: 22 additions & 5 deletions e2e/03-payments-flow.e2e.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ describe("Payments Flow", async () => {
}
const client = createGaloyServerClient({ config })({ authToken })
const result = await client.mutate({
variables: { input: { walletId: "8914b38f-b0ea-4639-9f01-99c03125eea5" } },
variables: { input: { walletId: "8914b38f-b0ea-4639-9f01-99c03125eea5" } }, // TODO (lookup wallet id from graphql)
mutation: MUTATIONS.lnNoAmountInvoiceCreate,
fetchPolicy: "no-cache",
})
Expand All @@ -56,16 +56,31 @@ describe("Payments Flow", async () => {
}
})

it("Click Next", async () => {
const nextButton = await $(selector(LL.common.next()))
await nextButton.waitForDisplayed({ timeout })
await nextButton.click()
})

it("Add amount", async () => {
// USD Amount or BTC Amount
try {
const amountInput = await $(selector("USD Amount", "TextField"))
await amountInput.waitForDisplayed({ timeout })
await amountInput.click()
await browser.pause(500)
await amountInput.sendKeys("2".split(""))
await enter(amountInput)
} catch (e) {
// TODO this passes but throws an error on ios even tho it works
}
})

it("Add Note or label", async () => {
//
})

it("Click Next", async () => {
// Error Please Enter a valid destination
const nextButton = await $(selector(LL.common.next()))
await nextButton.waitForDisplayed({ timeout })
await nextButton.click()
Expand All @@ -77,9 +92,11 @@ describe("Payments Flow", async () => {
})

it("Click 'Confirm Payment'", async () => {
// const nextButton = await $(selector(LL.common.next()))
// await nextButton.waitForDisplayed({ timeout })
// await nextButton.click()
const confirmPaymentButton = await $(
selector(LL.SendBitcoinConfirmationScreen.title()),
)
await confirmPaymentButton.waitForDisplayed({ timeout })
await confirmPaymentButton.click()
})

it("Wait for Green check", async () => {
Expand Down

0 comments on commit acc7187

Please sign in to comment.