fix(core): transform workspace db when enable cloud (#7744)

This commit is contained in:
EYHN
2024-08-05 15:17:19 +00:00
parent a03831f2a2
commit cd4e462d8c
10 changed files with 110 additions and 20 deletions

View File

@@ -5,9 +5,12 @@ import {
enableCloudWorkspace,
loginUser,
} from '@affine-test/kit/utils/cloud';
import { clickPageModeButton } from '@affine-test/kit/utils/editor';
import {
clickNewPageButton,
getBlockSuiteEditorTitle,
waitForEditorLoad,
waitForEmptyEditor,
} from '@affine-test/kit/utils/page-logic';
import {
openSettingModal,
@@ -94,3 +97,31 @@ test('should have pagination in member list', async ({ page }) => {
await page.waitForTimeout(500);
expect(await page.locator('[data-testid="member-item"]').count()).toBe(3);
});
test('should transform local favorites data', async ({ page }) => {
await page.reload();
await waitForEditorLoad(page);
await createLocalWorkspace(
{
name: 'test',
},
page
);
await page.getByTestId('explorer-bar-add-favorite-button').first().click();
await clickPageModeButton(page);
await waitForEmptyEditor(page);
await getBlockSuiteEditorTitle(page).fill('this is a new fav page');
await expect(
page
.getByTestId('explorer-favorites')
.locator('[draggable] >> text=this is a new fav page')
).toBeVisible();
await enableCloudWorkspace(page);
await expect(
page
.getByTestId('explorer-favorites')
.locator('[draggable] >> text=this is a new fav page')
).toBeVisible();
});