mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
test: Add Edit Fields node helper and tests (#18726)
This commit is contained in:
@@ -47,4 +47,42 @@ test.describe('03 - Node Details Configuration', () => {
|
||||
|
||||
await expect(n8n.ndv.getParameterInputField('path')).toHaveValue('explicit-types');
|
||||
});
|
||||
|
||||
test('should configure Edit Fields node with single field', async ({ n8n }) => {
|
||||
await n8n.canvas.addNode('Edit Fields (Set)');
|
||||
|
||||
await n8n.ndv.editFields.setSingleFieldValue('testField', 'string', 'Hello World');
|
||||
|
||||
const nameInput = n8n.ndv.getAssignmentName('assignments', 0).getByRole('textbox');
|
||||
await expect(nameInput).toHaveValue('testField');
|
||||
});
|
||||
|
||||
test('should configure Edit Fields node with multiple fields', async ({ n8n }) => {
|
||||
await n8n.canvas.addNode('Edit Fields (Set)');
|
||||
|
||||
await n8n.ndv.editFields.setFieldsValues([
|
||||
{ name: 'stringField', type: 'string', value: 'Test String' },
|
||||
{ name: 'numberField', type: 'number', value: 123 },
|
||||
{ name: 'booleanField', type: 'boolean', value: true },
|
||||
]);
|
||||
|
||||
await expect(
|
||||
n8n.ndv.getAssignmentCollectionContainer('assignments').getByTestId('assignment'),
|
||||
).toHaveCount(3);
|
||||
});
|
||||
|
||||
test('should configure Edit Fields node with all field types', async ({ n8n }) => {
|
||||
await n8n.canvas.addNode('Edit Fields (Set)');
|
||||
|
||||
await n8n.ndv.editFields.setFieldsValues([
|
||||
{ name: 'myString', type: 'string', value: 'Hello' },
|
||||
{ name: 'myNumber', type: 'number', value: 42 },
|
||||
{ name: 'myBoolean', type: 'boolean', value: false },
|
||||
{ name: 'myArray', type: 'array', value: '["item1", "item2"]' },
|
||||
]);
|
||||
|
||||
await expect(
|
||||
n8n.ndv.getAssignmentCollectionContainer('assignments').getByTestId('assignment'),
|
||||
).toHaveCount(4);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user