refactor(electron): fix vitest and add behavior test (#4655)

This commit is contained in:
Alex Yang
2023-10-18 22:14:30 -05:00
committed by GitHub
parent b14a6bc29e
commit 97d8660a54
35 changed files with 256 additions and 349 deletions

View File

@@ -1,5 +1,3 @@
// import { platform } from 'node:os';
import { test } from '@affine-test/kit/electron';
import { withCtrlOrMeta } from '@affine-test/kit/utils/keyboard';
import { getBlockSuiteEditorTitle } from '@affine-test/kit/utils/page-logic';

View File

@@ -0,0 +1,38 @@
import os from 'node:os';
import { test } from '@affine-test/kit/electron';
import { shouldCallIpcRendererHandler } from '@affine-test/kit/utils/ipc';
test.describe('behavior test', () => {
if (os.platform() === 'darwin') {
test('system button should hidden correctly', async ({
page,
electronApp,
}) => {
{
const promise = shouldCallIpcRendererHandler(
electronApp,
'ui:handleSidebarVisibilityChange'
);
await page
.locator(
'[data-testid=app-sidebar-arrow-button-collapse][data-show=true]'
)
.click();
await promise;
}
{
const promise = shouldCallIpcRendererHandler(
electronApp,
'ui:handleSidebarVisibilityChange'
);
await page
.locator(
'[data-testid=app-sidebar-arrow-button-expand][data-show=true]'
)
.click();
await promise;
}
});
}
});