change tests assuming result will be at top

This commit is contained in:
2024-08-29 19:49:35 -06:00
parent 22f85f2321
commit 676a03d379

View File

@@ -64,13 +64,13 @@ test('Create new project, then search for it', async ({ page }) => {
// Search for newly-created project in /projects
await page.goto('./projects');
await page.getByRole('link', { name: 'Projects', exact: true }).click();
await expect(page.locator('ul#listProjects li.border-b:nth-child(1)')).toContainText(finalRandomString); // Assumes newest project always appears first in the Projects tab list
await expect(page.locator('ul#listProjects li').filter({ hasText: finalTitle })).toBeVisible();
// Search for newly-created project in /discover
await page.goto('./discover');
await page.getByPlaceholder('Search…').fill(finalRandomString);
await page.locator('#QuickSearch button').click();
await expect(page.locator('ul#listDiscoverResults li.border-b:nth-child(1)')).toContainText(finalRandomString);
await expect(page.locator('ul#listDiscoverResults li').filter({ hasText: finalTitle })).toBeVisible();
// Edit the project
await page.locator('a').filter({ hasText: finalTitle }).first().click();