mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-10-07 16:09:43 +02:00
fix(merge): reconcile cross-PR test seams after #141/#145/#146 merges
- help-modal extractor bounds at the next HTML comment (cron modal's 'Run At' text false-positived the stale-shortcut regex) - remote-shell run test expects the wired /api/quick-start path (#145) — POST /api/sessions has no caseName in its schema Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -15,7 +15,10 @@ function extractElementById(html: string, id: string): string {
|
|||||||
const start = html.lastIndexOf('<', idIndex);
|
const start = html.lastIndexOf('<', idIndex);
|
||||||
expect(start, `expected #${id} start tag`).toBeGreaterThanOrEqual(0);
|
expect(start, `expected #${id} start tag`).toBeGreaterThanOrEqual(0);
|
||||||
|
|
||||||
const nextSection = html.indexOf('<!-- Monitor Panel', idIndex);
|
// Bound at the next HTML comment (every following section is comment-labeled) so
|
||||||
|
// sections inserted between this element and any fixed marker don't leak into the
|
||||||
|
// slice — the cron modal's "Run At" text false-positived the stale-shortcut check.
|
||||||
|
const nextSection = html.indexOf('<!--', idIndex);
|
||||||
expect(nextSection, `expected section marker after #${id}`).toBeGreaterThanOrEqual(0);
|
expect(nextSection, `expected section marker after #${id}`).toBeGreaterThanOrEqual(0);
|
||||||
|
|
||||||
const end = nextSection;
|
const end = nextSection;
|
||||||
|
|||||||
@@ -271,10 +271,9 @@ describe('case selector refresh', () => {
|
|||||||
}),
|
}),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
if (url === '/api/sessions') {
|
if (url === '/api/quick-start') {
|
||||||
return { json: async () => ({ success: true, data: { session: { id: 'sess-1' } } }) };
|
return { json: async () => ({ success: true, data: { sessionId: 'sess-1' } }) };
|
||||||
}
|
}
|
||||||
if (url === '/api/sessions/sess-1/shell') return { json: async () => ({ success: true }) };
|
|
||||||
throw new Error(`unexpected fetch: ${url}`);
|
throw new Error(`unexpected fetch: ${url}`);
|
||||||
},
|
},
|
||||||
console,
|
console,
|
||||||
@@ -292,11 +291,15 @@ describe('case selector refresh', () => {
|
|||||||
|
|
||||||
await app.runShell();
|
await app.runShell();
|
||||||
|
|
||||||
expect(requests.find((req) => req.url === '/api/sessions')?.body).toMatchObject({
|
// Remote cases must ride /api/quick-start (which resolves the remote case and
|
||||||
|
// launches over ssh) — POST /api/sessions stat-validates workingDir locally and
|
||||||
|
// its schema has no caseName, so the remote display path must never reach it.
|
||||||
|
expect(requests.find((req) => req.url === '/api/quick-start')?.body).toMatchObject({
|
||||||
caseName: 'gpu-work',
|
caseName: 'gpu-work',
|
||||||
mode: 'shell',
|
mode: 'shell',
|
||||||
});
|
});
|
||||||
expect(requests.find((req) => req.url === '/api/sessions')?.body).not.toHaveProperty('workingDir');
|
expect(requests.find((req) => req.url === '/api/quick-start')?.body).not.toHaveProperty('workingDir');
|
||||||
|
expect(requests.some((req) => req.url === '/api/sessions')).toBe(false);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('removes a deleted selected case from the dropdown and blurs the native picker', async () => {
|
it('removes a deleted selected case from the dropdown and blurs the native picker', async () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user