mirror of
https://github.com/nestriness/nestri.git
synced 2026-11-03 22:22:39 +02:00
feat(box): a listed box names its machine's host and whether it is the fleet
The desktop app gives a new cloud user a fleet box and then opens that machine's Steam sign-in on its hostname; GET /box now says which hostname, and which box is the fleet one.
This commit is contained in:
@@ -123,6 +123,18 @@ describe('POST /box on the fleet', () => {
|
||||
expect((await Box.listByUser(p.owner.userId)).length).toBe(1);
|
||||
});
|
||||
|
||||
test('a listed fleet box names the machine whose Steam sign-in it opens', async () => {
|
||||
const f = await fleet(1);
|
||||
useFleet(f.organisationId);
|
||||
const p = await person('fleet-host');
|
||||
expect((await createBox(p.headers, { on: 'fleet' })).status).toBe(201);
|
||||
const listed = ((await (await app.request('/box', { headers: p.headers })).json()) as any).data;
|
||||
const [slug] = await sql`select slug from machine where id = ${f.machines[0]!.id}`;
|
||||
expect(listed).toHaveLength(1);
|
||||
expect(listed[0].fleet).toBe(true);
|
||||
expect(listed[0].host).toBe(slug!.slug);
|
||||
});
|
||||
|
||||
test('`on` defaults to your own host', async () => {
|
||||
const f = await fleet(1);
|
||||
useFleet(f.organisationId);
|
||||
|
||||
Reference in New Issue
Block a user