test(playwright): web-first timeouts on alarm-override zero-count asserts + split compound asserts (T41 review)

This commit is contained in:
Joseph Doherty
2026-06-18 19:42:33 -04:00
parent acbb52b459
commit 67ff494bf5
@@ -299,8 +299,8 @@ public sealed class InstanceConfigureTests : IClassFixture<InstanceConfigureFixt
using var triggerDoc = JsonDocument.Parse(triggerJson!); using var triggerDoc = JsonDocument.Parse(triggerJson!);
var trigger = triggerDoc.RootElement; var trigger = triggerDoc.RootElement;
Assert.True(trigger.TryGetProperty("hi", out var hi) Assert.True(trigger.TryGetProperty("hi", out var hi), "Expected 'hi' property in the override.");
&& hi.GetDouble() == 70, "Expected the override to carry the changed hi=70."); Assert.Equal(70.0, hi.GetDouble());
// The merge signature: hiHi is NOT in the override (it survives from the inherited config // The merge signature: hiHi is NOT in the override (it survives from the inherited config
// at flatten time, rather than being re-stored by a whole-replace). // at flatten time, rather than being re-stored by a whole-replace).
Assert.False(trigger.TryGetProperty("hiHi", out _), Assert.False(trigger.TryGetProperty("hiHi", out _),
@@ -357,9 +357,8 @@ public sealed class InstanceConfigureTests : IClassFixture<InstanceConfigureFixt
using var triggerDoc = JsonDocument.Parse(triggerJson!); using var triggerDoc = JsonDocument.Parse(triggerJson!);
var trigger = triggerDoc.RootElement; var trigger = triggerDoc.RootElement;
Assert.True(trigger.TryGetProperty("matchValue", out var mv) Assert.True(trigger.TryGetProperty("matchValue", out var mv), "Expected 'matchValue' property in the override.");
&& mv.GetString() == "250", Assert.Equal("250", mv.GetString());
"Expected the whole-replaced override to carry the new matchValue=250.");
} }
finally finally
{ {
@@ -408,8 +407,8 @@ public sealed class InstanceConfigureTests : IClassFixture<InstanceConfigureFixt
await Assertions.Expect(error).ToContainTextAsync("integer"); await Assertions.Expect(error).ToContainTextAsync("integer");
await Assertions.Expect(page.Locator("[data-test='alarm-save-override']")).ToBeVisibleAsync(); await Assertions.Expect(page.Locator("[data-test='alarm-save-override']")).ToBeVisibleAsync();
// No success toast and no override badge on the row — the Save was rejected. // No success toast and no override badge on the row — the Save was rejected.
await Assertions.Expect(page.Locator(".toast")).ToHaveCountAsync(0); await Assertions.Expect(page.Locator(".toast")).ToHaveCountAsync(0, new() { Timeout = 5_000 });
await Assertions.Expect(row.Locator("[data-test='alarm-override-badge']")).ToHaveCountAsync(0); await Assertions.Expect(row.Locator("[data-test='alarm-override-badge']")).ToHaveCountAsync(0, new() { Timeout = 5_000 });
// Read-back: no override was persisted. // Read-back: no override was persisted.
using var doc = await CliRunner.GetInstanceDocumentAsync(_cfg.InstanceId); using var doc = await CliRunner.GetInstanceDocumentAsync(_cfg.InstanceId);
@@ -451,7 +450,7 @@ public sealed class InstanceConfigureTests : IClassFixture<InstanceConfigureFixt
// Cancel discards the edit and closes the modal. // Cancel discards the edit and closes the modal.
await page.Locator("[data-test='alarm-cancel-override']").ClickAsync(); await page.Locator("[data-test='alarm-cancel-override']").ClickAsync();
await Assertions.Expect(hiInput).ToHaveCountAsync(0, new() { Timeout = 15_000 }); await Assertions.Expect(hiInput).ToHaveCountAsync(0, new() { Timeout = 15_000 });
await Assertions.Expect(row.Locator("[data-test='alarm-override-badge']")).ToHaveCountAsync(0); await Assertions.Expect(row.Locator("[data-test='alarm-override-badge']")).ToHaveCountAsync(0, new() { Timeout = 5_000 });
// Read-back: nothing was persisted. // Read-back: nothing was persisted.
using var doc = await CliRunner.GetInstanceDocumentAsync(_cfg.InstanceId); using var doc = await CliRunner.GetInstanceDocumentAsync(_cfg.InstanceId);