You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi! In my company, we're using Remix, and we're making more or less the same approach of auth with Cookies, but haven't been able to test it correctly. We're trying to test that a loader has a cookie that an action has previously set with: redirect("/", {headers: {"Set-Cookie": "cookie=foo"}}). The problem is that the loader doesn't receive any cookie, and it has been impossible to test it using remixStub.
Testing auth is very important for us, but ideally, we don't want to start using an e2e tool such as playwright because Vitest (+ happy-dom) is way faster, is there anything you think we might be missing or do you have any comment?
Furthermore, it would be awesome if you show us how would you to test these kinds of examples!
The text was updated successfully, but these errors were encountered:
Hello @EnriqueCepeda, as per my understanding of the question, I think using our request object does give us access to the created cookie.
you can do so like this.
Although this approach would not be greatly suggested, rather have a server side module or function where you can call in the cookie and check up on things in any way you would like to, and you might call that function in any of the loader you would prefer to.
Hi! In my company, we're using Remix, and we're making more or less the same approach of auth with Cookies, but haven't been able to test it correctly. We're trying to test that a loader has a cookie that an action has previously set with:
redirect("/", {headers: {"Set-Cookie": "cookie=foo"}})
. The problem is that the loader doesn't receive any cookie, and it has been impossible to test it using remixStub.Testing auth is very important for us, but ideally, we don't want to start using an e2e tool such as playwright because Vitest (+ happy-dom) is way faster, is there anything you think we might be missing or do you have any comment?
Furthermore, it would be awesome if you show us how would you to test these kinds of examples!
The text was updated successfully, but these errors were encountered: