test(playwright): CliRunner AddAlarm + alarm-override-delete helpers + round-trip (typed flags)

This commit is contained in:
Joseph Doherty
2026-06-07 10:05:32 -04:00
parent bbc3804d07
commit f0b144ebda
2 changed files with 59 additions and 0 deletions
@@ -188,4 +188,23 @@ public class CliRunnerHelpersTests
}
finally { await CliRunner.DeleteRoleMappingAsync(id); }
}
/// <summary>
/// Exercises the typed HiLo setpoint flags end-to-end: a template alarm added via
/// <see cref="CliRunner.AddAlarmAsync"/> with <c>--hi</c>/<c>--hihi</c> returns a
/// positive id, confirming the server accepted the serialized trigger-config JSON.
/// </summary>
[SkippableFact]
public async Task AddAlarmWithTypedFlags_RoundTrips()
{
Skip.IfNot(await ClusterAvailability.IsAvailableAsync(), ClusterAvailability.SkipReason);
var id = await CliRunner.CreateTemplateAsync(CliRunner.UniqueName("tmpl"));
try
{
await CliRunner.AddAttributeAsync(id, "Value", "Double");
var alarmId = await CliRunner.AddAlarmAsync(id, "HiHi", "HiLo", 500, attribute: "Value", hi: 80, hiHi: 95);
Assert.True(alarmId > 0); // server accepted the serialized trigger-config JSON
}
finally { await CliRunner.DeleteTemplateAsync(id); }
}
}