#brianm_best-practices
1 messages ¡ Page 1 of 1 (latest)
đ 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/1237465170733961301
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hello! You're correct, we discourage testing of our UI components as we have many security measures in place that will often break those tests. We recommend you mock the responses from our surfaces instead of actually using those components or hitting our API in your CI pipeline.
These are end-to-end browser tests. The whole point is to test that our Stripe integration, particularly with the PaymentElement, is working. Seems like mocking the component would defeat the whole purpose of the test. Would it be possible to have a way to disable those security features for testing? These are really valuable tests that we aren't able to use anymore.
There is no way to disable those security measures, no.
Those tests can still make sure the changes you're making on your end are working as expected with our usual mocked responses.
If I understand what you're saying, we should mock out all of our stripe components, replacing them with ones that behave the same way, without interacting with Stripe. Isn't that what test mode is for?
Test mode is for developing and testing while you're building. It's not for CI, load testing, and things like that.
You can use test mode to produce the mocked responses, and periodically update/confirm them as needed, but interacting with test mode shouldn't be a thing every time you build.
Mocking responses works fine for APIs. Are you also suggesting that we mock out the entire client side interface and components?