mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-25 19:41:14 -08:00
fix(editor): Fix expression preview when previous node is selected (#9140)
This commit is contained in:
parent
a3eea3ac5e
commit
85780eade5
|
@ -276,6 +276,33 @@ describe('Data mapping', () => {
|
|||
ndv.actions.validateExpressionPreview('value', '0 [object Object]');
|
||||
});
|
||||
|
||||
it('renders expression preview when a previous node is selected', () => {
|
||||
cy.fixture('Test_workflow_3.json').then((data) => {
|
||||
cy.get('body').paste(JSON.stringify(data));
|
||||
});
|
||||
|
||||
workflowPage.actions.openNode('Set');
|
||||
ndv.actions.typeIntoParameterInput('value', 'test_value');
|
||||
ndv.actions.typeIntoParameterInput('name', '{selectall}test_name');
|
||||
ndv.actions.close();
|
||||
|
||||
workflowPage.actions.openNode('Set1');
|
||||
ndv.actions.executePrevious();
|
||||
ndv.getters.executingLoader().should('not.exist');
|
||||
ndv.getters.inputDataContainer().should('exist');
|
||||
ndv.getters
|
||||
.inputDataContainer()
|
||||
.should('exist')
|
||||
.find('span')
|
||||
.contains('test_name')
|
||||
.realMouseDown();
|
||||
ndv.actions.mapToParameter('value');
|
||||
|
||||
ndv.actions.validateExpressionPreview('value', 'test_value');
|
||||
ndv.actions.selectInputNode(SCHEDULE_TRIGGER_NODE_NAME);
|
||||
ndv.actions.validateExpressionPreview('value', 'test_value');
|
||||
});
|
||||
|
||||
it('shows you can drop to inputs, including booleans', () => {
|
||||
cy.fixture('Test_workflow_3.json').then((data) => {
|
||||
cy.get('body').paste(JSON.stringify(data));
|
||||
|
|
|
@ -83,12 +83,18 @@ const hint = computed(() => {
|
|||
|
||||
let result: Result<unknown, Error>;
|
||||
try {
|
||||
const resolvedValue = resolveExpression(value, undefined, {
|
||||
targetItem: ndvStore.hoveringItem ?? undefined,
|
||||
inputNodeName: ndvStore.ndvInputNodeName,
|
||||
inputRunIndex: ndvStore.ndvInputRunIndex,
|
||||
inputBranchIndex: ndvStore.ndvInputBranchIndex,
|
||||
}) as unknown;
|
||||
const resolvedValue = resolveExpression(
|
||||
value,
|
||||
undefined,
|
||||
ndvStore.isInputParentOfActiveNode
|
||||
? {
|
||||
targetItem: ndvStore.hoveringItem ?? undefined,
|
||||
inputNodeName: ndvStore.ndvInputNodeName,
|
||||
inputRunIndex: ndvStore.ndvInputRunIndex,
|
||||
inputBranchIndex: ndvStore.ndvInputBranchIndex,
|
||||
}
|
||||
: {},
|
||||
) as unknown;
|
||||
|
||||
result = { ok: true, result: resolvedValue };
|
||||
} catch (error) {
|
||||
|
|
Loading…
Reference in a new issue