feat(core): remove workspace selectors in settings (#9705)

fix AF-2119
This commit is contained in:
pengx17
2025-01-15 07:37:24 +00:00
parent c31a0d28cf
commit 0bce5c6730
33 changed files with 223 additions and 349 deletions

View File

@@ -24,7 +24,7 @@ test('should create a page with a local first avatar and remove it', async ({
.nth(1)
.click({ position: { x: 10, y: 10 } });
await page.getByTestId('settings-modal-trigger').click();
await page.getByTestId('current-workspace-label').click();
await page.getByTestId('workspace-list-item-workspace:preference').click();
await page
.getByTestId('upload-avatar')
.setInputFiles(ProjectRoot.join('tests', 'fixtures', 'blue.png').value);
@@ -61,7 +61,7 @@ test('should create a page with a local first avatar and remove it', async ({
// Click remove button to remove workspace avatar
await page.getByTestId('settings-modal-trigger').click();
await page.getByTestId('current-workspace-label').click();
await page.getByTestId('workspace-list-item-workspace:preference').click();
await page.getByTestId('workspace-setting-avatar').hover();
await page.getByTestId('workspace-setting-remove-avatar-button').click();
await page.mouse.click(0, 0);

View File

@@ -26,7 +26,7 @@ test('Create new workspace, then delete it', async ({ page, workspace }) => {
'Test Workspace'
);
await openSettingModal(page);
await openWorkspaceSettingPanel(page, 'Test Workspace');
await openWorkspaceSettingPanel(page);
await page.getByTestId('delete-workspace-button').click();
await expect(
page.locator('.affine-notification-center').first()
@@ -64,7 +64,7 @@ test('Delete last workspace', async ({ page }) => {
node => node.textContent
);
await openSettingModal(page);
await openWorkspaceSettingPanel(page, currentWorkspaceName as string);
await openWorkspaceSettingPanel(page);
await page.getByTestId('delete-workspace-button').click();
await page
.getByTestId('delete-workspace-input')

View File

@@ -10,7 +10,6 @@ import {
openSettingModal,
openShortcutsPanel,
} from '@affine-test/kit/utils/setting';
import { createLocalWorkspace } from '@affine-test/kit/utils/workspace';
import { expect } from '@playwright/test';
test('Open settings modal', async ({ page }) => {
@@ -104,21 +103,3 @@ test('Open experimental features panel', async ({ page }) => {
const settings = page.getByTestId('experimental-settings');
await expect(settings).toBeVisible();
});
test('Different workspace should have different name in the setting panel', async ({
page,
}) => {
await openHomePage(page);
await waitForEditorLoad(page);
await createLocalWorkspace({ name: 'New Workspace 2' }, page);
await createLocalWorkspace({ name: 'New Workspace 3' }, page);
await openSettingModal(page);
await page.getByTestId('current-workspace-label').click();
await expect(page.getByTestId('workspace-name-input')).toHaveValue(
'New Workspace 3'
);
await page.getByText('New Workspace 2').click();
await expect(page.getByTestId('workspace-name-input')).toHaveValue(
'New Workspace 2'
);
});