test(e2e): guard ApiSurfaceFixture partial-init delete + seal TransportImportTests (final review nits)

This commit is contained in:
Joseph Doherty
2026-06-06 12:37:21 -04:00
parent 09f14f18ea
commit 0700777e2f
2 changed files with 7 additions and 2 deletions
@@ -28,7 +28,12 @@ public sealed class ApiSurfaceFixture : IAsyncLifetime
}
catch
{
await CliRunner.DeleteApiMethodAsync(MethodId);
// Partial-init guard: MethodId is non-zero only if CreateApiMethodAsync succeeded,
// so skip the delete when nothing was created (avoids a phantom delete --id 0).
if (MethodId != 0)
{
await CliRunner.DeleteApiMethodAsync(MethodId);
}
Available = false;
throw;
}
@@ -35,7 +35,7 @@ namespace ZB.MOM.WW.ScadaBridge.CentralUI.PlaywrightTests.Transport;
/// </para>
/// </summary>
[Collection("Playwright")]
public class TransportImportTests
public sealed class TransportImportTests
{
private readonly PlaywrightFixture _fixture;