epicweb-dev / epic-stack

This is a Full Stack app starter with the foundational things setup and configured for you to hit the ground running on your next EPIC idea.
https://www.epicweb.dev/epic-stack
MIT License
4.47k stars 368 forks source link

Test for onboarding after GitHub OAuth #680

Closed rustworthy closed 4 months ago

rustworthy commented 6 months ago

This is a chaser to #675

Adding e2e test for GitHub OAuth onboarding and, since we are here, verifying the status button is idle when they first get onto the onboarding page.

Test Plan

Checklist

Screenshots

rustworthy commented 6 months ago

Thanks for this! I've looked over some of it and have a bit of feedback. Thanks!

This is totally my pleasure! Please have a look at it once again

rustworthy commented 6 months ago

This is so rad. Thank you for working on it! I just have a couple things!

The pleasure is all mine! I thank you back, and also @kettanaito and all the members of the epic community for the great conference. I watched the first half (your morning - my evening) live and the record of the second half the next day.

As for this thread, I did spend some time on it after Artem's review, and did not find a way out. Besides, I found myself duplicating a lot of logic from the app (stealing btw some work from the mocked GitHub API) and so being dependent on the implementation details. Of note here is that we are using the msw layer for the GitHub API which we allow to hit in the variant I am suggesting. We are using the Playwright test runner API to pass through the request to GitHub (and we in this test do not know this is mocked GitHub) only patching the request headers.

I also see a separation of concerns: we are mocking 3rd party services with msw and only patching request to our own API. My understanding is that this is a nice combo. At the same time, I am not excluding that there is a more elegant solution that I am missing :sweat_smile:

rustworthy commented 4 months ago

Thanks for this! I think we should probably use a fixture for this to reduce repetition and improve reliable cleanup. Here's the bit in epic web about this: https://testing.epicweb.dev/03

We have a fixture for the login state. It'll be similar to that.

I appreciate your work on this! I'm excited to get this merged!

The pleasure is all mine! Please check it out once again