Replies: 1 comment
-
The best approach it to do browser testing using Playwright, where you navigate through your app like a real user and assert for errors/success messages by looking for the related elements on the webpage. Using the |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In short, I need to test whether validation occurs successfully in a particular controller action
When the email already exists, VineJS will raise a ValidationError exception, and the default handler will
However, in this test case, it treats the login page as the "referer" for the request, and on top of that, the japa test client follows up to 5 redirects by default, so once it follows the redirect, the flash messages get wiped.
To make this test work, I had to rewrite it as
It's obviously a bit clunkier than the initial assertions, but maybe there's a better way that I'm not aware of, so I thought I'd ask the community for help
Beta Was this translation helpful? Give feedback.
All reactions