keycloak/js/apps/admin-ui/test/utils
João Viegas 32e304b9c2
Fix stale empty state after deleting last resource on a page (#47373)
When the last item on a paginated table is deleted, the UI
incorrectly displayed 'No resources found' instead of navigating
back to the previous page. This commit resolves the local state
issue and adds a Playwright E2E regression test to ensure the
table correctly refetches and displays the remaining resources.

Refactored E2E test:
- Replaced while(true) loop with a deterministic for loop;
- Implemented exact string matching and test id locators;
- Added resource cleanup to prevent polluting subsequent tests;
- Added deleteResource in AdminClient.ts to assist in the cleanup.

Closes #46089

Signed-off-by: João Viegas <joao.manuel.loja.viegas@tecnico.ulisboa.pt>
2026-03-25 16:24:54 -04:00
..
files
AdminClient.ts
attributes.ts
constants.ts
file-chooser.ts
form.ts
login.ts
masthead.ts
modal.ts
roles.ts
sidebar.ts
table.ts