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.

1.1 KB
Raw Blame
import { test } from '@affine-test/kit/mobile';
import { getBlockSuiteEditorTitle } from '@affine-test/kit/utils/page-logic';
import { getCurrentDocIdFromUrl } from '@affine-test/kit/utils/url';
import { expect } from '@playwright/test';

import { expandCollapsibleSection, pageBack } from './utils';

test('Create new doc in favorites', async ({ page }) => {
  const section = await expandCollapsibleSection(page, 'favorites');
  const newButton = section.getByTestId(
    'navigation-panel-bar-add-favorite-button'
  );
  await newButton.tap();

  // const testTitleText = 'Test Favorited Doc';
  const title = getBlockSuiteEditorTitle(page);
  await expect(title).toBeVisible();
  // TODO(@CatsJuice): Mobile editor is not ready yet
  // await title.fill(testTitleText);
  const docId = getCurrentDocIdFromUrl(page);

  await pageBack(page);
  const section2 = await expandCollapsibleSection(page, 'favorites');
  const node = section2.getByTestId(`navigation-panel-doc-${docId}`);
  await expect(node).toBeVisible();

  // const label = node.getByText(testTitleText);
  // await expect(label).toBeVisible();
});