feat(uns): equipment detail page shell + Details tab + create-redirect

This commit is contained in:
Joseph Doherty
2026-06-11 14:36:48 -04:00
parent 5cae3c5b96
commit 7fbfeca451
5 changed files with 363 additions and 0 deletions
@@ -0,0 +1,36 @@
using Shouldly;
using Xunit;
using ZB.MOM.WW.OtOpcUa.AdminUI.Uns;
namespace ZB.MOM.WW.OtOpcUa.AdminUI.Tests.Uns;
/// <summary>
/// Verifies <see cref="UnsTreeService.LoadEquipmentPickContextAsync"/> resolves a line to its owning
/// cluster and returns that cluster's lines (for the equipment page's Details-tab line picker), and
/// returns empty option lists when the line is null or cannot be resolved.
/// </summary>
[Trait("Category", "Unit")]
public sealed class UnsTreeServiceEquipmentPickContextTests
{
private static UnsTreeService SeededService()
{
var dbName = $"uns-pickctx-{Guid.NewGuid():N}";
UnsTreeTestDb.SeedNamed(dbName);
return new UnsTreeService(UnsTreeTestDb.Factory(dbName));
}
[Fact]
public async Task ResolvesClusterLines_forKnownLine()
{
var ctx = await SeededService().LoadEquipmentPickContextAsync("LINE-1");
ctx.Lines.ShouldContain(o => o.Id == "LINE-1");
}
[Fact]
public async Task Empty_for_null_or_unknown_line()
{
var svc = SeededService();
(await svc.LoadEquipmentPickContextAsync(null)).Lines.ShouldBeEmpty();
(await svc.LoadEquipmentPickContextAsync("NOPE")).Lines.ShouldBeEmpty();
}
}