fix(server): solve the proof of work and read the revocation notice without awaiting in a loop

The proof of work and the bounded read of a 403 body recurse instead of looping, the background-work checks compare against null instead of testing a promise, and the tests repeat their requests through oneByOne. The renewal test loads the stored key before its first request, and the panel test picks the last confirm button without Array.prototype.at.
This commit is contained in:
Maurice
2026-10-29 09:30:13 +01:00
committed by Maurice
parent 414a7ad98f
commit eeae904867
7 changed files with 51 additions and 39 deletions
@@ -97,7 +97,8 @@ describe('ServiceIdentityPanel', () => {
expect(screen.getByText('admin.trekApi.quota.regenerateBody')).toBeInTheDocument();
expect(regenerated).toBe(0);
const confirm = screen.getAllByRole('button', { name: 'admin.trekApi.quota.regenerate' }).at(-1);
const regenerateButtons = screen.getAllByRole('button', { name: 'admin.trekApi.quota.regenerate' });
const confirm = regenerateButtons[regenerateButtons.length - 1];
if (!confirm) throw new Error('no confirm button');
await user.click(confirm);
await waitFor(() => expect(regenerated).toBe(1));