mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 12:28:42 +00:00
Closes: [BS-2216](https://linear.app/affine-design/issue/BS-2216/remove-global-types-in-command)
23 lines
497 B
TypeScript
23 lines
497 B
TypeScript
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.exec(window.$blocksuite.blocks.updateBlockType, {
|
|
flavour,
|
|
props: {
|
|
type,
|
|
},
|
|
});
|
|
},
|
|
[flavour, type] as [BlockSuite.Flavour, string?]
|
|
);
|
|
await waitNextFrame(page, 400);
|
|
}
|