From 754f049a98acb09c454c92bd1901d24382a7610f Mon Sep 17 00:00:00 2001 From: Joseph Doherty Date: Fri, 5 Jun 2026 10:11:17 -0400 Subject: [PATCH] test(e2e): guard BundleExport comma + document DeleteAreaAsync (review fixes) --- .../Cluster/CliRunner.Helpers.cs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/tests/ZB.MOM.WW.ScadaBridge.CentralUI.PlaywrightTests/Cluster/CliRunner.Helpers.cs b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.PlaywrightTests/Cluster/CliRunner.Helpers.cs index b5ad5ed2..1c732205 100644 --- a/tests/ZB.MOM.WW.ScadaBridge.CentralUI.PlaywrightTests/Cluster/CliRunner.Helpers.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.PlaywrightTests/Cluster/CliRunner.Helpers.cs @@ -194,6 +194,15 @@ public static partial class CliRunner /// swallows any failure. /// /// Area id. + /// + /// This method intentionally does NOT delegate to + /// even though the behaviour is identical. models + /// two-word commands (<group> <verb>), whereas + /// site area delete is a three-word command; extracting it would require + /// changing 's signature or adding an overload. + /// The inline try/catch is kept here deliberately — if you need to fix teardown + /// logic, update both this method and any other three-word deletes together. + /// public static async Task DeleteAreaAsync(int id) { try @@ -267,6 +276,16 @@ public static partial class CliRunner string outputPath, int templateId, string passphrase, string sourceEnvironment) { var templateName = await ResolveTemplateNameAsync(templateId); + + // The CLI's --templates flag is comma-separated, so a name that itself + // contains a comma would silently split into multiple selectors and scope + // the export to the wrong set of templates. + if (templateName.Contains(',')) + { + throw new InvalidOperationException( + $"Template name '{templateName}' contains a comma and cannot be used with '--templates'."); + } + await RunAsync( "bundle", "export", "--output", outputPath,