Clarify host readiness when game files or runtime are missing
This commit is contained in:
@@ -156,7 +156,7 @@ describe('host deletion', () => {
|
||||
expect(roleAllows('admin', permission)).toBe(true);
|
||||
expect(roleAllows('operator', permission)).toBe(false); expect(roleAllows('viewer', permission)).toBe(false);
|
||||
const { DELETE } = await import('../../src/routes/api/hosts/[id]/+server.js');
|
||||
for (const headers of [{ origin: 'https://attacker.test' }, { authorization: `Bearer ${hosts.credentials.credential}` }]) {
|
||||
for (const headers of [new Headers({ origin: 'https://attacker.test' }), new Headers({ authorization: `Bearer ${hosts.credentials.credential}` })]) {
|
||||
expect(() => DELETE({ request: new Request('https://ec.test/api/hosts/id', { method: 'DELETE', headers }), params: { id: hosts.host.id } })).toThrow(expect.objectContaining({ status: 403 }));
|
||||
}
|
||||
expect(hosts.getHost(hosts.host.id)).not.toBeNull();
|
||||
|
||||
Reference in New Issue
Block a user