snapshot of https://github.com/twentyhq/twenty.git (main, 2026-09-17; blobs > 131072B omitted)
Some checks failed
App Prod-Parity E2E Dispatch / dispatch (push) Failing after 10s
CD Storybook UI / build (push) Failing after 3m25s
CD Storybook UI / dispatch (push) Has been skipped
CD deploy main / website-changed-files (push) Successful in 18m8s
CI Agent Skills / changed-files-check (push) Successful in 18m9s
CI Create App E2E minimal / changed-files-check (push) Successful in 24s
CI Create App / changed-files-check (push) Successful in 26s
CI Docs / changed-files-check (push) Successful in 26s
CI Emails / changed-files-check (push) Successful in 28s
CI Example App Hello World / changed-files-check (push) Successful in 23s
CI Front / changed-files-check (push) Has been skipped
CI Example App Postcard / changed-files-check (push) Successful in 27s
CI UI / changed-files-check (push) Has been skipped
CI Utils Test / changed-files-check (push) Successful in 45s
CI Twenty Apps / discover (push) Successful in 1m3s
CD deploy main / deploy-main (push) Failing after 3s
CI Agent Skills / agent-skills-validate (push) Has been skipped
CI Create App / create-app-test (lint) (push) Has been skipped
CI Emails / emails-test (push) Has been skipped
CI Front / front-task (lingui:compile) (push) Has been skipped
CI Front / front-task (lint) (push) Has been skipped
CI Example App Postcard / example-app-postcard (push) Has been skipped
CI UI / ui-task (lint) (push) Has been skipped
CI UI / ui-task (pack-size) (push) Has been skipped
CI UI / ui-task (size) (push) Has been skipped
CI UI / ui-task (test) (push) Has been skipped
CI UI / ui-task (typecheck) (push) Has been skipped
CI Utils Test / utils-test (push) Has been skipped
CI Twenty Apps / ${{ matrix.app.name }} (push) Has been skipped
CI Emails / ci-emails-status-check (push) Successful in 2s
CI Example App Hello World / ci-example-app-hello-world-status-check (push) Successful in 2s
CI Example App Postcard / ci-example-app-postcard-status-check (push) Successful in 3s
CI UI / ui-sb-test (push) Has been skipped
CI Utils Test / ci-utils-test-status-check (push) Successful in 2s
CI Twenty Apps / ci-twenty-apps-status-check (push) Successful in 2s
CI UI / ci-ui-status-check (push) Successful in 2s
CI Desktop / desktop (push) Failing after 1m8s
Push docs to Crowdin / Push documentation to Crowdin (push) Failing after 55s
Push translations to Crowdin / Extract and upload translations (push) Failing after 5s
Push website translations to Crowdin / Extract and upload website translations (push) Failing after 5s
CI Create App / create-app-test (test) (push) Has been skipped
CI Create App / create-app-test (typecheck) (push) Has been skipped
CI Docs / docs-lint (push) Has been skipped
CI Example App Hello World / example-app-hello-world (push) Has been skipped
CI Front / front-task (lingui:extract) (push) Has been skipped
CI Front / front-task (test) (push) Has been skipped
CI Front / front-task (typecheck) (push) Has been skipped
CI UI / ui-sb-build (push) Failing after 1m32s
CI Twenty Apps / ${{ matrix.app.name }} (${{ matrix.server-source }}) (push) Has been skipped
CI Agent Skills / agent-skills-publish (push) Has been skipped
CI Create App / ci-create-app-status-check (push) Successful in 2s
CI Agent Skills / agent-skills-remote-source (push) Has been skipped
CI Create App E2E minimal / create-app-e2e-minimal (push) Has been cancelled
CI E2E Main / e2e-test (push) Has been cancelled
CI Front / front-sb-build (push) Has been cancelled
CI Front / front-build (push) Has been cancelled
CI Create App E2E minimal / ci-create-app-e2e-minimal-status-check (push) Has been cancelled
CI E2E Main / ci-e2e-main-status-check (push) Has been cancelled
CI E2E Main / notify-main-ci-failure (push) Has been cancelled
CI E2E Main / qa-scout-comment (push) Has been cancelled
CI Front / front-sb-test (push) Has been cancelled
CI Front / front-sb-screenshots (push) Has been cancelled
CI Front / ci-front-status-check (push) Has been cancelled
DPA Sub-Processor Sync / sync-subprocessors (push) Failing after 3s
AI Catalog Sync / sync-catalog (push) Failing after 3s

