Skip to content

There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.

512 B
Raw Blame
import type { Page } from '@playwright/test';

import { waitNextFrame } from './misc.js';

export async function updateBlockType(
  page: Page,
  flavour: string,
  type?: string
) {
  await page.evaluate(
    ([flavour, type]) => {
      window.host.std.command.exec(
        window.$blocksuite.blocks.note.updateBlockType,
        {
          flavour,
          props: {
            type,
          },
        }
      );
    },
    [flavour, type] as [string, string?]
  );
  await waitNextFrame(page, 400);
}