mirror of
https://github.com/toeverything/AFFiNE.git
synced 2024-11-29 04:33:53 +03:00
24 lines
722 B
TypeScript
24 lines
722 B
TypeScript
import { resolve } from 'node:path';
|
|
|
|
import { test } from '@affine-test/kit/playwright';
|
|
import { expect } from '@playwright/test';
|
|
import { _electron as electron } from 'playwright';
|
|
|
|
test('new page', async () => {
|
|
const electronApp = await electron.launch({
|
|
args: [resolve(__dirname, '..')],
|
|
executablePath: resolve(__dirname, '../node_modules/.bin/electron'),
|
|
});
|
|
const page = await electronApp.firstWindow();
|
|
await page.getByTestId('new-page-button').click({
|
|
delay: 100,
|
|
});
|
|
await page.waitForSelector('v-line');
|
|
const flavour = await page.evaluate(
|
|
// @ts-expect-error
|
|
() => globalThis.currentWorkspace.flavour
|
|
);
|
|
expect(flavour).toBe('local');
|
|
await electronApp.close();
|
|
});
|