From d3af29ac9e6219f44bf68687db103d5fa674cb97 Mon Sep 17 00:00:00 2001 From: sidmohanty11 Date: Mon, 4 Nov 2024 15:13:18 +0530 Subject: [PATCH 1/2] add --- .../sdks-tests/src/e2e-tests/editing.spec.ts | 16 +++++++++------- packages/sdks-tests/src/specs/index.ts | 1 + 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/packages/sdks-tests/src/e2e-tests/editing.spec.ts b/packages/sdks-tests/src/e2e-tests/editing.spec.ts index 2e727824d90..319733919d0 100644 --- a/packages/sdks-tests/src/e2e-tests/editing.spec.ts +++ b/packages/sdks-tests/src/e2e-tests/editing.spec.ts @@ -1,9 +1,5 @@ import { expect } from '@playwright/test'; -import { - COLUMNS_WITH_NEW_SPACE, - COLUMNS_WITH_NEW_TEXT, - COLUMNS_WITH_NEW_WIDTHS, -} from '../specs/columns.js'; +import { COLUMNS, COLUMNS_WITH_NEW_SPACE, COLUMNS_WITH_NEW_WIDTHS } from '../specs/columns.js'; import { NEW_TEXT } from '../specs/helpers.js'; import { HOMEPAGE } from '../specs/homepage.js'; import { checkIsRN, test } from '../helpers/index.js'; @@ -171,12 +167,18 @@ test.describe('Visual Editing', () => { test.skip( packageName === 'nextjs-sdk-next-app' || packageName === 'gen1-next' || - packageName === 'gen1-react' || packageName === 'gen1-remix' ); await launchEmbedderAndWaitForSdk({ path: '/columns', basePort, page, sdk }); - await sendContentUpdateMessage({ page, newContent: COLUMNS_WITH_NEW_TEXT, model: 'page' }); + await sendPatchOrUpdateMessage({ + page, + content: cloneContent(COLUMNS), + model: 'page', + sdk, + path: '/data/blocks/2/children/1/component/options/columns/0/blocks/1/component/options/text', + updateFn: () => NEW_TEXT, + }); await page.frameLocator('iframe').getByText(NEW_TEXT).waitFor(); }); test('correctly updates space prop', async ({ page, basePort, packageName, sdk }) => { diff --git a/packages/sdks-tests/src/specs/index.ts b/packages/sdks-tests/src/specs/index.ts index 115b9b99983..f3a2a4fd750 100644 --- a/packages/sdks-tests/src/specs/index.ts +++ b/packages/sdks-tests/src/specs/index.ts @@ -198,6 +198,7 @@ export const VISUAL_EDITING_PATHNAMES = [ '/no-trusted-hosts', '/editing-styles-no-trusted-hosts', '/editing', + '/columns', ] satisfies Path[]; export const getProps = async (args: { From 6010bcfdb0eb98bf1c26f65133a2b983216371f3 Mon Sep 17 00:00:00 2001 From: sidmohanty11 Date: Mon, 4 Nov 2024 15:33:01 +0530 Subject: [PATCH 2/2] editing --- packages/sdks-tests/src/e2e-tests/editing.spec.ts | 6 +++--- packages/sdks-tests/src/specs/index.ts | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/sdks-tests/src/e2e-tests/editing.spec.ts b/packages/sdks-tests/src/e2e-tests/editing.spec.ts index 319733919d0..982aa8b5d33 100644 --- a/packages/sdks-tests/src/e2e-tests/editing.spec.ts +++ b/packages/sdks-tests/src/e2e-tests/editing.spec.ts @@ -170,7 +170,7 @@ test.describe('Visual Editing', () => { packageName === 'gen1-remix' ); - await launchEmbedderAndWaitForSdk({ path: '/columns', basePort, page, sdk }); + await launchEmbedderAndWaitForSdk({ path: '/columns-editing', basePort, page, sdk }); await sendPatchOrUpdateMessage({ page, content: cloneContent(COLUMNS), @@ -192,7 +192,7 @@ test.describe('Visual Editing', () => { const selector = checkIsRN(sdk) ? '[data-builder-block-name=builder-column]' : '.builder-column'; - await launchEmbedderAndWaitForSdk({ path: '/columns', basePort, page, sdk }); + await launchEmbedderAndWaitForSdk({ path: '/columns-editing', basePort, page, sdk }); const secondColumn = page.frameLocator('iframe').locator(selector).nth(1); await expect(secondColumn).toHaveCSS('margin-left', checkIsRN(sdk) ? '0px' : '20px'); @@ -208,7 +208,7 @@ test.describe('Visual Editing', () => { packageName === 'gen1-remix' ); - await launchEmbedderAndWaitForSdk({ path: '/columns', basePort, page, sdk }); + await launchEmbedderAndWaitForSdk({ path: '/columns-editing', basePort, page, sdk }); const secondColumn = page.frameLocator('iframe').locator('.builder-column').nth(1); const initialWidth = await secondColumn.evaluate(el => diff --git a/packages/sdks-tests/src/specs/index.ts b/packages/sdks-tests/src/specs/index.ts index f3a2a4fd750..7073bf1f820 100644 --- a/packages/sdks-tests/src/specs/index.ts +++ b/packages/sdks-tests/src/specs/index.ts @@ -83,6 +83,7 @@ export const PAGES = { '/can-track-false': HOMEPAGE, '/css-nesting': cssNesting, '/columns': COLUMNS, + '/columns-editing': COLUMNS, '/symbols': symbols, '/js-code': JS_CODE_CONTENT, '/symbols-without-content': CONTENT_WITHOUT_SYMBOLS, @@ -198,7 +199,7 @@ export const VISUAL_EDITING_PATHNAMES = [ '/no-trusted-hosts', '/editing-styles-no-trusted-hosts', '/editing', - '/columns', + '/columns-editing', ] satisfies Path[]; export const getProps = async (args: {