This commit is contained in:
upstream-mirror
2026-09-17 23:28:13 +05:00
commit e7da97194a
32688 changed files with 4208681 additions and 0 deletions

View File

@@ -0,0 +1,49 @@
import { MUTLI_SELECT_OPERATION_AGNOSTIC_TEST_CASES } from 'test/integration/metadata/suites/field-metadata/enum/common/multi-select-operation-agnostic-test-cases';
import { SELECT_OPERATION_AGNOSTIC_TEST_CASES } from 'test/integration/metadata/suites/field-metadata/enum/common/select-operation-agnostic-test-cases';
import { type FieldMetadataEnumSuccessfulAndFailingTestCases } from 'test/integration/metadata/suites/field-metadata/enum/types/fieldMetadataEnumSuccessfulAndFailingTestCases';
import { type UpdateCreateFieldMetadataSelectTestCase } from 'test/integration/metadata/suites/field-metadata/enum/types/update-create-field-metadata-enum-test-case';
import { type FieldMetadataComplexOption } from 'twenty-shared/types';
import { type EnumFieldMetadataUnionType } from 'src/engine/metadata-modules/field-metadata/utils/is-enum-field-metadata-type.util';
const fieldMetadataTypeAgnosticCreateFailingTestCases: UpdateCreateFieldMetadataSelectTestCase[] =
[
{
title: 'should fail with null options',
context: {
input: {
options: null as unknown as FieldMetadataComplexOption[],
},
},
},
{
title: 'should fail with undefined options',
context: {
input: {
options: undefined as unknown as FieldMetadataComplexOption[],
},
},
},
];
export const CREATE_ENUM_FIELD_METADATA_TEST_CASES: Partial<
Record<
EnumFieldMetadataUnionType,
FieldMetadataEnumSuccessfulAndFailingTestCases
>
> = {
MULTI_SELECT: {
failing: [
...MUTLI_SELECT_OPERATION_AGNOSTIC_TEST_CASES.failing,
...fieldMetadataTypeAgnosticCreateFailingTestCases,
],
successful: [...MUTLI_SELECT_OPERATION_AGNOSTIC_TEST_CASES.successful],
},
SELECT: {
failing: [
...SELECT_OPERATION_AGNOSTIC_TEST_CASES.failing,
...fieldMetadataTypeAgnosticCreateFailingTestCases,
],
successful: [...SELECT_OPERATION_AGNOSTIC_TEST_CASES.successful],
},
};

View File

@@ -0,0 +1,122 @@
import { isDefined } from 'class-validator';
import { BASIC_FAILING_STRING_EDGE_CASE_INPUTS } from 'test/constants/basic-failing-string-edge-case-inputs.constant';
import { SELECT_AND_MULTI_SELECT_OPERATION_AGNOSTIC_SUCCESSFUL_AND_FAILING_TEST_CASES } from 'test/integration/metadata/suites/field-metadata/enum/common/select-and-multi-select-operation-agnostic-tests-cases';
import { type FieldMetadataEnumSuccessfulAndFailingTestCases } from 'test/integration/metadata/suites/field-metadata/enum/types/fieldMetadataEnumSuccessfulAndFailingTestCases';
import { type UpdateCreateFieldMetadataSelectTestCase } from 'test/integration/metadata/suites/field-metadata/enum/types/update-create-field-metadata-enum-test-case';
const fuzzedDefaultValueFailingTestCases: UpdateCreateFieldMetadataSelectTestCase[] =
BASIC_FAILING_STRING_EDGE_CASE_INPUTS.filter((el) => isDefined(el.input)).map(
({ input, label }) => ({
title: `should fail with ${label} defaultValue`,
context: {
input: {
defaultValue: [input],
options: [
{
label: 'Option 1',
value: 'OPTION_1',
color: 'green',
position: 1,
},
],
},
},
}),
);
export const MUTLI_SELECT_OPERATION_AGNOSTIC_TEST_CASES: FieldMetadataEnumSuccessfulAndFailingTestCases =
{
successful: [
...SELECT_AND_MULTI_SELECT_OPERATION_AGNOSTIC_SUCCESSFUL_AND_FAILING_TEST_CASES.successful,
{
title: 'should succeed with valid multi-select default values',
context: {
input: {
defaultValue: ["'OPTION_1'", "'OPTION_2'"],
options: [
{
label: 'Option 1',
value: 'OPTION_1',
color: 'green',
position: 1,
},
{
label: 'Option 2',
value: 'OPTION_2',
color: 'blue',
position: 2,
},
],
},
},
},
],
failing: [
...fuzzedDefaultValueFailingTestCases,
...SELECT_AND_MULTI_SELECT_OPERATION_AGNOSTIC_SUCCESSFUL_AND_FAILING_TEST_CASES.failing,
{
title: 'should fail with non stringified array default value',
context: {
input: {
defaultValue: 'Option_1',
options: [
{
label: 'Option 1',
value: 'OPTION_1',
color: 'green',
position: 1,
},
],
},
},
},
{
title: 'should fail with empty multi-select default values array',
context: {
input: {
defaultValue: [],
options: [
{
label: 'Option 1',
value: 'OPTION_1',
color: 'green',
position: 1,
},
],
},
},
},
{
title: 'should fail with unknown multi-select default values',
context: {
input: {
defaultValue: ["'OPTION_1'", "'UNKNOWN_OPTION'"],
options: [
{
label: 'Option 1',
value: 'OPTION_1',
color: 'green',
position: 1,
},
],
},
},
},
{
title: 'should fail with invalid multi-select default value format',
context: {
input: {
defaultValue: ['invalid', 'format'],
options: [
{
label: 'Option 1',
value: 'OPTION_1',
color: 'green',
position: 1,
},
],
},
},
},
],
};

