From 0b1b05c1dba48bc6468e6bcb7eb2a0a968daa9d8 Mon Sep 17 00:00:00 2001 From: zhom <2717306+zhom@users.noreply.github.com> Date: Sun, 16 Aug 2026 22:31:47 +0400 Subject: [PATCH] test: integration cleanup --- e2e/tests/integrations.test.mjs | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/e2e/tests/integrations.test.mjs b/e2e/tests/integrations.test.mjs index f251d9d..b34cf7a 100644 --- a/e2e/tests/integrations.test.mjs +++ b/e2e/tests/integrations.test.mjs @@ -567,8 +567,24 @@ test("authenticated REST API serves its complete OpenAPI contract and CRUD lifec ); assert.equal(assigned.response.status, 200, JSON.stringify(assigned.value)); assert.equal(assigned.value.profile.id, launchProfile.id); - // `ApiProfile` carries no `extension_group_id`, so the assignment can only - // be read back through the surface the launcher itself resolves. + // A caller that can set the assignment must be able to read it back without + // dropping to the desktop app. + assert.equal( + assigned.value.profile.extension_group_id, + launchGroupId, + "the update response must echo the assignment it just made", + ); + assert.equal( + ( + await jsonRequest(`${base}/v1/profiles/${launchProfile.id}`, { + token: saved.api_token, + }) + ).value.profile.extension_group_id, + launchGroupId, + "a fresh GET must report the assignment", + ); + // Also read it back through the surface the launcher itself resolves, so + // the REST field and the launch path cannot drift apart. const assignedGroup = () => app.invoke("get_extension_group_for_profile", { profileId: launchProfile.id, @@ -610,6 +626,15 @@ test("authenticated REST API serves its complete OpenAPI contract and CRUD lifec 200, ); assert.equal(await assignedGroup(), null); + assert.equal( + ( + await jsonRequest(`${base}/v1/profiles/${launchProfile.id}`, { + token: saved.api_token, + }) + ).value.profile.extension_group_id, + null, + "clearing the assignment must be visible over REST too", + ); assert.equal( ( await jsonRequest(`${base}/v1/extension-groups/${launchGroupId}`, {