fix test
This commit is contained in:
parent
3990a2d726
commit
54e42a54c3
|
|
@ -41,7 +41,7 @@ export const CopyToClipboard: React.FunctionComponent<CopyToClipboardProps> = ({
|
|||
});
|
||||
}, [value]);
|
||||
const iconElement = icon === 'check' ? icons.check() : icon === 'cross' ? icons.cross() : copyIcon;
|
||||
return <button className='copy-icon' aria-label='Copy to clipboard' title={title} onClick={handleCopy}>{iconElement}</button>;
|
||||
return <button className='copy-icon' title={title ?? 'Copy to clipboard'} onClick={handleCopy}>{iconElement}</button>;
|
||||
};
|
||||
|
||||
type CopyToClipboardContainerProps = CopyToClipboardProps & {
|
||||
|
|
|
|||
|
|
@ -2742,7 +2742,7 @@ for (const useIntermediateMergeReport of [true, false] as const) {
|
|||
await page.context().grantPermissions(['clipboard-read', 'clipboard-write']);
|
||||
|
||||
await page.getByRole('link', { name: 'sample' }).click();
|
||||
await page.getByRole('button', { name: 'Copy AI Prompt' }).click();
|
||||
await page.getByRole('button', { name: 'Copy prompt to clipboard' }).click();
|
||||
const prompt = await page.evaluate(() => navigator.clipboard.readText());
|
||||
expect(prompt, 'contains error').toContain('expect(received).toBe(expected)');
|
||||
expect(prompt, 'contains diff').toContain(`+ test('sample', async ({}) => { expect(2).toBe(3); });`);
|
||||
|
|
|
|||
Loading…
Reference in a new issue