From 59e094ada307c03bb61658993e1aa4c1ae9af4d8 Mon Sep 17 00:00:00 2001 From: Joseph Doherty Date: Wed, 17 Jun 2026 16:08:37 -0400 Subject: [PATCH] =?UTF-8?q?test(playwright):=20DebugViewTree=20=E2=80=94?= =?UTF-8?q?=20tolerate=20empty=20alarm=20forest=20(TreeView=20renders=20Em?= =?UTF-8?q?ptyContent,=20not=20role=3Dtree,=20when=20no=20alarms)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Deployment/DebugViewTreeTests.cs | 31 ++++++++++++------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/tests/ZB.MOM.WW.ScadaBridge.CentralUI.PlaywrightTests/Deployment/DebugViewTreeTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.PlaywrightTests/Deployment/DebugViewTreeTests.cs index 13c5c134..0fd056f8 100644 --- a/tests/ZB.MOM.WW.ScadaBridge.CentralUI.PlaywrightTests/Deployment/DebugViewTreeTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.PlaywrightTests/Deployment/DebugViewTreeTests.cs @@ -37,14 +37,14 @@ namespace ZB.MOM.WW.ScadaBridge.CentralUI.PlaywrightTests.Deployment; /// /// /// -/// Why the tree assertion is robust regardless of seeded alarms — the -/// always renders its <ul role="tree"> root -/// (with an EmptyContent "No alarms." / "No attributes." slot when the -/// forest is empty), so asserting a [role="tree"] inside the active pane -/// holds whether or not the fixture instance happens to carry a configured alarm -/// or composition members. The test therefore does NOT depend on heavy alarm -/// seeding: it proves the Alarms tab switches the visible pane and that pane hosts -/// a tree, which is the structural contract of the tabs+trees rework. +/// Why the alarms-tab assertion is tolerant — the +/// renders its <ul role="tree"> root ONLY +/// when the forest is non-empty; when empty it renders the EmptyContent +/// slot ("No alarms.") with no [role="tree"] element. The seeded +/// instance has no configured alarms, so the +/// alarms pane shows the empty hint. The Attributes pane always has data (one +/// attribute is seeded), so its [role="tree"] assertion remains strict. +/// The populated alarm tree is covered by bUnit tests (DebugViewAlarmTableTests). /// /// [Collection("Playwright")] @@ -116,9 +116,18 @@ public class DebugViewTreeTests : IClassFixture await Assertions.Expect(alarmTab).ToHaveAttributeAsync("aria-selected", "true"); await Assertions.Expect(alarmPane).ToBeVisibleAsync(new() { Timeout = 10_000 }); await Assertions.Expect(attrPane).ToBeHiddenAsync(); - // The TreeView always renders its