2023-02-05 13:41:18 +03:00
|
|
|
import { expect } from '@playwright/test';
|
2023-02-17 10:33:32 +03:00
|
|
|
|
2023-03-24 01:15:40 +03:00
|
|
|
import { openHomePage } from '../libs/load-page';
|
2023-03-28 08:25:16 +03:00
|
|
|
import { waitMarkdownImported } from '../libs/page-logic';
|
2023-03-24 01:15:40 +03:00
|
|
|
import { test } from '../libs/playwright';
|
|
|
|
import { clickSideBarCurrentWorkspaceBanner } from '../libs/sidebar';
|
|
|
|
import { assertCurrentWorkspaceFlavour } from '../libs/workspace';
|
2022-12-30 16:40:15 +03:00
|
|
|
|
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 }) => {
|
2023-03-24 01:15:40 +03:00
|
|
|
await openHomePage(page);
|
2023-03-28 08:25:16 +03:00
|
|
|
await waitMarkdownImported(page);
|
2022-12-30 16:40:15 +03:00
|
|
|
const workspaceName = page.getByTestId('workspace-name');
|
2023-03-24 06:46:17 +03:00
|
|
|
await page.waitForTimeout(1000);
|
2023-03-08 10:44:50 +03:00
|
|
|
expect(await workspaceName.textContent()).toBe('Demo Workspace');
|
2023-03-23 07:22:29 +03:00
|
|
|
await assertCurrentWorkspaceFlavour('local', page);
|
2022-12-30 16:40:15 +03:00
|
|
|
});
|
|
|
|
|
2023-03-01 10:40:01 +03:00
|
|
|
// test('default workspace avatar', async ({ page }) => {
|
|
|
|
// const workspaceAvatar = page.getByTestId('workspace-avatar');
|
|
|
|
// 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 }) => {
|
2023-03-24 01:15:40 +03:00
|
|
|
await openHomePage(page);
|
2023-03-28 08:25:16 +03:00
|
|
|
await waitMarkdownImported(page);
|
2023-03-17 10:51:00 +03:00
|
|
|
await clickSideBarCurrentWorkspaceBanner(page);
|
2023-02-07 10:21:34 +03:00
|
|
|
const languageMenuButton = page.getByTestId('language-menu-button');
|
|
|
|
await expect(languageMenuButton).toBeVisible();
|
|
|
|
const actual = await languageMenuButton.innerText();
|
|
|
|
expect(actual).toEqual('English');
|
2023-03-23 07:22:29 +03:00
|
|
|
await assertCurrentWorkspaceFlavour('local', page);
|
2023-02-07 10:21:34 +03:00
|
|
|
});
|
|
|
|
});
|