Skip to content

Commit

Permalink
feat: Add data testing attribute to PaymentMethod component
Browse files Browse the repository at this point in the history
  • Loading branch information
acasazza committed Feb 28, 2022
1 parent d8e7e00 commit 7e08b86
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/PaymentMethod.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,21 +68,21 @@ const PaymentMethod: FunctionComponent<PaymentMethodProps> = ({
paymentSelected,
setPaymentSelected,
}
const paymentResource = payment?.payment_source_type as PaymentResource
const onClickable = !clickableContainer
? undefined
: async (e: MouseEvent<HTMLDivElement>) => {
e.stopPropagation()
setLoadingPlaceOrder({ loading: true })
setPaymentSelected(payment.id)
const paymentResource =
payment?.payment_source_type as PaymentResource
const paymentMethodId = payment?.id as string
await setPaymentMethod({ paymentResource, paymentMethodId })
onClick && onClick(payment)
setLoadingPlaceOrder({ loading: false })
}
return (
<div
data-test-id={paymentResource}
key={k}
className={`${className} ${isActive ? activeClass : ''}`}
onClick={onClickable}
Expand Down

0 comments on commit 7e08b86

Please sign in to comment.