Harden research e2e selectors

This commit is contained in:
2026-03-14 19:58:22 -04:00
parent 2ee9a549a3
commit 73a6d13b69

View File

@@ -176,19 +176,26 @@ test('supports the core coverage-to-research workflow', async ({ page }, testInf
await page.getByLabel('Coverage tags').fill('AI, semis');
await page.getByRole('button', { name: 'Save coverage' }).click();
await expect(page.getByRole('cell', { name: 'NVIDIA Corporation' })).toBeVisible();
await page.getByLabel('NVDA status').selectOption('active');
await expect(page.getByLabel('NVDA status')).toHaveValue('active');
await page.getByLabel('NVDA priority').selectOption('high');
await expect(page.getByLabel('NVDA priority')).toHaveValue('high');
const coverageTable = page.locator('.data-table-wrap:visible');
const nvdaRow = coverageTable.locator('tbody tr').filter({
has: page.getByText('NVIDIA Corporation')
});
await page.getByRole('link', { name: /^Open overview/ }).first().click();
await expect(coverageTable).toHaveCount(1);
await expect(nvdaRow).toHaveCount(1);
await page.waitForFunction(() => window.innerWidth >= 1024);
await nvdaRow.getByLabel('NVDA status').selectOption('active');
await expect(nvdaRow.getByLabel('NVDA status')).toHaveValue('active');
await nvdaRow.getByLabel('NVDA priority').selectOption('high');
await expect(nvdaRow.getByLabel('NVDA priority')).toHaveValue('high');
await nvdaRow.locator('a[href="/analysis?ticker=NVDA"]').click();
await expect(page).toHaveURL(/\/analysis\?ticker=NVDA/);
await expect(page.getByText('Bull vs Bear')).toBeVisible();
await expect(page.getByText('Past 7 Days')).toBeVisible();
await expect(page.getByText('Recent Developments')).toBeVisible();
await expect(page.getByRole('heading', { name: 'Recent Developments' })).toBeVisible();
await page.getByRole('link', { name: 'Research' }).first().click();
await page.locator('a[href="/research?ticker=NVDA"]').first().click();
await expect(page).toHaveURL(/\/research\?ticker=NVDA/);
await page.getByLabel('Research note title').fill('Own-the-stack moat check');
await page.getByLabel('Research note summary').fill('Initial moat checkpoint');