In this episode, we dive into the user registration process from scratch. We kick things off by setting up some basic automated tests to make sure registration works—things like submitting the form and checking that the user shows up in the database afterwards.
We start by creating a new register page and hooking it up to the routes. To keep our form looking sharp, we pull in the Tailwind Forms package. We also tweak the password validation a bit so we only need a single password field on the form.
A big part of this episode is writing tests: first, to check that validation fires if you leave out required info, and then to actually register a user, make sure they're saved in the database, and get logged in automatically. There are a couple hiccups—like missing a service provider or a migration—but we walk through how to deal with those.
At the end, we mention that our current tests are a bit long-winded, but don't worry—up next, we’ll see how to clean them up and write them faster using PEST's syntax and features!