Add confirmed admin override for provisioning player checks

This commit is contained in:
2026-10-05 18:16:02 -04:00
parent 4b0f341d64
commit 8abe71b915
20 changed files with 362 additions and 26 deletions
+10
View File
@@ -23,6 +23,16 @@ function deferred() {
}
describe('provisioning detail refresh ownership', () => {
it('sends explicit override confirmation and refreshes the operation after acceptance', async () => {
const fetcher = vi.fn().mockResolvedValueOnce(Response.json({ ok: true })).mockResolvedValueOnce(response('a', 2));
const page = setup(fetcher);
page.setOperation('a', detail('a'));
await page.act('override', 'Override enabled.', { confirmed: true });
expect(fetcher).toHaveBeenNthCalledWith(1, '/api/provisioning/a/override', expect.objectContaining({
method: 'POST', headers: { 'Content-Type': 'application/json' }, body: '{"confirmed":true}'
}));
expect(page.state()).toMatchObject({ detail: detail('a', 2), notice: 'Override enabled.', busy: null });
});
it('uses the server snapshot without another initial request and coalesces background reads', async () => {
const pending = deferred();
const fetcher = vi.fn(() => pending.promise);