Files
AFFiNE-Mirror/tests/affine-local/e2e/blocksuite/editor.spec.ts
pengx17 4b6c4ed546 feat(core): doc database properties (#8520)
fix AF-1454

1. move inline tags editor to components
2. add progress component
3. adjust doc properties styles for desktop
4. subscribe bs database links and display in doc info
5. move update/create dates to doc info
6. a trivial e2e test

<div class='graphite__hidden'>
          <div>🎥 Video uploaded on Graphite:</div>
            <a href="https://app.graphite.dev/media/video/T2klNLEk0wxLh4NRDzhk/eed266c1-fdac-4f0e-baa9-4aa00d14a2e8.mp4">
              <img src="https://app.graphite.dev/api/v1/graphite/video/thumbnail/T2klNLEk0wxLh4NRDzhk/eed266c1-fdac-4f0e-baa9-4aa00d14a2e8.mp4">
            </a>
          </div>
<video src="https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/T2klNLEk0wxLh4NRDzhk/eed266c1-fdac-4f0e-baa9-4aa00d14a2e8.mp4">10月23日.mp4</video>
2024-10-24 07:38:45 +00:00

67 lines
2.3 KiB
TypeScript

import { test } from '@affine-test/kit/playwright';
import { openHomePage } from '@affine-test/kit/utils/load-page';
import {
addDatabase,
clickNewPageButton,
getBlockSuiteEditorTitle,
waitForEditorLoad,
} from '@affine-test/kit/utils/page-logic';
import { expect } from '@playwright/test';
test('database is useable', async ({ page }) => {
test.slow();
await openHomePage(page);
await waitForEditorLoad(page);
await clickNewPageButton(page);
const title = getBlockSuiteEditorTitle(page);
await title.pressSequentially('test title');
await page.keyboard.press('Enter');
expect(await title.innerText()).toBe('test title');
await addDatabase(page);
const database = page.locator('affine-database');
await expect(database).toBeVisible();
await page.reload();
await waitForEditorLoad(page);
await clickNewPageButton(page);
const title2 = getBlockSuiteEditorTitle(page);
await title2.pressSequentially('test title2');
await page.waitForTimeout(500);
expect(await title2.innerText()).toBe('test title2');
await page.keyboard.press('Enter');
await addDatabase(page);
const database2 = page.locator('affine-database');
await expect(database2).toBeVisible();
});
test('link page is useable', async ({ page }) => {
await openHomePage(page);
await waitForEditorLoad(page);
await clickNewPageButton(page);
await waitForEditorLoad(page);
const title = getBlockSuiteEditorTitle(page);
await title.pressSequentially('page1');
await page.keyboard.press('Enter');
expect(await title.innerText()).toBe('page1');
await clickNewPageButton(page);
await waitForEditorLoad(page);
const title2 = getBlockSuiteEditorTitle(page);
await title2.pressSequentially('page2');
await page.keyboard.press('Enter');
expect(await title2.innerText()).toBe('page2');
await page.keyboard.press('@', { delay: 50 });
await page.keyboard.press('p');
await page.keyboard.press('a');
await page.keyboard.press('g');
await page.keyboard.press('e');
await page.keyboard.press('1');
await page.keyboard.press('Enter');
const link = page.locator('.affine-reference');
await expect(link).toBeVisible();
await page.click('.affine-reference');
await page.waitForTimeout(500);
await expect(
page.locator('.doc-title-container:has-text("page1")')
).toBeVisible();
});