Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions tests/Healthie.Tests.E2E/DashboardGroupingTests.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Microsoft.Playwright;
using System.Text.RegularExpressions;

namespace Healthie.Tests.E2E;

Expand Down Expand Up @@ -385,9 +386,15 @@ public async Task Dashboard_LegendAndAbout_OpensBehindTheHeaderIconRatherThanTak

await page.GetByRole(AriaRole.Button, new() { Name = "Legend and about" }).ClickAsync();

await Assertions.Expect(page.Locator(".hpm-popover")).ToBeVisibleAsync();
// The version comes from the assembly; a Razor slip once rendered it as literal text.
await Assertions.Expect(page.Locator(".hpm-popover-head .hpm-tag")).Not.ToHaveTextAsync("v@PackageVersion");
var about = page.GetByRole(AriaRole.Dialog, new() { Name = "Legend and about" });
await Assertions.Expect(about).ToBeVisibleAsync();

// Scoped to this dialog, and asserted positively. ".hpm-popover-head .hpm-tag" matches the
// event log's header too, so it resolved to two elements whenever both were in the DOM --
// which is a strict-mode violation, and why this failed only under load. A negative
// assertion also passes when the element is simply missing; a version-shaped one cannot.
await Assertions.Expect(about.Locator(".hpm-popover-head .hpm-tag"))
.ToHaveTextAsync(new Regex(@"^v\d+\.\d+"));
browser.AssertNoErrors(page);
}

Expand Down