fix tests (from project-page switch 4 commits ago) and fix linting

This commit is contained in:
2024-11-03 15:23:03 -07:00
parent 4168c37074
commit 67b2b7199a
8 changed files with 56 additions and 36 deletions

View File

@@ -48,8 +48,8 @@ test('Create new project, then search for it', async ({ page }) => {
// Create new project
await page.goto('./projects');
await page.getByTestId('closeOnboardingAndFinish').click();
await page.getByRole('link', { name: 'Projects', exact: true }).click();
// close onboarding, but not with a click to go to the main screen
await page.locator('div > svg.fa-xmark').click();
await page.locator('button > svg.fa-plus').click();
await page.getByPlaceholder('Idea Name').fill(finalTitle);
await page.getByPlaceholder('Description').fill(finalDescription);
@@ -64,8 +64,7 @@ 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').filter({ hasText: finalTitle })).toBeVisible();
await page.locator('ul#listProjects li').filter({ hasText: finalTitle });
// Search for newly-created project in /discover
await page.goto('./discover');

View File

@@ -43,10 +43,10 @@ test('Create 10 new projects', async ({ page }) => {
for (let i = 0; i < projectCount; i++) {
await page.goto('./projects');
if (i === 0) {
await page.getByTestId('closeOnboardingAndFinish').click();
// close onboarding, but not with a click to go to the main screen
await page.locator('div > svg.fa-xmark').click();
}
await page.getByRole('link', { name: 'Projects', exact: true }).click();
await page.getByRole('button').click();
await page.locator('button > svg.fa-plus').click();
await page.getByPlaceholder('Idea Name').fill(finalTitles[i]); // Add random suffix
await page.getByPlaceholder('Description').fill(finalDescriptions[i]);
await page.getByPlaceholder('Website').fill(standardWebsite);

View File

@@ -27,6 +27,7 @@ test('Record an offer', async ({ page }) => {
// go to the offer and check the values
await page.goto('./projects');
await page.getByRole('link', { name: 'Offers', exact: true }).click();
await page.locator('li').filter({ hasText: description }).locator('a').first().click();
await expect(page.getByRole('heading', { name: 'Verifiable Claim Details' })).toBeVisible();
await expect(page.getByText(description, { exact: true })).toBeVisible();
@@ -42,6 +43,7 @@ test('Record an offer', async ({ page }) => {
// find the edit page and check the old values again
await page.goto('./projects');
await page.getByRole('link', { name: 'Offers', exact: true }).click();
await page.locator('li').filter({ hasText: description }).locator('a').first().click();
await page.getByTestId('editClaimButton').click();
await page.locator('heading', { hasText: 'What is offered' }).isVisible();
@@ -57,6 +59,7 @@ test('Record an offer', async ({ page }) => {
// go to the offer claim again and check the updated values
await page.goto('./projects');
await page.getByRole('link', { name: 'Offers', exact: true }).click();
await page.locator('li').filter({ hasText: description }).locator('a').first().click();
const newItemDesc = await page.getByTestId('description');
await expect(newItemDesc).toHaveText(updatedDescription);