Skip to content

Commit 58ae8c5

Browse files
committed
test(e2e): reflect baseline reset behavior without explicit instance row
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
1 parent 6d5b140 commit 58ae8c5

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

playwright/e2e/policy-workbench-system-default-persistence.spec.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,14 @@ async function chooseTarget(dialog: Locator, ariaLabel: 'Target groups' | 'Targe
242242
}
243243

244244
async function resetSystemRuleToBaseline(dialog: Locator) {
245+
const instanceRow = getRuleRow(dialog, 'Instance', instanceWideTargetLabel)
246+
const hasInstanceRule = await instanceRow.count().then((count) => count > 0)
247+
248+
if (hasInstanceRule) {
249+
await removeRule(dialog, 'Instance', instanceWideTargetLabel)
250+
return
251+
}
252+
245253
await openSystemDefaultEditor(dialog)
246254
expect(await setSigningFlow(dialog, 'none'), 'Expected signing-flow radios in system editor').toBe(true)
247255
await submitSystemRuleAndWait(dialog)
@@ -334,7 +342,7 @@ test('system default persists across edit cycles and can be reset to the system
334342
await expect(getRuleRow(reloadedDialog, 'Instance', instanceWideTargetLabel)).toContainText('Simultaneous (Parallel)')
335343

336344
await resetSystemRuleToBaseline(reloadedDialog)
337-
await expect(getRuleRow(reloadedDialog, 'Instance', instanceWideTargetLabel)).toContainText('Let users choose')
345+
await expect(getRuleRow(reloadedDialog, 'Instance', instanceWideTargetLabel)).toHaveCount(0)
338346
await expect(reloadedDialog.getByText(/Default:\s*Let users choose/i)).toBeVisible()
339347
})
340348

@@ -399,6 +407,6 @@ test('admin can manage instance and user rules while signature-flow group rules
399407

400408
// Global rule: reset to explicit "let users choose" baseline
401409
await resetSystemRuleToBaseline(reloadedDialog)
402-
await expect(getRuleRow(reloadedDialog, 'Instance', instanceWideTargetLabel)).toContainText('Let users choose')
410+
await expect(getRuleRow(reloadedDialog, 'Instance', instanceWideTargetLabel)).toHaveCount(0)
403411
await expect(reloadedDialog.getByText(/Default:\s*Let users choose/i)).toBeVisible()
404412
})

0 commit comments

Comments
 (0)