View File

@@ -0,0 +1,369 @@
import { BASIC_FAILING_STRING_EDGE_CASE_INPUTS } from 'test/constants/basic-failing-string-edge-case-inputs.constant';
import { type FieldMetadataEnumSuccessfulAndFailingTestCases } from 'test/integration/metadata/suites/field-metadata/enum/types/fieldMetadataEnumSuccessfulAndFailingTestCases';
import { type UpdateCreateFieldMetadataSelectTestCase } from 'test/integration/metadata/suites/field-metadata/enum/types/update-create-field-metadata-enum-test-case';
import {
type FieldMetadataComplexOption,
type TagColor,
} from 'twenty-shared/types';
import { v4 } from 'uuid';
const stringFields: (keyof FieldMetadataComplexOption)[] = [
'id',
'label',
'value',
];
const fuzzedOptionsStringFieldFailingTestCases: UpdateCreateFieldMetadataSelectTestCase[] =
stringFields.flatMap((field) => {
return BASIC_FAILING_STRING_EDGE_CASE_INPUTS.map<UpdateCreateFieldMetadataSelectTestCase>(
({ input, label }) => ({
title: `should fail with ${label} ${field}`,
context: {
input: {
options: [
{
label: 'Option 1',
value: 'OPTION_1',
color: 'green',
position: 1,
[field]: input,
},
],
},
},
}),
);
});
export const SELECT_AND_MULTI_SELECT_OPERATION_AGNOSTIC_SUCCESSFUL_AND_FAILING_TEST_CASES: FieldMetadataEnumSuccessfulAndFailingTestCases =
{
failing: [
...fuzzedOptionsStringFieldFailingTestCases,
{
title: 'should fail with invalid option id',
context: {
input: {
options: [
{
label: 'Option 1',
value: 'OPTION_1',
color: 'green',
position: 1,
id: 'not a uuid',
},
],
},
},
},
{
title: 'should fail with empty options',
context: {
input: {
options: [],
},
},
},
{
title: 'should fail with invalid option value format',
context: {
input: {
options: [
{
label: 'Option 1',
value: 'Option 1 and some other things, /',
color: 'green',
position: 1,
},
],
},
},
},
{
title: 'should fail with comma in option label',
context: {
input: {
options: [
{
label: 'Option ,1',
value: 'OPTION_1',
color: 'green',
position: 1,
},
],
},
},
},
{
title: 'should fail with duplicated option values',
context: {
input: {
options: [
{
label: 'Option 1',
value: 'OPTION_1',
color: 'green',
position: 0,
},
{
label: 'Option 1',
value: 'OPTION_1',
color: 'green',
position: 1,
},
],
},
},
},
{
title: 'should fail with duplicated option ids',
context: {
input: {
options: [
{
label: 'Option 1',
value: 'OPTION_1',
color: 'green',
position: 1,
id: 'fd1f11fd-3f05-4a33-bddf-800c3412ce98',
},
{
label: 'Option 2',
value: 'OPTION_2',
color: 'green',
position: 2,
id: 'fd1f11fd-3f05-4a33-bddf-800c3412ce98',
},
],
},
},
},
{
title: 'should fail with duplicated option positions',
context: {
input: {
options: [
{
label: 'Option 1',
value: 'OPTION_1',
color: 'green',
position: 1,
},
{
label: 'Option 2',
value: 'OPTION_2',
color: 'green',
position: 1,
},
],
},
},
},
{
title: 'should fail with duplicated trimmed option values',
context: {
input: {
options: [
{
label: 'Option 1',
value: ' OPTION_1 ',
color: 'green',
position: 1,
},
{
label: 'Option 2',
value: ' OPTION_1 ',
color: 'green',
position: 2,
},
],
},
},
},
{
title: 'should fail with undefined option label',
context: {
input: {
options: [
{
label: undefined as unknown as string,
value: 'OPTION_1',
color: 'green',
position: 1,
},
],
},
},
},
{
title: 'should fail with an invalid default value',
context: {
input: {
defaultValue: 'invalid',
options: [
{
label: 'Option 1',
value: 'OPTION_1',
color: 'green',
position: 1,
},
],
},
},
},
{
title: 'should fail with an unknown default value',
context: {
input: {
defaultValue: "'OPTION_424242'",
options: [
{
label: 'Option 1',
value: 'OPTION_1',
color: 'green',
position: 1,
},
],
},
},
},
{
title: 'should fail with undefined option value',
context: {
input: {
options: [
{
label: 'Option 1',
value: undefined as unknown as string,
color: 'green',
position: 1,
},
],
},
},
},
],
successful: [
{
title: 'should succeed with provided option id',
context: {
input: {
options: [
{
label: 'Option 1',
value: 'OPTION_1',
color: 'green',
position: 1,
id: '26c602c3-cba9-4d83-92d4-4ba7dbae2f31',
},
],
},
},
},
{
title: 'should succeed with various options id',
context: {
input: {
options: Array.from({ length: 42 }, (_value, index) => {
const optionWithoutId: FieldMetadataComplexOption = {
label: `Option ${index}`,
value: `OPTION_${index}`,
color: 'green',
position: index,
};
if (index % 2 === 0) {
return {
...optionWithoutId,
id: v4(),
};
}
return optionWithoutId;
}),
},
},
},
{
title: 'should succeed without option id',
context: {
input: {
options: [
{
label: 'Option 1',
value: 'OPTION_1',
color: 'green',
position: 1,
},
],
},
},
},
{
title: 'should trim option values',
context: {
input: {
options: [
{
label: ' Option 1 ',
value: ' OPTION_1 ',
color: 'green',
position: 1,
},
],
},
expectedOptions: [
{
label: 'Option 1',
value: 'OPTION_1',
color: 'green',
position: 1,
},
],
},
},
{
title: 'should default a missing option color to gray',
context: {
input: {
options: [
{
label: 'Option 1',
value: 'OPTION_1',
position: 1,
},
],
},
expectedOptions: [
{
label: 'Option 1',
value: 'OPTION_1',
color: 'gray',
position: 1,
},
],
},
},
{
title: 'should trim option color',
context: {
input: {
options: [
{
label: 'Option 1',
value: 'OPTION_1',
color: ' blue ' as TagColor,
position: 1,
},
],
},
expectedOptions: [
{
label: 'Option 1',
value: 'OPTION_1',
color: 'blue',
position: 1,
},
],
},
},
],
};

