refactor(centralui): migrate Move/Rename/Compose dialogs to DialogService.ShowAsync host (T33b)

This commit is contained in:
Joseph Doherty
2026-06-18 19:53:19 -04:00
parent c8915e8638
commit e0d085481f
9 changed files with 327 additions and 464 deletions
@@ -250,13 +250,21 @@ public class DataConnectionsPageTests : BunitContext
},
connections: new[] { new DataConnection("PLC-1", "OpcUa", 1) { Id = 100 } });
// T33b: the move dialog is now opened via IDialogService.ShowAsync and rendered
// by the shared DialogHost (which lives in MainLayout in production). Render a
// host in the same DI scope so the dialog the page opens is displayed; the host's
// focus-trap JS interop runs as no-ops under loose mode.
JSInterop.Mode = JSRuntimeMode.Loose;
var host = Render<DialogHost>();
var cut = Render<DataConnectionsPage>();
FindToggleForLabel(cut, "Plant-A")!.Click();
cut.FindAll("button").First(b => b.TextContent.Contains("Move to Site")).Click();
host.Render();
// The dialog renders with a site picker; the current site is excluded.
var dialog = cut.Find(".modal.show");
var dialog = host.Find(".modal.show");
var optionLabels = dialog.QuerySelectorAll("select option")
.Select(o => o.TextContent).ToList();
Assert.Contains(optionLabels, l => l.Contains("Plant-B"));