Privacy-first password manager with built-in email aliasing. Fully encrypted and self-hostable.
Update tests (#1347)
Leendert de Borst07b6097d3144
diff --git a/apps/server/AliasVault.Client/Auth/Pages/Login.razor b/apps/server/AliasVault.Client/Auth/Pages/Login.razorindex 48b38479a..f7ca8fcb8 100644--- a/apps/server/AliasVault.Client/Auth/Pages/Login.razor+++ b/apps/server/AliasVault.Client/Auth/Pages/Login.razor@@ -113,10 +113,10 @@ else</div><div class="flex flex-col gap-4">- <button type="submit" class="w-full px-5 py-2 text-base font-medium text-center text-white bg-primary-700 rounded-lg hover:bg-primary-800 focus:ring-4 focus:ring-primary-300 dark:bg-primary-600 dark:hover:bg-primary-700 dark:focus:ring-primary-800 flex items-center justify-center gap-2">+ <button type="submit" id="login-button" class="w-full px-5 py-2 text-base font-medium text-center text-white bg-primary-700 rounded-lg hover:bg-primary-800 focus:ring-4 focus:ring-primary-300 dark:bg-primary-600 dark:hover:bg-primary-700 dark:focus:ring-primary-800 flex items-center justify-center gap-2">@Localizer["LoginButton"]</button>- <button type="button" @onclick="() => _showMobileLoginModal = true" class="hidden md:flex w-full px-5 py-2 text-base font-medium text-center text-gray-700 bg-white border border-gray-300 rounded-lg hover:bg-gray-100 focus:ring-4 focus:ring-gray-200 dark:bg-gray-700 dark:text-white dark:border-gray-600 dark:hover:bg-gray-600 dark:focus:ring-gray-700 items-center justify-center gap-2">+ <button type="button" id="mobile-login-button" @onclick="() => _showMobileLoginModal = true" class="hidden md:flex w-full px-5 py-2 text-base font-medium text-center text-gray-700 bg-white border border-gray-300 rounded-lg hover:bg-gray-100 focus:ring-4 focus:ring-gray-200 dark:bg-gray-700 dark:text-white dark:border-gray-600 dark:hover:bg-gray-600 dark:focus:ring-gray-700 items-center justify-center gap-2"><svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 18h.01M8 21h8a2 2 0 002-2V5a2 2 0 00-2-2H8a2 2 0 00-2 2v14a2 2 0 002 2z"></path></svg>diff --git a/apps/server/AliasVault.Client/Auth/Pages/Unlock.razor b/apps/server/AliasVault.Client/Auth/Pages/Unlock.razorindex 654669cb1..9f5d38d50 100644--- a/apps/server/AliasVault.Client/Auth/Pages/Unlock.razor+++ b/apps/server/AliasVault.Client/Auth/Pages/Unlock.razor@@ -72,12 +72,12 @@ else<ValidationMessage For="() => _unlockModel.Password"/></div>- <button type="submit" class="w-full px-5 py-2 text-base font-medium text-center text-white bg-primary-700 rounded-lg hover:bg-primary-800 focus:ring-4 focus:ring-primary-300 dark:bg-primary-600 dark:hover:bg-primary-700 dark:focus:ring-primary-800 flex items-center justify-center gap-2">+ <button type="submit" id="unlock-button" class="w-full px-5 py-2 text-base font-medium text-center text-white bg-primary-700 rounded-lg hover:bg-primary-800 focus:ring-4 focus:ring-primary-300 dark:bg-primary-600 dark:hover:bg-primary-700 dark:focus:ring-primary-800 flex items-center justify-center gap-2">@Localizer["UnlockButton"]</button></EditForm>- <button type="button" @onclick="() => _showMobileUnlockModal = true" class="hidden md:flex w-full px-5 py-2 text-base font-medium text-center text-gray-700 bg-white border border-gray-300 rounded-lg hover:bg-gray-100 focus:ring-4 focus:ring-gray-200 dark:bg-gray-700 dark:text-white dark:border-gray-600 dark:hover:bg-gray-600 dark:focus:ring-gray-700 items-center justify-center gap-2 mt-4">+ <button type="button" id="mobile-unlock-button" @onclick="() => _showMobileUnlockModal = true" class="hidden md:flex w-full px-5 py-2 text-base font-medium text-center text-gray-700 bg-white border border-gray-300 rounded-lg hover:bg-gray-100 focus:ring-4 focus:ring-gray-200 dark:bg-gray-700 dark:text-white dark:border-gray-600 dark:hover:bg-gray-600 dark:focus:ring-gray-700 items-center justify-center gap-2 mt-4"><svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 18h.01M8 21h8a2 2 0 002-2V5a2 2 0 00-2-2H8a2 2 0 00-2 2v14a2 2 0 002 2z"></path></svg>diff --git a/apps/server/Tests/AliasVault.E2ETests/Common/ClientPlaywrightTest.cs b/apps/server/Tests/AliasVault.E2ETests/Common/ClientPlaywrightTest.csindex 16c2bf7a8..673b40f8c 100644--- a/apps/server/Tests/AliasVault.E2ETests/Common/ClientPlaywrightTest.cs+++ b/apps/server/Tests/AliasVault.E2ETests/Common/ClientPlaywrightTest.cs@@ -173,7 +173,7 @@ public class ClientPlaywrightTest : PlaywrightTest{ "password", TestUserPassword },});- var submitButton = Page.GetByRole(AriaRole.Button, new() { Name = "Unlock" });+ var submitButton = Page.Locator("#unlock-button");await submitButton.ClickAsync();// Wait for the sync page to showdiff --git a/apps/server/Tests/AliasVault.E2ETests/Tests/Admin/PasswordLockoutTests.cs b/apps/server/Tests/AliasVault.E2ETests/Tests/Admin/PasswordLockoutTests.csindex 7ea6ff501..918c5ddef 100644--- a/apps/server/Tests/AliasVault.E2ETests/Tests/Admin/PasswordLockoutTests.cs+++ b/apps/server/Tests/AliasVault.E2ETests/Tests/Admin/PasswordLockoutTests.cs@@ -32,7 +32,7 @@ public class PasswordLockoutTests : AdminPlaywrightTest{await Page.Locator("input[id='username']").FillAsync(TestUserUsername);await Page.Locator("input[id='password']").FillAsync("wrongpassword");- var submitButton = Page.GetByRole(AriaRole.Button, new() { Name = "Login to your account" });+ var submitButton = Page.Locator("#login-button");await submitButton.ClickAsync();// Wait for the text "Error: Invalid login attempt." to appear if we expect not to be locked out yet..diff --git a/apps/server/Tests/AliasVault.E2ETests/Tests/Admin/TwoFactorAuthLockoutTests.cs b/apps/server/Tests/AliasVault.E2ETests/Tests/Admin/TwoFactorAuthLockoutTests.csindex fc26d6272..82dbb6709 100644--- a/apps/server/Tests/AliasVault.E2ETests/Tests/Admin/TwoFactorAuthLockoutTests.cs+++ b/apps/server/Tests/AliasVault.E2ETests/Tests/Admin/TwoFactorAuthLockoutTests.cs@@ -62,7 +62,7 @@ public class TwoFactorAuthLockoutTests : AdminPlaywrightTest{ "password", TestUserPassword },});- submitButton = Page.GetByRole(AriaRole.Button, new() { Name = "Login" });+ submitButton = Page.Locator("#login-button");await submitButton.ClickAsync();// Wait for 2FA page.diff --git a/apps/server/Tests/AliasVault.E2ETests/Tests/Client/Shard1/JwtTokenTests.cs b/apps/server/Tests/AliasVault.E2ETests/Tests/Client/Shard1/JwtTokenTests.csindex 4b57dfa67..cf2bb68ae 100644--- a/apps/server/Tests/AliasVault.E2ETests/Tests/Client/Shard1/JwtTokenTests.cs+++ b/apps/server/Tests/AliasVault.E2ETests/Tests/Client/Shard1/JwtTokenTests.cs@@ -66,7 +66,7 @@ public class JwtTokenTests : ClientPlaywrightTest{ "password", TestUserPassword },});- var submitButton = Page.GetByRole(AriaRole.Button, new() { Name = "Unlock" });+ var submitButton = Page.Locator("#unlock-button");await submitButton.ClickAsync();// Check if we get redirected back to the page we were trying to access.@@ -96,9 +96,9 @@ public class JwtTokenTests : ClientPlaywrightTest// Not all pages do a webapi call on load everytime so we need to navigate to a page that does.await NavigateUsingBlazorRouter("test/2");- await WaitForUrlAsync("user/login", "Login");+ await WaitForUrlAsync("user/login", "Log in");var pageContent = await Page.TextContentAsync("body");- Assert.That(pageContent, Does.Contain("Login"), "No redirect to login while refresh token should be expired.");+ Assert.That(pageContent, Does.Contain("Log in"), "No redirect to login while refresh token should be expired.");}}diff --git a/apps/server/Tests/AliasVault.E2ETests/Tests/Client/Shard5/UnlockTests.cs b/apps/server/Tests/AliasVault.E2ETests/Tests/Client/Shard5/UnlockTests.csindex 655491b15..44ee7bea0 100644--- a/apps/server/Tests/AliasVault.E2ETests/Tests/Client/Shard5/UnlockTests.cs+++ b/apps/server/Tests/AliasVault.E2ETests/Tests/Client/Shard5/UnlockTests.cs@@ -65,7 +65,7 @@ public class UnlockTests : ClientPlaywrightTest{ "password", TestUserPassword },});- var submitButton = Page.GetByRole(AriaRole.Button, new() { Name = "Unlock" });+ var submitButton = Page.Locator("#unlock-button");await submitButton.ClickAsync();// Check if we get redirected back to the page we were trying to access.