View File

@@ -0,0 +1,70 @@
import { isDefined } from 'class-validator';
import { BASIC_FAILING_STRING_EDGE_CASE_INPUTS } from 'test/constants/basic-failing-string-edge-case-inputs.constant';
import { SELECT_AND_MULTI_SELECT_OPERATION_AGNOSTIC_SUCCESSFUL_AND_FAILING_TEST_CASES } from 'test/integration/metadata/suites/field-metadata/enum/common/select-and-multi-select-operation-agnostic-tests-cases';
import { type FieldMetadataEnumSuccessfulAndFailingTestCases } from 'test/integration/metadata/suites/field-metadata/enum/types/fieldMetadataEnumSuccessfulAndFailingTestCases';
import { type UpdateCreateFieldMetadataSelectTestCase } from 'test/integration/metadata/suites/field-metadata/enum/types/update-create-field-metadata-enum-test-case';
const fuzzedDefaultValueFailingTestCases: UpdateCreateFieldMetadataSelectTestCase[] =
BASIC_FAILING_STRING_EDGE_CASE_INPUTS.filter((el) => isDefined(el.input)).map(
({ input, label }) => ({
title: `should fail with ${label} defaultValue`,
context: {
input: {
defaultValue: input,
options: [
{
label: 'Option 1',
value: 'OPTION_1',
color: 'green',
position: 1,
},
],
},
},
}),
);
export const SELECT_OPERATION_AGNOSTIC_TEST_CASES: FieldMetadataEnumSuccessfulAndFailingTestCases =
{
failing: [
...fuzzedDefaultValueFailingTestCases,
...SELECT_AND_MULTI_SELECT_OPERATION_AGNOSTIC_SUCCESSFUL_AND_FAILING_TEST_CASES.failing,
],
successful: [
...SELECT_AND_MULTI_SELECT_OPERATION_AGNOSTIC_SUCCESSFUL_AND_FAILING_TEST_CASES.successful,
{
title: 'should succeed with valid default value',
context: {
input: {
defaultValue: "'OPTION_1'",
options: [
{
label: 'Option 1',
value: 'OPTION_1',
color: 'green',
position: 1,
id: '26c602c3-cba9-4d83-92d4-4ba7dbae2f31',
},
],
},
},
},
{
title: 'should succeed with null default value',
context: {
input: {
defaultValue: null,
options: [
{
label: 'Option 1',
value: 'OPTION_1',
color: 'green',
position: 1,
id: '26c602c3-cba9-4d83-92d4-4ba7dbae2f31',
},
],
},
},
},
],
};

