chore: standardize tsconfig (#9568)

This commit is contained in:
forehalo
2025-01-08 04:07:56 +00:00
parent 39f4b17315
commit c0ed74dfed
151 changed files with 1041 additions and 1566 deletions
+24
View File
@@ -0,0 +1,24 @@
import { Path } from '@affine-tools/utils/path';
import type { Page } from '@playwright/test';
export async function importImage(page: Page, pathInFixtures: string) {
await page.evaluate(() => {
// Force fallback to input[type=file] in tests
// See https://github.com/microsoft/playwright/issues/8850
// @ts-expect-error allow
window.showOpenFilePicker = undefined;
});
const fileChooser = page.waitForEvent('filechooser');
// open slash menu
await page.keyboard.type('/image', { delay: 50 });
await page.keyboard.press('Enter');
await (
await fileChooser
).setFiles(
Path.dir(import.meta.url).join('../../../fixtures', pathInFixtures).value
);
// TODO(@catsjuice): wait for image to be loaded more reliably
await page.waitForTimeout(1000);
}