fix: workspace name should change in the setting panel (#3039)

This commit is contained in:
Alex Yang
2023-07-06 10:19:06 +08:00
committed by GitHub
parent 87ba71e77e
commit e95d28e136
3 changed files with 38 additions and 2 deletions

View File

@@ -9,6 +9,7 @@ import {
openSettingModal,
openShortcutsPanel,
} from '../libs/setting';
import { createWorkspace } from '../libs/workspace';
test('Open settings modal', async ({ page }) => {
await openHomePage(page);
@@ -69,3 +70,21 @@ test('Open about panel', async ({ page }) => {
const title = await page.getByTestId('about-title');
await expect(title).toBeVisible();
});
test('Different workspace should have different name in the setting panel', async ({
page,
}) => {
await openHomePage(page);
await waitEditorLoad(page);
await createWorkspace({ name: 'New Workspace 2' }, page);
await createWorkspace({ name: 'New Workspace 3' }, page);
await openSettingModal(page);
await page.getByTestId('current-workspace-label').click();
expect(await page.getByTestId('workspace-name-input').inputValue()).toBe(
'New Workspace 3'
);
await page.getByText('New Workspace 2').click();
expect(await page.getByTestId('workspace-name-input').inputValue()).toBe(
'New Workspace 2'
);
});