Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion libs/data-mapper-v3/e2e/copilot.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => ({
Expand Down
23 changes: 20 additions & 3 deletions libs/data-mapper-v3/e2e/pointerInteractions.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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/);
Expand Down Expand Up @@ -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 });
Expand All @@ -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!);
Expand Down Expand Up @@ -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');
Expand Down
9 changes: 8 additions & 1 deletion libs/data-mapper-v3/e2e/schemaLoading.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
3 changes: 3 additions & 0 deletions libs/data-mapper-v3/test/webview-smoke/harness.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: [],
Expand Down
10 changes: 8 additions & 2 deletions libs/data-mapper-v3/test/webview-smoke/shell.js
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
Loading