refactor(electron): fix vitest and add behavior test (#4655)
This commit is contained in:
@@ -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';
|
||||
|
||||
38
tests/affine-desktop/e2e/behavior.spec.ts
Normal file
38
tests/affine-desktop/e2e/behavior.spec.ts
Normal 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;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user