#addie_code

1 messages ¡ Page 1 of 1 (latest)

wet horizonBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1222636195654139977

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

upper bloomBOT
peak temple
#

Hey there

#

Apologies for the delay

#

Can you clarify a little bit here -- you want to use Stripe Mock to actually render Payment Element?

odd sun
#

hi! I'm working with the Payment Element and in my test I just want to write an expect that an iframe has rendered and the src contains stripe since i can't really test the iframe itself

#

But to load the iframe I need to call loadStripe and I'm having issues on how to mock that out

peak temple
#

Yeah you can't mock Element renderings

odd sun
#

ooo hrm is there an alternative test the people are doing for their frontends?

#

it was all I could think of to make sure it is a stripe component on the page

peak temple
#

Mostly no unfortunately. We don't have a great solution at the moment for frontend programmatic testing. Overall we don't recommend trying to mock the frontend as we don't provide any sort of Jest library that we will guarantee is supported. Thus any testing in this manner is quite brittle

odd sun
#

oof okay thank you

#

If instead of mocking, can we use the sandbox publishable key?

peak temple
#

Yeah we definitely recommend using your test keys to test -- however don't believe you will be able to do programmatic testing like that even in that case.

odd sun
#

Apart from lots of calls, would it not render for jest or what are the issues there?

peak temple
#

Yeah it won't render for jest afaik

odd sun
#

okay thanks