In this episode, we focus on making sure users can't remove themselves from a team, which is a handy safety check for most applications. First, we add a quick automated test to ensure trying to self-remove is actually blocked – right now, it would work, which isn't great. You’ll see how that test initially fails, and then we'll hop over to our team policy and add a simple check to prevent it.
Next up, we do a bit of manual testing in the UI: adding users back to the team, logging in as them, and checking that the "remove from team" button hides itself when it should (like if you're looking at your own account). We also play around with user roles a bit so different permission scenarios make sense.
Finally, we check everything from different user perspectives, just so we’re sure the right people see the right options. There's also a little discussion about how you might want to tweak these permissions down the line, like making sure no one can remove the team owner. So, by the end of this episode, you’ll have strong team member removal controls wired up, both in your backend policy logic and reflected in your frontend UI!