refactor(centralui): migrate Move/Rename/Compose dialogs to DialogService.ShowAsync host (T33b)
This commit is contained in:
@@ -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"));
|
||||
|
||||
Reference in New Issue
Block a user