mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-02 01:49:51 +08:00
chore: migrate blocksuite test (#9222)
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
import type { Page } from '@playwright/test';
|
||||
|
||||
import { waitNextFrame } from './misc.js';
|
||||
|
||||
export async function updateBlockType(
|
||||
page: Page,
|
||||
flavour: BlockSuite.Flavour,
|
||||
type?: string
|
||||
) {
|
||||
await page.evaluate(
|
||||
([flavour, type]) => {
|
||||
window.host.std.command
|
||||
.chain()
|
||||
.updateBlockType({
|
||||
flavour,
|
||||
props: {
|
||||
type,
|
||||
},
|
||||
})
|
||||
.run();
|
||||
},
|
||||
[flavour, type] as [BlockSuite.Flavour, string?]
|
||||
);
|
||||
await waitNextFrame(page, 400);
|
||||
}
|
||||
Reference in New Issue
Block a user