refactor: image preview component issues in center peek (#7313)

fix AF-948

- remove jotai
- every editor got its own image block modal
- image block uses center peek modal for animation and style
This commit is contained in:
pengx17
2024-06-25 07:34:18 +00:00
parent 76f6d91cdd
commit f51da066a8
9 changed files with 440 additions and 459 deletions

View File

@@ -399,12 +399,9 @@ test('image able to copy to clipboard', async ({ page }) => {
const locator = page.getByTestId('image-preview-modal');
await expect(locator).toBeVisible();
await locator.getByTestId('copy-to-clipboard-button').click();
await new Promise<void>(resolve => {
page.on('console', message => {
expect(message.text()).toBe('Image copied to clipboard');
resolve();
});
});
await expect(
page.locator('[data-testid=affine-toast]:has-text("Copied to clipboard.")')
).toBeVisible();
});
test('image able to download', async ({ page }) => {