test(playwright): add CLI role-mapping create/delete helpers (Wave 4 prep)
This commit is contained in:
+23
@@ -165,4 +165,27 @@ public class CliRunnerHelpersTests
|
||||
try { Assert.True(id > 0); }
|
||||
finally { await CliRunner.DeleteSharedScriptAsync(id); }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A freshly created LDAP→role mapping returns a positive id, is discoverable by its
|
||||
/// <c>ldapGroupName</c> in <c>security role-mapping list</c>, and is cleanly deleted in
|
||||
/// teardown, exercising <see cref="CliRunner.CreateRoleMappingAsync"/> and
|
||||
/// <see cref="CliRunner.DeleteRoleMappingAsync"/> as a round-trip.
|
||||
/// </summary>
|
||||
[SkippableFact]
|
||||
public async Task CreateThenDeleteRoleMapping_RoundTrips()
|
||||
{
|
||||
Skip.IfNot(await ClusterAvailability.IsAvailableAsync(), ClusterAvailability.SkipReason);
|
||||
var group = CliRunner.UniqueName("grp");
|
||||
var id = await CliRunner.CreateRoleMappingAsync(group, "Designer");
|
||||
try
|
||||
{
|
||||
Assert.True(id > 0);
|
||||
using var list = await CliRunner.RunJsonAsync("security", "role-mapping", "list");
|
||||
Assert.Contains(
|
||||
list.RootElement.EnumerateArray(),
|
||||
e => e.TryGetProperty("ldapGroupName", out var n) && n.GetString() == group);
|
||||
}
|
||||
finally { await CliRunner.DeleteRoleMappingAsync(id); }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user