diff --git a/editor/src/components/canvas/canvas-strategies/strategies/grid-reparent-strategies.spec.browser2.tsx b/editor/src/components/canvas/canvas-strategies/strategies/grid-reparent-strategies.spec.browser2.tsx index 15cebb6d6195..368d72977fb0 100644 --- a/editor/src/components/canvas/canvas-strategies/strategies/grid-reparent-strategies.spec.browser2.tsx +++ b/editor/src/components/canvas/canvas-strategies/strategies/grid-reparent-strategies.spec.browser2.tsx @@ -4,7 +4,7 @@ import type { WindowPoint } from '../../../../core/shared/math-utils' import { offsetPoint, windowPoint } from '../../../../core/shared/math-utils' import type { Modifiers } from '../../../../utils/modifiers' import { cmdModifier } from '../../../../utils/modifiers' -import { selectComponentsForTest } from '../../../../utils/utils.test-utils' +import { selectComponentsForTest, wait } from '../../../../utils/utils.test-utils' import { GridCellTestId } from '../../controls/grid-controls-for-strategies' import { CanvasControlsContainerID } from '../../controls/new-canvas-controls' import type { Point } from '../../event-helpers.test-utils' @@ -665,65 +665,187 @@ describe('grid reparent strategies', () => { formatTestProjectCode( makeTestProjectCode({ extraCode: ` +
+
+
+
+
+
+ `, + }), + ), + ) + }) + it('into a grid container with reorder (no explicit gridRow/gridColumn props', async () => { + const editor = await renderTestEditorWithCode( + makeTestProjectCode({ + insideGrid: `
-
-
-
-
-
+ data-uid='dragme' + data-testid='dragme' + /> + `, + extraCode: ` +
+
+
+
+ `, + }), + 'await-first-dom-report', + ) + + await selectComponentsForTest(editor, [EP.fromString('sb/grid/dragme')]) + + await dragOutToAnotherGrid( + editor, + 'another-grid', + { + x: 300, + y: 20, + }, + EP.fromString('sb/grid/dragme'), + ) + + expect(getPrintedUiJsCode(editor.getEditorState())).toEqual( + formatTestProjectCode( + makeTestProjectCode({ + extraCode: ` +
+
+
+
+
`, }), ),