test(centralui): register IEndpointVerificationService in OpcUaEndpointEditor/DataConnectionForm fixtures broken by B8 verify-button (T17)

This commit is contained in:
Joseph Doherty
2026-06-18 03:38:43 -04:00
parent 1a7e735149
commit a56805e681
2 changed files with 15 additions and 0 deletions
@@ -6,6 +6,7 @@ using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components.Authorization;
using Microsoft.Extensions.DependencyInjection;
using NSubstitute;
using ZB.MOM.WW.ScadaBridge.CentralUI.Services;
using ZB.MOM.WW.ScadaBridge.Commons.Entities.Sites;
using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories;
using DataConnectionForm = ZB.MOM.WW.ScadaBridge.CentralUI.Components.Pages.Design.DataConnectionForm;
@@ -19,6 +20,9 @@ public class DataConnectionFormTests : BunitContext
public DataConnectionFormTests()
{
Services.AddSingleton(_siteRepo);
// The OPC UA editor rendered inside the form injects IEndpointVerificationService
// (B8 / T17 Verify-endpoint button); a no-op substitute satisfies the injection.
Services.AddSingleton<IEndpointVerificationService>(Substitute.For<IEndpointVerificationService>());
AddTestAuth();
var sites = new List<Site> { new("Plant-A", "plant-a") { Id = 1 } };
_siteRepo.GetAllSitesAsync(Arg.Any<CancellationToken>())