refactor(electron): fix vitest and add behavior test (#4655)
This commit is contained in:
1 parent
b14a6bc29e
commit
97d8660a54
35 files changed
+256
-349
No files matched your search
@@ -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';
|
||||
|
||||
@@ -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