diff --git a/tests/job-history.spec.ts b/tests/job-history.spec.ts index aaa3c75..5484069 100644 --- a/tests/job-history.spec.ts +++ b/tests/job-history.spec.ts @@ -17,10 +17,10 @@ test("JobHistory shows jobs and job detail navigates", async ({ page }) => { const jobId = body.jobId || body.job?.id; expect(jobId).toBeTruthy(); - // Navigate to stock detail page by clicking the symbol link (avoids aborted navigations) - const symbolLink = firstRow.locator('td a'); - await symbolLink.click(); - await page.waitForURL(new RegExp(`/stocks/${ticker}`), { timeout: 10000 }); + // Navigate to stock detail page directly (use absolute URL to avoid SPA navigation races) + const base = new URL(page.url()).origin; + await page.goto(`${base}/stocks/${ticker}`, { waitUntil: 'load', timeout: 20000 }); + await page.waitForSelector('text=Job History', { timeout: 10000 }); // Wait up to 10s for JobHistory to show at least one job await page.waitForSelector('text=Job History', { timeout: 10000 });