mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-14 21:27:20 +00:00
chore: bump electron version (#7922)
This commit is contained in:
@@ -12,7 +12,7 @@ import fs from 'fs-extra';
|
||||
|
||||
declare global {
|
||||
interface Window {
|
||||
apis: typeof apis;
|
||||
__apis: typeof apis;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ test('export then add', async ({ page, appInfo, workspace }) => {
|
||||
|
||||
// export db file to tmp folder
|
||||
await page.evaluate(tmpPath => {
|
||||
return window.apis?.dialog.setFakeDialogResult({
|
||||
return window.__apis?.dialog.setFakeDialogResult({
|
||||
filePath: tmpPath,
|
||||
});
|
||||
}, tmpPath);
|
||||
@@ -73,7 +73,7 @@ test('export then add', async ({ page, appInfo, workspace }) => {
|
||||
await clickSideBarCurrentWorkspaceBanner(page);
|
||||
|
||||
await page.evaluate(tmpPath => {
|
||||
return window.apis?.dialog.setFakeDialogResult({
|
||||
return window.__apis?.dialog.setFakeDialogResult({
|
||||
filePath: tmpPath,
|
||||
});
|
||||
}, tmpPath);
|
||||
|
||||
@@ -20,13 +20,13 @@ type RoutePath = 'setting';
|
||||
|
||||
const getPageId = async (page: Page) => {
|
||||
return page.evaluate(() => {
|
||||
return (window.appInfo as any)?.viewId as string;
|
||||
return (window.__appInfo as any)?.viewId as string;
|
||||
});
|
||||
};
|
||||
|
||||
const isActivePage = async (page: Page) => {
|
||||
return page.evaluate(async () => {
|
||||
return await (window as any).apis?.ui.isActiveTab();
|
||||
return await (window as any).__apis?.ui.isActiveTab();
|
||||
});
|
||||
};
|
||||
|
||||
@@ -67,9 +67,14 @@ export const test = base.extend<{
|
||||
},
|
||||
page: async ({ electronApp }, use) => {
|
||||
await expect
|
||||
.poll(() => {
|
||||
return electronApp.windows().length > 1;
|
||||
})
|
||||
.poll(
|
||||
() => {
|
||||
return electronApp.windows().length > 1;
|
||||
},
|
||||
{
|
||||
timeout: 10000,
|
||||
}
|
||||
)
|
||||
.toBeTruthy();
|
||||
|
||||
const page = await getActivePage(electronApp.windows());
|
||||
|
||||
Reference in New Issue
Block a user