Clarify host readiness when game files or runtime are missing

This commit is contained in:
2026-10-04 10:03:43 -04:00
parent 3d62dfff27
commit 62d7817ea3
8 changed files with 58 additions and 10 deletions
+1 -1
View File
@@ -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();