diff --git a/libs/data-mapper-v3/e2e/copilot.spec.ts b/libs/data-mapper-v3/e2e/copilot.spec.ts index cf66cd178c0..d695d9807e2 100644 --- a/libs/data-mapper-v3/e2e/copilot.spec.ts +++ b/libs/data-mapper-v3/e2e/copilot.spec.ts @@ -219,7 +219,6 @@ test.describe('assistant controls', () => { await expect(ui.statusBar).toContainText('Functoids: 1'); expect(host.messages('update')).toEqual([]); - test.fail(true, 'Applied assistant maps leave the added functoid unrendered despite updating links and connection state.'); await expect .poll( async () => ({ diff --git a/libs/data-mapper-v3/e2e/pointerInteractions.spec.ts b/libs/data-mapper-v3/e2e/pointerInteractions.spec.ts index d42e056b735..6349d132b96 100644 --- a/libs/data-mapper-v3/e2e/pointerInteractions.spec.ts +++ b/libs/data-mapper-v3/e2e/pointerInteractions.spec.ts @@ -181,12 +181,26 @@ test.describe('real pointer interactions', () => { await expect(ui.links).toHaveCount(3); const saved = host.lastUpdatedMap()!; expect(host.messages('update')).toHaveLength(3); - expect(saved.pages[0].functoids).toEqual(map.pages[0].functoids); expect(saved.pages[0].links).toEqual([ expect.objectContaining({ sourceId: paths.source.customerName, sourceType: 'schemaNode', targetId: 'f1', targetType: 'functoid' }), expect.objectContaining({ sourceId: 'f1', sourceType: 'functoid', targetId: 'f2', targetType: 'functoid' }), expect.objectContaining({ sourceId: 'f2', sourceType: 'functoid', targetId: paths.target.billToName, targetType: 'schemaNode' }), ]); + const [toF1, f1ToF2, f2ToTarget] = saved.pages[0].links.map((link) => link.id); + expect(saved.pages[0].functoids).toEqual([ + expect.objectContaining({ + ...map.pages[0].functoids[0], + inputLinks: [toF1], + outputLinks: [f1ToF2], + parameters: [expect.objectContaining({ index: 0, type: 'link', value: toF1 })], + }), + expect.objectContaining({ + ...map.pages[0].functoids[1], + inputLinks: [f1ToF2], + outputLinks: [f2ToTarget], + parameters: [expect.objectContaining({ index: 0, type: 'link', value: f1ToF2 })], + }), + ]); expect(new Set(saved.pages[0].links.map((link) => link.id)).size).toBe(3); for (const connector of [ui.functoidInput(0), ui.functoidOutput(0), ui.functoidInput(1), ui.functoidOutput(1)]) { await expect(connector).toHaveClass(/connected/); @@ -270,7 +284,7 @@ test.describe('real pointer interactions', () => { expect(host.messages('update')).toHaveLength(0); }); - test('dragging blank canvas pans the viewport without changing functoid coordinates or links', async ({ mapper }) => { + test('Space-dragging blank canvas pans the viewport without changing functoid coordinates or links', async ({ mapper }) => { const map = linkedMap(); map.pages[0].functoids.push(createMapFunctoid('offscreen', { x: 1600, y: 1200 })); await mapper.open({ map }); @@ -281,12 +295,16 @@ test.describe('real pointer interactions', () => { const start = { x: box!.x + box!.width * 0.7, y: box!.y + box!.height * 0.7 }; const transform = await ui.functoidNode().getAttribute('transform'); await ui.page.mouse.move(start.x, start.y); + // Plain left-drag is reserved for area selection; Space+drag pans. + await ui.page.locator('svg.mapping-svg').focus(); + await ui.page.keyboard.down('Space'); await ui.page.mouse.down(); await ui.page.mouse.move(start.x - 90, start.y - 60, { steps: 10 }); await expect(viewport).toHaveClass(/panning/); await expect.poll(() => viewport.evaluate((element) => element.scrollLeft)).toBeGreaterThan(0); await expect.poll(() => viewport.evaluate((element) => element.scrollTop)).toBeGreaterThan(0); await ui.page.mouse.up(); + await ui.page.keyboard.up('Space'); await expect(viewport).not.toHaveClass(/panning/); await expect(ui.functoidNode()).toHaveAttribute('transform', transform!); @@ -333,7 +351,6 @@ test.describe('real pointer interactions', () => { await ui.instanceEditor.press('Delete'); - test.fail(true, 'Global Delete handler ignores text editing focus and deletes the selected functoid and incident links.'); await expect(ui.functoidNodes).toHaveCount(1, { timeout: 1_000 }); await expect(ui.links).toHaveCount(2); await expect(ui.instanceEditor).toHaveValue('bc'); diff --git a/libs/data-mapper-v3/e2e/schemaLoading.spec.ts b/libs/data-mapper-v3/e2e/schemaLoading.spec.ts index db5785eee57..bbc8072a9d6 100644 --- a/libs/data-mapper-v3/e2e/schemaLoading.spec.ts +++ b/libs/data-mapper-v3/e2e/schemaLoading.spec.ts @@ -121,7 +121,14 @@ test.describe('XSD structures and schema interactions @p0', () => { expect(labelOffset).toBeLessThan(80); await mapper.ui.treeNode(side, '/Record').locator('.tree-icon.expandable').click(); await expect.poll(() => tree.evaluate((element) => element.scrollWidth - element.clientWidth)).toBeLessThanOrEqual(1); - await tree.getByRole('button', { name: 'Expand all schema nodes', exact: true }).click(); + const expandAll = tree.getByRole('button', { name: 'Expand all schema nodes', exact: true }); + if (await expandAll.isVisible()) { + await expandAll.click(); + } else { + // Narrow panes move tree tools into the compact overflow menu. + await tree.getByRole('button', { name: 'Schema node tools', exact: true }).click(); + await mapper.ui.page.getByRole('menuitem', { name: 'Expand all schema nodes', exact: true }).click(); + } await expect(mapper.ui.treeNode(side, `/Record/Details/${name}`)).toHaveCount(1); await mapper.ui.treeNode(side, `/Record/Details/${name}`).scrollIntoViewIfNeeded(); await expect.poll(() => tree.evaluate((element) => element.scrollWidth > element.clientWidth)).toBe(true); diff --git a/libs/data-mapper-v3/test/webview-smoke/harness.js b/libs/data-mapper-v3/test/webview-smoke/harness.js index ac4d49a2761..b54f784d3ac 100644 --- a/libs/data-mapper-v3/test/webview-smoke/harness.js +++ b/libs/data-mapper-v3/test/webview-smoke/harness.js @@ -11,15 +11,18 @@ const schema = { filePath: 'schema.xsd', rootElement: { name: 'Root', + type: 'element', path: '/Root', children: [ { name: 'Value', + type: 'element', path: '/Root/Value', dataType: 'xs:string', children: [ { name: 'Inner', + type: 'element', path: '/Root/Value/Inner', dataType: 'xs:string', children: [], diff --git a/libs/data-mapper-v3/test/webview-smoke/shell.js b/libs/data-mapper-v3/test/webview-smoke/shell.js index 2e3e16e5a28..97a34ff4855 100644 --- a/libs/data-mapper-v3/test/webview-smoke/shell.js +++ b/libs/data-mapper-v3/test/webview-smoke/shell.js @@ -16,9 +16,15 @@ runScenario('React shell mounts with stable layout', async () => { ); assert.deepEqual( Array.from(document.querySelector('.mapping-area').children) - .slice(0, 3) + .slice(0, 5) .map((pane) => pane.className), - ['schema-tree-container source-tree', 'canvas-workspace', 'schema-tree-container target-tree'] + [ + 'schema-tree-container source-tree', + 'schema-pane-divider', + 'canvas-workspace', + 'schema-pane-divider', + 'schema-tree-container target-tree', + ] ); assert.deepEqual( Array.from(document.querySelector('.canvas-workspace').children).map((pane) => pane.className),