mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
fix(core): Fix issue with fixedCollection having all default values
This commit is contained in:
@@ -3008,6 +3008,306 @@ describe('Workflow', () => {
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
description:
|
||||
'complex type "collection" which contains a "fixedCollection" with "multipleValues: false" that has a collection value added but nothing to the fixedCollection',
|
||||
input: {
|
||||
nodePropertiesArray: [
|
||||
{
|
||||
displayName: 'Options',
|
||||
name: 'options',
|
||||
placeholder: 'Add Option',
|
||||
type: 'collection',
|
||||
default: {},
|
||||
options: [
|
||||
{
|
||||
displayName: 'Sort',
|
||||
name: 'sort',
|
||||
type: 'fixedCollection',
|
||||
typeOptions: {
|
||||
multipleValues: false,
|
||||
},
|
||||
default: {},
|
||||
placeholder: 'Add Sort',
|
||||
options: [
|
||||
{
|
||||
displayName: 'Sort',
|
||||
name: 'value',
|
||||
values: [
|
||||
{
|
||||
displayName: 'Descending',
|
||||
name: 'descending',
|
||||
type: 'boolean',
|
||||
default: true,
|
||||
description: 'Sort by descending order',
|
||||
},
|
||||
{
|
||||
displayName: 'Order By',
|
||||
name: 'ordering',
|
||||
type: 'options',
|
||||
default: 'date',
|
||||
options: [
|
||||
{
|
||||
name: 'Date',
|
||||
value: 'date',
|
||||
},
|
||||
{
|
||||
name: 'Name',
|
||||
value: 'name',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
nodeValues: {
|
||||
options: {
|
||||
sort: {},
|
||||
},
|
||||
},
|
||||
},
|
||||
output: {
|
||||
noneDisplayedFalse: {
|
||||
defaultsFalse: {
|
||||
options: {
|
||||
sort: {},
|
||||
},
|
||||
},
|
||||
defaultsTrue: {
|
||||
options: {
|
||||
sort: {},
|
||||
},
|
||||
},
|
||||
},
|
||||
noneDisplayedTrue: {
|
||||
defaultsFalse: {
|
||||
options: {
|
||||
sort: {},
|
||||
},
|
||||
},
|
||||
defaultsTrue: {
|
||||
options: {
|
||||
sort: {},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
description:
|
||||
'complex type "collection" which contains a "fixedCollection" with "multipleValues: false" that has all values set to the default values (by having it as an empty object)',
|
||||
input: {
|
||||
nodePropertiesArray: [
|
||||
{
|
||||
displayName: 'Options',
|
||||
name: 'options',
|
||||
placeholder: 'Add Option',
|
||||
type: 'collection',
|
||||
default: {},
|
||||
options: [
|
||||
{
|
||||
displayName: 'Sort',
|
||||
name: 'sort',
|
||||
type: 'fixedCollection',
|
||||
typeOptions: {
|
||||
multipleValues: false,
|
||||
},
|
||||
default: {},
|
||||
placeholder: 'Add Sort',
|
||||
options: [
|
||||
{
|
||||
displayName: 'Sort',
|
||||
name: 'value',
|
||||
values: [
|
||||
{
|
||||
displayName: 'Descending',
|
||||
name: 'descending',
|
||||
type: 'boolean',
|
||||
default: true,
|
||||
description: 'Sort by descending order',
|
||||
},
|
||||
{
|
||||
displayName: 'Order By',
|
||||
name: 'ordering',
|
||||
type: 'options',
|
||||
default: 'date',
|
||||
options: [
|
||||
{
|
||||
name: 'Date',
|
||||
value: 'date',
|
||||
},
|
||||
{
|
||||
name: 'Name',
|
||||
value: 'name',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
nodeValues: {
|
||||
options: {
|
||||
sort: {
|
||||
value: {},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
output: {
|
||||
noneDisplayedFalse: {
|
||||
defaultsFalse: {
|
||||
options: {
|
||||
sort: {
|
||||
value: {},
|
||||
},
|
||||
},
|
||||
},
|
||||
defaultsTrue: {
|
||||
options: {
|
||||
sort: {
|
||||
value: {
|
||||
descending: true,
|
||||
ordering: 'date',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
noneDisplayedTrue: {
|
||||
defaultsFalse: {
|
||||
options: {
|
||||
sort: {
|
||||
value: {},
|
||||
},
|
||||
},
|
||||
},
|
||||
defaultsTrue: {
|
||||
options: {
|
||||
sort: {
|
||||
value: {
|
||||
descending: true,
|
||||
ordering: 'date',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
description:
|
||||
'complex type "collection" which contains a "fixedCollection" with "multipleValues: false" that has all values set to the default values (by having each value set)',
|
||||
input: {
|
||||
nodePropertiesArray: [
|
||||
{
|
||||
displayName: 'Options',
|
||||
name: 'options',
|
||||
placeholder: 'Add Option',
|
||||
type: 'collection',
|
||||
default: {},
|
||||
options: [
|
||||
{
|
||||
displayName: 'Sort',
|
||||
name: 'sort',
|
||||
type: 'fixedCollection',
|
||||
typeOptions: {
|
||||
multipleValues: false,
|
||||
},
|
||||
default: {},
|
||||
options: [
|
||||
{
|
||||
displayName: 'Sort',
|
||||
name: 'value',
|
||||
values: [
|
||||
{
|
||||
displayName: 'Descending',
|
||||
name: 'descending',
|
||||
type: 'boolean',
|
||||
default: true,
|
||||
},
|
||||
{
|
||||
displayName: 'Order By',
|
||||
name: 'ordering',
|
||||
type: 'options',
|
||||
default: 'date',
|
||||
options: [
|
||||
{
|
||||
name: 'Date',
|
||||
value: 'date',
|
||||
},
|
||||
{
|
||||
name: 'Name',
|
||||
value: 'name',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
nodeValues: {
|
||||
options: {
|
||||
sort: {
|
||||
value: {
|
||||
descending: true,
|
||||
ordering: 'date',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
output: {
|
||||
noneDisplayedFalse: {
|
||||
defaultsFalse: {
|
||||
options: {
|
||||
sort: {
|
||||
value: {},
|
||||
},
|
||||
},
|
||||
},
|
||||
defaultsTrue: {
|
||||
options: {
|
||||
sort: {
|
||||
value: {
|
||||
descending: true,
|
||||
ordering: 'date',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
noneDisplayedTrue: {
|
||||
defaultsFalse: {
|
||||
options: {
|
||||
sort: {
|
||||
value: {},
|
||||
},
|
||||
},
|
||||
},
|
||||
defaultsTrue: {
|
||||
options: {
|
||||
sort: {
|
||||
value: {
|
||||
descending: true,
|
||||
ordering: 'date',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
for (const testData of tests) {
|
||||
|
||||
Reference in New Issue
Block a user