Fix: Copy to Clipboard button targeting

This commit is contained in:
Jose Olarte III
2025-07-17 15:21:46 +08:00
parent 447b4e26ef
commit 5c5af5b5cb

View File

@@ -156,12 +156,11 @@ test('Check setting name & sharing info', async ({ page }) => {
await page.locator('button:has-text("Save")').click(); await page.locator('button:has-text("Save")').click();
await expect(page.getByText('share some other way')).toBeVisible(); await expect(page.getByText('share some other way')).toBeVisible();
await page.getByRole('button', { name: /share some other way/ }).click(); await page.getByRole('button', { name: /share some other way/ }).click();
await expect(page.getByRole('button', { name: 'copy to clipboard' })).toBeVisible(); await expect(page.getByRole('button', { name: 'Copy contact information to' })).toBeVisible();
await page.getByRole('button', { name: 'copy to clipboard' }).click(); await page.getByRole('button', { name: 'Copy contact information to' }).click();
await expect(page.getByText('contact info was copied')).toBeVisible(); await expect(page.getByText('contact info was copied')).toBeVisible();
// dismiss alert and wait for it to go away // wait for alert to go away
await page.locator('div[role="alert"] button > svg.fa-xmark').click(); await expect(page.getByText('contact info was copied')).toBeHidden({ timeout: 10000 });
await expect(page.getByText('contact info was copied')).toBeHidden();
// check that they're on the Contacts screen // check that they're on the Contacts screen
await expect(page.getByText('your contacts')).toBeVisible(); await expect(page.getByText('your contacts')).toBeVisible();
}); });