fix(admin-ui): scope configuration modal lifecycles and validation
This commit is contained in:
@@ -3,9 +3,8 @@ using Shouldly;
|
||||
namespace ZB.MOM.WW.OtOpcUa.AdminUI.Tests;
|
||||
|
||||
/// <summary>
|
||||
/// Reads an AdminUI source file for a source-scan pin. The repo has no bUnit, so Razor wiring that a
|
||||
/// unit test cannot render is pinned by scanning the markup; it proves the wiring exists, not that it
|
||||
/// renders correctly (the docker-dev live pass covers that).
|
||||
/// Reads an AdminUI source file for a source-scan pin alongside rendered component tests.
|
||||
/// Source scans prove wiring exists; actual browser checks cover native behavior.
|
||||
/// </summary>
|
||||
internal static class AdminUiSource
|
||||
{
|
||||
@@ -14,12 +13,13 @@ internal static class AdminUiSource
|
||||
/// <returns>The file text.</returns>
|
||||
public static string Read(params string[] relativeSegments)
|
||||
{
|
||||
var dir = new DirectoryInfo(AppContext.BaseDirectory);
|
||||
var dir = new DirectoryInfo(Path.GetDirectoryName(SourceFile())!);
|
||||
while (dir is not null && !File.Exists(Path.Combine(dir.FullName, "ZB.MOM.WW.OtOpcUa.slnx")))
|
||||
dir = dir.Parent;
|
||||
dir.ShouldNotBeNull("could not locate the repository root (no ZB.MOM.WW.OtOpcUa.slnx above the test binary)");
|
||||
dir.ShouldNotBeNull("could not locate the repository root (no ZB.MOM.WW.OtOpcUa.slnx above the test source)");
|
||||
|
||||
var parts = new[] { dir!.FullName, "src", "Server", "ZB.MOM.WW.OtOpcUa.AdminUI" }.Concat(relativeSegments).ToArray();
|
||||
return File.ReadAllText(Path.Combine(parts));
|
||||
}
|
||||
private static string SourceFile([System.Runtime.CompilerServices.CallerFilePath] string sourceFile = "") => sourceFile;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user