From b9516e672127572183fb98e2d39fdcb5a50c3743 Mon Sep 17 00:00:00 2001 From: Joseph Doherty Date: Wed, 3 Jun 2026 03:34:12 -0400 Subject: [PATCH] feat(centralui): LoginCard sign-in Replace hand-rolled Bootstrap card with the shared from ZB.MOM.WW.Theme. Update ComponentRenderingTests assertions to match LoginCard's rendered structure (h1.login-title, div.panel.notice.login-error, "Sign in" button text). --- .../Components/Pages/Login.razor | 30 ++----------------- .../ComponentRenderingTests.cs | 8 ++--- 2 files changed, 6 insertions(+), 32 deletions(-) diff --git a/src/ZB.MOM.WW.ScadaBridge.CentralUI/Components/Pages/Login.razor b/src/ZB.MOM.WW.ScadaBridge.CentralUI/Components/Pages/Login.razor index 3c1f01ad..b7718610 100644 --- a/src/ZB.MOM.WW.ScadaBridge.CentralUI/Components/Pages/Login.razor +++ b/src/ZB.MOM.WW.ScadaBridge.CentralUI/Components/Pages/Login.razor @@ -3,34 +3,8 @@ @using Microsoft.AspNetCore.Authorization @attribute [AllowAnonymous] -
-
-
-

ScadaBridge

- - @if (!string.IsNullOrEmpty(ErrorMessage)) - { - - } - -
-
- - -
-
- - -
- -
-
-
-
+ @code { - [SupplyParameterFromQuery(Name = "error")] - public string? ErrorMessage { get; set; } + [SupplyParameterFromQuery(Name = "error")] public string? ErrorMessage { get; set; } } diff --git a/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/ComponentRenderingTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/ComponentRenderingTests.cs index ab37abea..fca3802c 100644 --- a/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/ComponentRenderingTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/ComponentRenderingTests.cs @@ -34,7 +34,7 @@ public class ComponentRenderingTests : BunitContext // Verify submit button var submitButton = cut.Find("button[type='submit']"); - Assert.Contains("Sign In", submitButton.TextContent); + Assert.Contains("Sign in", submitButton.TextContent); } [Fact] @@ -42,7 +42,7 @@ public class ComponentRenderingTests : BunitContext { var cut = Render(); - Assert.Throws(() => cut.Find("div.alert.alert-danger")); + Assert.Throws(() => cut.Find("div.panel.notice.login-error")); } [Fact] @@ -69,7 +69,7 @@ public class ComponentRenderingTests : BunitContext { var cut = Render(); - var title = cut.Find("h4.card-title"); - Assert.Equal("ScadaBridge", title.TextContent); + var title = cut.Find("h1.login-title"); + Assert.Contains("ScadaBridge", title.TextContent); } }