chore(editor): fix imports in legacy tests (#10300)

This commit is contained in:
Saul-Mirone
2025-02-20 03:30:05 +00:00
parent e0b2b2b33c
commit c3fc0a0d88
119 changed files with 96 additions and 90 deletions
@@ -0,0 +1,43 @@
import { expect } from '@playwright/test';
import {
switchMultipleEditorsMode,
toggleMultipleEditors,
} from '../utils/actions/edgeless.js';
import {
enterPlaygroundRoom,
initEmptyEdgelessState,
initThreeParagraphs,
waitNextFrame,
} from '../utils/actions/misc.js';
import { test } from '../utils/playwright.js';
test('the shift pressing status should effect all editors', async ({
page,
}) => {
await enterPlaygroundRoom(page);
await initEmptyEdgelessState(page);
await initThreeParagraphs(page);
await toggleMultipleEditors(page);
await switchMultipleEditorsMode(page);
await waitNextFrame(page, 5000);
const getShiftPressedStatus = async () => {
return page.evaluate(() => {
const edgelessBlocks = document.querySelectorAll('affine-edgeless-root');
return Array.from(edgelessBlocks).map(edgelessRoot => {
return edgelessRoot.gfx.keyboard.shiftKey$.peek();
});
});
};
await page.keyboard.down('Shift');
const pressed = await getShiftPressedStatus();
expect(pressed).toEqual([true, true]);
await page.keyboard.up('Shift');
const released = await getShiftPressedStatus();
expect(released).toEqual([false, false]);
});