mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 04:48:53 +00:00
fix(editor): improve pdf embed viewer UX (#11641)
Closes: [BS-3101](https://linear.app/affine-design/issue/BS-3101/pdf-embed-模式的选中框选-和点开看详情有比较大的问题) ### What's Changed! * Fixed disable pointer event in native pdf viewer by dragging * Disable opening peek view with pdf viewer in readonly and sharing modes
This commit is contained in:
21
tests/kit/src/utils/attachment.ts
Normal file
21
tests/kit/src/utils/attachment.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import type { Page } from '@playwright/test';
|
||||
|
||||
import { Path } from '../playwright';
|
||||
|
||||
const fixturesDir = Path.dir(import.meta.url).join('../../../fixtures');
|
||||
|
||||
export async function importAttachment(page: Page, file: string) {
|
||||
await page.evaluate(() => {
|
||||
// Force fallback to input[type=file] in tests
|
||||
// See https://github.com/microsoft/playwright/issues/8850
|
||||
window.showOpenFilePicker = undefined;
|
||||
});
|
||||
|
||||
const fileChooser = page.waitForEvent('filechooser');
|
||||
|
||||
// open slash menu
|
||||
await page.keyboard.type('/attachment', { delay: 50 });
|
||||
await page.keyboard.press('Enter');
|
||||
|
||||
await (await fileChooser).setFiles(fixturesDir.join(file).value);
|
||||
}
|
||||
Reference in New Issue
Block a user