View File

@@ -0,0 +1,94 @@
import { MUTLI_SELECT_OPERATION_AGNOSTIC_TEST_CASES } from 'test/integration/metadata/suites/field-metadata/enum/common/multi-select-operation-agnostic-test-cases';
import { SELECT_OPERATION_AGNOSTIC_TEST_CASES } from 'test/integration/metadata/suites/field-metadata/enum/common/select-operation-agnostic-test-cases';
import { type FieldMetadataEnumSuccessfulAndFailingTestCases } from 'test/integration/metadata/suites/field-metadata/enum/types/fieldMetadataEnumSuccessfulAndFailingTestCases';
import { type FieldMetadataComplexOption } from 'twenty-shared/types';
import { type EnumFieldMetadataUnionType } from 'src/engine/metadata-modules/field-metadata/utils/is-enum-field-metadata-type.util';
export const UPDATE_ENUM_FIELD_METADATA_TEST_CASES: Partial<
Record<
EnumFieldMetadataUnionType,
FieldMetadataEnumSuccessfulAndFailingTestCases
>
> = {
MULTI_SELECT: {
failing: [
...MUTLI_SELECT_OPERATION_AGNOSTIC_TEST_CASES.failing,
{
title: 'should fail with unknown default value and no options',
context: {
input: {
defaultValue: ["'OPTION_42'"],
options: undefined as unknown as FieldMetadataComplexOption[],
},
},
},
],
successful: [
...MUTLI_SELECT_OPERATION_AGNOSTIC_TEST_CASES.successful,
{
title: 'should succeed with default value and no options',
context: {
input: {
defaultValue: ["'OPTION_2'"],
options: undefined as unknown as FieldMetadataComplexOption[],
},
expectedOptions: [
{
label: 'Option 1',
value: 'OPTION_1',
color: 'green',
position: 1,
},
{
label: 'Option 2',
value: 'OPTION_2',
color: 'green',
position: 2,
},
],
},
},
],
},
SELECT: {
failing: [
...SELECT_OPERATION_AGNOSTIC_TEST_CASES.failing,
{
title: 'should fail with unknown default value and no options',
context: {
input: {
defaultValue: "'OPTION_42'",
options: undefined as unknown as FieldMetadataComplexOption[],
},
},
},
],
successful: [
...SELECT_OPERATION_AGNOSTIC_TEST_CASES.successful,
{
title: 'should succeed with default value and no options',
context: {
input: {
defaultValue: "'OPTION_2'",
options: undefined as unknown as FieldMetadataComplexOption[],
},
expectedOptions: [
{
label: 'Option 1',
value: 'OPTION_1',
color: 'green',
position: 1,
},
{
label: 'Option 2',
value: 'OPTION_2',
color: 'green',
position: 2,
},
],
},
},
],
},
};