AFFiNE/tests/console.spec.ts

29 lines
1.1 KiB
TypeScript
Raw Normal View History

2023-02-05 13:41:18 +03:00
import { expect } from '@playwright/test';
import { test } from './libs/playwright.js';
2023-01-09 07:20:53 +03:00
import { loadPage } from './libs/load-page.js';
loadPage();
test.describe('web console', () => {
2023-01-09 07:20:53 +03:00
// TODO: playwright need to support json import in esm
test.skip('editor version', async ({ page }) => {
// TODO: playwright need to support json import in esm
// const pkg = await import('./../packages/app/package.json', {
// assert: { type: 'json' },
// });
const pkg = {} as any;
// https://playwright.dev/docs/evaluating
// https://github.com/microsoft/playwright/issues/13059
// Get the handle to a specific function.
//Later on, call this function with some arguments.
// const msg = await getEditoVersionHandle.evaluate((post, args) => post);
// console.log(getEditoVersionHandle);
2023-01-04 11:13:40 +03:00
const editoVersion = await page.evaluate(() => window.__editoVersion);
2023-01-01 20:11:19 +03:00
// const documentEditorVersion = await page.inputValue('input#editor-version');
const pkgEditorVersion = pkg.dependencies['@blocksuite/editor'];
2023-01-01 20:11:19 +03:00
expect(editoVersion).toBe(pkgEditorVersion);
});
});