Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion desktop/e2e/smoke.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,8 @@ test('renderer security', async ({ launch }) => {
// "Error invoking remote method" envelope, so codes like codemm:repair still match.
test('errors cross IPC as their own message', async ({ launch }) => {
const { app, page } = await launch();
await expect(page.getByRole('button', { name: 'Connect an agent', exact: true })).toBeVisible();
// A first window on a busy CI runner can take longer than the default 5 seconds.
await expect(page.getByRole('button', { name: 'Connect an agent', exact: true })).toBeVisible({ timeout: 30_000 });
const messages = await page.evaluate(async () => {
const bridge = (window as unknown as { codemm: { invoke(m: string, a: unknown[]): Promise<unknown> } }).codemm;
const call = (method: string, args: unknown[]) => bridge.invoke(method, args).then(() => 'resolved', (e: Error) => e.message);
Expand Down
10 changes: 6 additions & 4 deletions desktop/src/renderer/app/workNow.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,17 +99,18 @@ describe('running jobs in the sidebar (§4.11)', () => {
act(() => tell(jobAt('l1', 'lesson', { concept: TOPIC })));
act(() => tell(jobAt('a1', 'author', { concept: TOPIC, stage: 2, part: { done: 2, total: 3 } })));
act(() => tell(jobAt('r1', 'roadmap')));
expect(names()).toEqual([
// The list can land a moment after the events on a slow runner: wait for it.
await waitFor(() => expect(names()).toEqual([
'Writing a lesson on JavaScript basics, Writing the lesson',
'Writing an activity on JavaScript basics, Checking the exercise, step 2 of 3',
'Changing the roadmap, Changing the roadmap',
]);
]));

// A retry reads short; a job quiet for 90 seconds says it is still working; a finished job leaves.
act(() => tell(jobAt('l1', 'lesson', { concept: TOPIC, retry: { attempt: 2, of: 3 } })));
act(() => tell(jobAt('a1', 'author', { concept: TOPIC, idleMs: 95_000 })));
act(() => tell({ ...jobAt('r1', 'roadmap'), ended: true }));
expect(names()).toEqual(['Writing a lesson on JavaScript basics, Taking a little longer', 'Writing an activity on JavaScript basics, Still working']);
await waitFor(() => expect(names()).toEqual(['Writing a lesson on JavaScript basics, Taking a little longer', 'Writing an activity on JavaScript basics, Still working']));

await user.click(within(working()!).getByRole('button', { name: /^Writing a lesson/ }));
expect(await screen.findByRole('heading', { name: 'JavaScript basics' })).toBeInTheDocument();
Expand Down Expand Up @@ -174,7 +175,8 @@ describe('running jobs in the sidebar (§4.11)', () => {
await screen.findByRole('heading', { name: 'React' });
const rebuilding = jobAt('rb', 'rebuild', { track: 'React', stage: 0, thinking: false });
act(() => tell(rebuilding));
const job = within(working()!).getByRole('button');
// The list can land a moment after the event on a slow runner: wait for it.
const job = within(await within(sidebar()).findByRole('list', { name: 'Codemm is working' })).getByRole('button');
act(() => job.focus());
expect(job).toHaveFocus();
act(() => tell({ ...rebuilding, ended: true }));
Expand Down
Loading