Personal Telegram developer console for GitHub

test: cover workspace picker repository binding

davoodmehraban89 committed Oct 7, 2026 at 01:29 UTC 33b2b15883a7dd43fecf1ba308040f954d201d18
1 file changed +7
test/phase2-controller.test.js
+7
@@ -36,3 +36,10 @@ test('add-file callback actions are declared READ in the GitHub manifest', async
36 assert.equal(githubPluginManifest.actions[action]?.risk, 'READ', action + ' must be routed as owner-only READ');
37 }
38 });
39 +
40 +
41 +test('file picker rejects a repo id that is not bound to the workspace', async()=>{
42 + const workspaces={async getWorkspace(){return structuredClone(ws)}};
43 + const c=createWorkspaceController({github:{async listFiles(){throw new Error('must not read mismatched repo')}},workspaces});
44 + await assert.rejects(()=>c.resolveCallback('wfiles:W000000001:2',{ownerId:'42'}).execute(),/repository mismatch/i);
45 +});