fix tests

This commit is contained in:
Max Schmitt 2024-09-17 15:45:47 +02:00
parent 406e4a3cf8
commit 86becf6178

View file

@ -81,9 +81,9 @@ test('should render copy buttons for annotations', async ({ mount, page, context
const component = await mount(<TestCaseView projectNames={['chromium', 'webkit']} test={testCase} run={0} anchor=''></TestCaseView>); const component = await mount(<TestCaseView projectNames={['chromium', 'webkit']} test={testCase} run={0} anchor=''></TestCaseView>);
await expect(component.getByText('Annotation text', { exact: false }).first()).toBeVisible(); await expect(component.getByText('Annotation text', { exact: false }).first()).toBeVisible();
component.getByText('Annotation text', { exact: false }).first().hover(); await component.getByText('Annotation text', { exact: false }).first().hover();
await expect(component.getByLabel('Copy to clipboard').first()).toBeVisible(); await expect(component.locator('.test-case-annotation').getByLabel('Copy to clipboard').first()).toBeVisible();
await component.getByLabel('Copy to clipboard').first().click(); await component.locator('.test-case-annotation').getByLabel('Copy to clipboard').first().click();
const handle = await page.evaluateHandle(() => navigator.clipboard.readText()); const handle = await page.evaluateHandle(() => navigator.clipboard.readText());
const clipboardContent = await handle.jsonValue(); const clipboardContent = await handle.jsonValue();
expect(clipboardContent).toBe('Annotation text'); expect(clipboardContent).toBe('Annotation text');