Privacy-first password manager with built-in email aliasing. Fully encrypted and self-hostable.
Fix tests (#142)
Leendert de Borstf46202223a0d
diff --git a/src/AliasVault.Admin/Main/App.razor b/src/AliasVault.Admin/Main/App.razorindex 9d33105f5..8bacef0ec 100644--- a/src/AliasVault.Admin/Main/App.razor+++ b/src/AliasVault.Admin/Main/App.razor@@ -17,7 +17,7 @@<body class="bg-gray-50 dark:bg-gray-800"><Routes @rendermode="RenderModeForPage"/><script src="@VersionService.GetVersionedPath("lib/qrcode.min.js")"></script>-<script src="@VersionService.GetVersionedPath("js/darkMode.js")"></script>+<script src="@VersionService.GetVersionedPath("js/dark-mode.js")"></script><script src="@VersionService.GetVersionedPath("js/utilities.js")"></script><script>diff --git a/src/AliasVault.Admin/Main/Components/Alerts/GlobalNotificationDisplay.razor b/src/AliasVault.Admin/Main/Components/Alerts/GlobalNotificationDisplay.razorindex 4cd4a7b89..a2882da06 100644--- a/src/AliasVault.Admin/Main/Components/Alerts/GlobalNotificationDisplay.razor+++ b/src/AliasVault.Admin/Main/Components/Alerts/GlobalNotificationDisplay.razor@@ -26,7 +26,7 @@if (firstRender){- // We subscribe to the OnChange event of the PortalMessageService to update the UI when a new message is added+ // We subscribe to the OnChange event of the GlobalNotificationService to update the UI when a new message is addedRefreshAddMessages();GlobalNotificationService.OnChange += RefreshAddMessages;_onChangeSubscribed = true;diff --git a/src/AliasVault.Client/Main/Pages/Credentials/View.razor b/src/AliasVault.Client/Main/Pages/Credentials/View.razorindex fe06aec27..48e5ca208 100644--- a/src/AliasVault.Client/Main/Pages/Credentials/View.razor+++ b/src/AliasVault.Client/Main/Pages/Credentials/View.razor@@ -115,17 +115,6 @@ elseBreadcrumbItems.Add(new BreadcrumbItem { DisplayName = "View credentials entry" });}- /// <inheritdoc />- protected override async Task OnAfterRenderAsync(bool firstRender)- {- await base.OnAfterRenderAsync(firstRender);-- if (firstRender)- {- await LoadEntryAsync();- }- }-/// <inheritdoc />protected override async Task OnParametersSetAsync(){@@ -133,6 +122,9 @@ elseawait LoadEntryAsync();}+ /// <summary>+ /// Loads the credentials entry.+ /// </summary>private async Task LoadEntryAsync(){IsLoading = true;diff --git a/src/AliasVault.Client/Main/Pages/Settings/General.razor b/src/AliasVault.Client/Main/Pages/Settings/General.razorindex a1be0d2f7..6dd395f88 100644--- a/src/AliasVault.Client/Main/Pages/Settings/General.razor+++ b/src/AliasVault.Client/Main/Pages/Settings/General.razor@@ -72,7 +72,7 @@protected override async Task OnInitializedAsync(){await base.OnInitializedAsync();- BreadcrumbItems.Add(new BreadcrumbItem { DisplayName = "Vault settings" });+ BreadcrumbItems.Add(new BreadcrumbItem { DisplayName = "General settings" });DefaultEmailDomain = DbService.Settings.DefaultEmailDomain;AutoEmailRefresh = DbService.Settings.AutoEmailRefresh;diff --git a/src/AliasVault.Client/Program.cs b/src/AliasVault.Client/Program.csindex d3757306d..55266a11c 100644--- a/src/AliasVault.Client/Program.cs+++ b/src/AliasVault.Client/Program.cs@@ -43,6 +43,7 @@ builder.Services.AddLogging(logging =>logging.AddFilter("Microsoft.AspNetCore.Identity.DataProtectorTokenProvider", LogLevel.Error);logging.AddFilter("Microsoft.AspNetCore.Identity.UserManager", LogLevel.Error);+ logging.AddFilter("System.Net.Http.HttpClient", LogLevel.Error);});builder.RootComponents.Add<App>("#app");diff --git a/src/AliasVault.Client/Services/GlobalNotificationService.cs b/src/AliasVault.Client/Services/GlobalNotificationService.csindex dbb795d6f..0b8ad5f50 100644--- a/src/AliasVault.Client/Services/GlobalNotificationService.cs+++ b/src/AliasVault.Client/Services/GlobalNotificationService.cs@@ -20,14 +20,14 @@ public class GlobalNotificationServicepublic event Action? OnChange;/// <summary>- /// Gets or sets success messages that should be displayed to the user.+ /// Gets success messages that should be displayed to the user./// </summary>- protected List<string> SuccessMessages { get; set; } = [];+ protected List<string> SuccessMessages { get; } = [];/// <summary>- /// Gets or sets error messages that should be displayed to the user.+ /// Gets error messages that should be displayed to the user./// </summary>- protected List<string> ErrorMessages { get; set; } = [];+ protected List<string> ErrorMessages { get; } = [];/// <summary>/// Adds a success message to the list of messages that should be displayed to the user.diff --git a/src/AliasVault.Client/wwwroot/css/tailwind.css b/src/AliasVault.Client/wwwroot/css/tailwind.cssindex 4cfd4509e..babf97f1c 100644--- a/src/AliasVault.Client/wwwroot/css/tailwind.css+++ b/src/AliasVault.Client/wwwroot/css/tailwind.css@@ -640,11 +640,6 @@ video {grid-column: 1 / -1;}-.mx-3 {- margin-left: 0.75rem;- margin-right: 0.75rem;-}-.mx-4 {margin-left: 1rem;margin-right: 1rem;@@ -724,6 +719,18 @@ video {margin-right: 1rem;}+.ms-2 {+ margin-inline-start: 0.5rem;+}++.ms-3 {+ margin-inline-start: 0.75rem;+}++.ms-5 {+ margin-inline-start: 1.25rem;+}+.mt-0 {margin-top: 0px;}@@ -748,18 +755,6 @@ video {margin-top: 2rem;}-.ms-2 {- margin-inline-start: 0.5rem;-}--.ms-5 {- margin-inline-start: 1.25rem;-}--.ms-3 {- margin-inline-start: 0.75rem;-}-.block {display: block;}diff --git a/src/Tests/AliasVault.E2ETests/Common/ClientPlaywrightTest.cs b/src/Tests/AliasVault.E2ETests/Common/ClientPlaywrightTest.csindex e6b645e93..3a1ce80df 100644--- a/src/Tests/AliasVault.E2ETests/Common/ClientPlaywrightTest.cs+++ b/src/Tests/AliasVault.E2ETests/Common/ClientPlaywrightTest.cs@@ -183,11 +183,11 @@ public class ClientPlaywrightTest : PlaywrightTestvar submitButton = Page.Locator("text=Save Credentials").First;await submitButton.ClickAsync();- await WaitForUrlAsync("credentials/**", "Login credentials");+ await WaitForUrlAsync("credentials/**", "View credentials entry");// Check if the credential was createdvar pageContent = await Page.TextContentAsync("body");- Assert.That(pageContent, Does.Contain("Login credentials"), "Credential not created.");+ Assert.That(pageContent, Does.Contain("View credentials entry"), "Credential not created.");}/// <summary>diff --git a/src/Tests/AliasVault.E2ETests/Common/PlaywrightTest.cs b/src/Tests/AliasVault.E2ETests/Common/PlaywrightTest.csindex 8db769afe..ac226eb9e 100644--- a/src/Tests/AliasVault.E2ETests/Common/PlaywrightTest.cs+++ b/src/Tests/AliasVault.E2ETests/Common/PlaywrightTest.cs@@ -160,7 +160,13 @@ public abstract class PlaywrightTestawait Page.WaitForURLAsync("**/" + relativeUrl, new PageWaitForURLOptions() { Timeout = TestDefaults.DefaultTimeout });// Wait for actual content to load (web API calls, etc.)- await Page.WaitForSelectorAsync("text=" + waitForText, new PageWaitForSelectorOptions() { Timeout = TestDefaults.DefaultTimeout });+ await Page.GetByText(waitForText, new PageGetByTextOptions { Exact = false })+ .First+ .WaitForAsync(new LocatorWaitForOptions+ {+ Timeout = TestDefaults.DefaultTimeout,+ State = WaitForSelectorState.Attached,+ });}/// <summary>diff --git a/src/Tests/AliasVault.E2ETests/Tests/Admin/AuthTests.cs b/src/Tests/AliasVault.E2ETests/Tests/Admin/AuthTests.csindex 4e0a64a06..059b9245d 100644--- a/src/Tests/AliasVault.E2ETests/Tests/Admin/AuthTests.cs+++ b/src/Tests/AliasVault.E2ETests/Tests/Admin/AuthTests.cs@@ -36,7 +36,7 @@ public class AuthTests : AdminPlaywrightTestawait submitButton.ClickAsync();// Wait for current page to refresh and confirm message shows.- await WaitForUrlAsync("account/manage/change-password", "Error");+ await WaitForUrlAsync("account/manage/change-password", "Incorrect");var pageContent = await Page.TextContentAsync("body");Assert.That(pageContent, Does.Contain("Error: Incorrect password."), "No error shown after submitting change password field with wrong old password.");diff --git a/src/Tests/AliasVault.E2ETests/Tests/Client/CredentialTest.cs b/src/Tests/AliasVault.E2ETests/Tests/Client/CredentialTest.csindex 6755d9fe0..789e2a56a 100644--- a/src/Tests/AliasVault.E2ETests/Tests/Client/CredentialTest.cs+++ b/src/Tests/AliasVault.E2ETests/Tests/Client/CredentialTest.cs@@ -82,6 +82,7 @@ public class CredentialTest : ClientPlaywrightTestawait submitButton.ClickAsync();await WaitForUrlAsync("credentials/**", "View credentials entry");+ await Task.Delay(5000);pageContent = await Page.TextContentAsync("body");Assert.That(pageContent, Does.Contain("Credentials updated"), "Credential update confirmation message not shown.");Assert.That(pageContent, Does.Contain(serviceNameAfter), "Credential not updated correctly.");diff --git a/src/Tests/AliasVault.E2ETests/Tests/Client/GeneralSettingsTest.cs b/src/Tests/AliasVault.E2ETests/Tests/Client/GeneralSettingsTest.csindex f397f0bd6..3dfefb4b5 100644--- a/src/Tests/AliasVault.E2ETests/Tests/Client/GeneralSettingsTest.cs+++ b/src/Tests/AliasVault.E2ETests/Tests/Client/GeneralSettingsTest.cs@@ -23,7 +23,7 @@ public class GeneralSettingsTest : ClientPlaywrightTestpublic async Task MutateDefaultEmailDomainTest(){await NavigateUsingBlazorRouter("settings/general");- await WaitForUrlAsync("settings/general", "General settings");+ await WaitForUrlAsync("settings/general", "Configure general");// Check if the expected content is present.var pageContent = await Page.TextContentAsync("body");