Login with email and confirm age on registration (#493)

* Implement login with email

* Add confirm age checkbox to register page

* Fix registration unit tests

* Fix registration unit tests for real this time

Co-authored-by: Dagg <32235163+daggintosh@users.noreply.github.com>
This commit is contained in:
Josh 2022-09-29 17:34:22 -05:00 committed by GitHub
commit ee11798dc6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 45 additions and 10 deletions

View file

@ -28,6 +28,8 @@ public class RegisterTests : LighthouseWebTest
this.Driver.FindElement(By.Id("password")).SendKeys(password);
this.Driver.FindElement(By.Id("confirmPassword")).SendKeys(password);
this.Driver.FindElement(By.Id("age-checkbox")).Click();
this.Driver.FindElement(By.Id("submit")).Click();
User? user = await database.Users.FirstOrDefaultAsync(u => u.Username == username);
@ -51,6 +53,8 @@ public class RegisterTests : LighthouseWebTest
this.Driver.FindElement(By.Id("password")).SendKeys(password);
this.Driver.FindElement(By.Id("confirmPassword")).SendKeys(password + "a");
this.Driver.FindElement(By.Id("age-checkbox")).Click();
this.Driver.FindElement(By.Id("submit")).Click();
User? user = await database.Users.FirstOrDefaultAsync(u => u.Username == username);
@ -76,6 +80,8 @@ public class RegisterTests : LighthouseWebTest
this.Driver.FindElement(By.Id("password")).SendKeys(password);
this.Driver.FindElement(By.Id("confirmPassword")).SendKeys(password);
this.Driver.FindElement(By.Id("age-checkbox")).Click();
this.Driver.FindElement(By.Id("submit")).Click();
Assert.Contains("The username you've chosen is already taken.", this.Driver.PageSource);