by sevenK8s · 1y ago · 0 comments
Setup: login. Test 1: delete your account. Test 2: can change username.
The last time I saw this handled was a test copy of db per thread and transactional test rolled back. Not great but it did 10x our pipelines and avoided locks and issues.
BUT obviously you can just test deleting the account at the end of the test that modifies the account.
SetAccountUserName(account, "New name"); GetAccount(account.id).UserName.Should().Be("New name");
SetAccountEmail(account, "new@email"); GetAccount(account.id).Email.Should().Be("new@email");
DeleteAccount(account); GetAccount(account.id).Should().BeNull();
This is a working timeline