Personal Telegram developer console for GitHub

test: require commit detail drill-down

davoodmehraban89 committed Oct 4, 2026 at 17:42 UTC 6a40cce674b9ab652bc8e4b749681148749c45eb
1 file changed +17 -1
test/telegram-menu-e2e.test.js
+17 -1
@@ -8,7 +8,9 @@ const github = {
8 async listIssuesPage() { return { items: [{ number: 7, title: 'Broken report', state: 'open', author: 'owner', comments: 3 }], hasMore: false }; },
9 async getIssue() { return { number: 7, title: 'Broken report', state: 'open', author: 'owner', comments: 3, body: 'Reproduction and expected result', labels: ['bug'], assignees: ['owner'], createdAt: '2026-10-04T10:00:00Z', updatedAt: '2026-10-04T11:00:00Z' }; },
10 async listReleases() { return [{ id: 9, tag: 'v2.1.0', name: 'V2.1', draft: false, prerelease: false, publishedAt: '2026-10-04T10:00:00Z' }]; },
11 - async getRelease() { return { id: 9, tag: 'v2.1.0', name: 'V2.1', body: 'Production release notes', draft: false, prerelease: false, publishedAt: '2026-10-04T10:00:00Z', author: 'owner', target: 'main' }; }
11 + async getRelease() { return { id: 9, tag: 'v2.1.0', name: 'V2.1', body: 'Production release notes', draft: false, prerelease: false, publishedAt: '2026-10-04T10:00:00Z', author: 'owner', target: 'main' }; },
12 + async listCommits() { return [{ sha: 'abcdef1', fullSha: 'abcdef1234567890abcdef1234567890abcdef12', message: 'feat: useful change', author: 'owner', date: '2026-10-04' }]; },
13 + async getCommit() { return { sha: 'abcdef1234567890abcdef1234567890abcdef12', message: 'feat: useful change\n\nDetails', author: 'owner', date: '2026-10-04T12:00:00Z', additions: 12, deletions: 3, changedFiles: 2, files: [{ filename: 'src/app.js', status: 'modified', additions: 10, deletions: 2 }] }; }
14 };
15 const menu = { async renderByCallback() { return { text: 'fallback', reply_markup: { inline_keyboard: [] } }; } };
16 const workspaces = { async getWorkspace() { return null; } };
@@ -54,3 +56,17 @@ test('repository report views always retain a project recovery route', async ()
56 assert.ok(callbacks(view).includes(`repo:${repoId}`), `${callback} must retain project recovery`);
57 }
58 });
59 +
60 +
61 +test('commit list drills into source-backed commit detail and preserves recovery navigation', async () => {
62 + const plugin = createGitHubPlugin({ github, menu, workspaces });
63 + const list = await plugin.resolveCallback(`commits:${repoId}`).execute();
64 + assertTelegramContract(list);
65 + const detailCallback = `commitdetail:${repoId}:abcdef1234567890abcdef1234567890abcdef12`;
66 + assert.ok(callbacks(list).includes(detailCallback), 'commit list must expose detail drill-down');
67 + const detail = await plugin.resolveCallback(detailCallback).execute();
68 + assertTelegramContract(detail);
69 + assert.match(detail.text, /Details/);
70 + assert.match(detail.text, /src\/app\.js/);
71 + assert.ok(callbacks(detail).includes(`commits:${repoId}`));
72 +});