From 886202e4c822ee9a5be2be9a4683243d03d2483a Mon Sep 17 00:00:00 2001 From: Trent Larson Date: Sun, 16 Feb 2025 21:00:52 -0700 Subject: [PATCH] fix a check for user's registration status --- test-playwright/40-add-contact.spec.ts | 5 ++--- test-playwright/testUtils.ts | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/test-playwright/40-add-contact.spec.ts b/test-playwright/40-add-contact.spec.ts index cc5717a..56821ec 100644 --- a/test-playwright/40-add-contact.spec.ts +++ b/test-playwright/40-add-contact.spec.ts @@ -92,9 +92,8 @@ test('Add contact, record gift, confirm gift', async ({ page }) => { await page.goto('./contacts'); await page.getByPlaceholder('URL or DID, Name, Public Key').fill('did:ethr:0x0000694B58C2cC69658993A90D3840C560f2F51F, ' + userName); await page.locator('button > svg.fa-plus').click(); - // This should not be visible because user #1 is not registered, but firefox is getting the logic wrong somehow. - // await expect(page.locator('div[role="alert"] span:has-text("No")')).toBeVisible(); - // await page.locator('div[role="alert"] button:has-text("No")').click(); + await expect(page.locator('div[role="alert"] span:has-text("No")')).toBeVisible(); + await page.locator('div[role="alert"] button:has-text("No")').click(); await expect(page.locator('div[role="alert"] span:has-text("Contact Added")')).toBeVisible(); await page.locator('div[role="alert"] button > svg.fa-xmark').click(); // dismiss info alert await expect(page.locator('div[role="alert"] button > svg.fa-xmark')).toBeHidden(); // ensure alert is gone diff --git a/test-playwright/testUtils.ts b/test-playwright/testUtils.ts index ce426d6..654f0c8 100644 --- a/test-playwright/testUtils.ts +++ b/test-playwright/testUtils.ts @@ -29,7 +29,7 @@ export async function importUser(page: Page, id?: string): Promise { // Check DID await expect(page.getByRole('code')).toContainText(did); // ... and ensure the app retrieves the registration status - await expect(page.getByText('Your claims counter resets')).toBeVisible(); + await expect(page.locator('#sectionUsageLimits').getByText('Checking')).toBeHidden(); return did; }