AFFiNE/tests/local-first-workspace.spec.ts
Himself65 94d535f72b
test: support test e2e with OctoBase (#1593)
Co-authored-by: DarkSky <darksky2048@gmail.com>
2023-03-17 03:51:00 -04:00

31 lines
1.1 KiB
TypeScript

import { expect } from '@playwright/test';
import { loadPage } from './libs/load-page';
import { test } from './libs/playwright';
import { clickSideBarCurrentWorkspaceBanner } from './libs/sidebar';
loadPage();
test.describe('Local first default workspace', () => {
test('preset workspace name', async ({ page }) => {
const workspaceName = page.getByTestId('workspace-name');
expect(await workspaceName.textContent()).toBe('Demo Workspace');
});
// test('default workspace avatar', async ({ page }) => {
// const workspaceAvatar = page.getByTestId('workspace-avatar');
// expect(
// await workspaceAvatar.locator('img').getAttribute('src')
// ).not.toBeNull();
// });
});
test.describe('Language switch', () => {
test('Open language switch menu', async ({ page }) => {
await clickSideBarCurrentWorkspaceBanner(page);
const languageMenuButton = page.getByTestId('language-menu-button');
await expect(languageMenuButton).toBeVisible();
const actual = await languageMenuButton.innerText();
expect(actual).toEqual('English');
});
});