Add confirmed admin override for provisioning player checks
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user