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';
|
2022-12-30 16:40:15 +03:00
|
|
|
|
|
|
|
loadPage();
|
|
|
|
|
2022-12-30 20:59:07 +03:00
|
|
|
test.describe('Local first default workspace', () => {
|
2023-02-06 16:58:41 +03:00
|
|
|
test('preset workspace name', async ({ page }) => {
|
2022-12-30 16:40:15 +03:00
|
|
|
const workspaceName = page.getByTestId('workspace-name');
|
2023-02-06 16:58:41 +03:00
|
|
|
expect(await workspaceName.textContent()).toBe('AFFiNE Test');
|
2022-12-30 16:40:15 +03:00
|
|
|
});
|
|
|
|
|
2023-02-06 16:58:41 +03:00
|
|
|
test('default workspace avatar', async ({ page }) => {
|
2022-12-30 16:40:15 +03:00
|
|
|
const workspaceAvatar = page.getByTestId('workspace-avatar');
|
2023-02-06 16:58:41 +03:00
|
|
|
expect(
|
|
|
|
await workspaceAvatar.locator('img').getAttribute('src')
|
|
|
|
).not.toBeNull();
|
2022-12-30 16:40:15 +03:00
|
|
|
});
|
|
|
|
});
|
2023-02-07 10:21:34 +03:00
|
|
|
test.describe('Language switch', () => {
|
|
|
|
test('Open language switch menu', async ({ page }) => {
|
|
|
|
await page.getByTestId('current-workspace').click();
|
|
|
|
const languageMenuButton = page.getByTestId('language-menu-button');
|
|
|
|
await expect(languageMenuButton).toBeVisible();
|
|
|
|
const actual = await languageMenuButton.innerText();
|
|
|
|
expect(actual).toEqual('English');
|
|
|
|
});
|
|
|
|
});
|