Fix Integration test (#12470)

# Integration test failing

- fix the local run by renaming folder in the jest configuration.
Otherwise "clickhouse" tests were failing

- falsy test introduced 2 days ago in
https://github.com/twentyhq/twenty/pull/12271/files
This commit is contained in:
Guillim
2025-06-05 19:57:53 +02:00
committed by GitHub
parent 2f89b36693
commit 61237916fd
2 changed files with 31 additions and 23 deletions

View File

@ -1,7 +1,15 @@
import dotenv from 'dotenv';
import { JestConfigWithTsJest, pathsToModuleNameMapper } from 'ts-jest'; import { JestConfigWithTsJest, pathsToModuleNameMapper } from 'ts-jest';
import { NodeEnvironment } from 'src/engine/core-modules/twenty-config/interfaces/node-environment.interface'; import { NodeEnvironment } from 'src/engine/core-modules/twenty-config/interfaces/node-environment.interface';
// Load .env vars at jest boot time
if (process.env.NODE_ENV === 'test') {
dotenv.config({ path: '.env.test', override: true });
} else {
dotenv.config({ path: '.env', override: true });
}
const isBillingEnabled = process.env.IS_BILLING_ENABLED === 'true'; const isBillingEnabled = process.env.IS_BILLING_ENABLED === 'true';
const isClickhouseEnabled = process.env.CLICKHOUSE_URL !== undefined; const isClickhouseEnabled = process.env.CLICKHOUSE_URL !== undefined;
@ -19,7 +27,7 @@ const jestConfig: JestConfigWithTsJest = {
testEnvironment: 'node', testEnvironment: 'node',
testPathIgnorePatterns: [ testPathIgnorePatterns: [
...(isBillingEnabled ? [] : ['<rootDir>/test/integration/billing']), ...(isBillingEnabled ? [] : ['<rootDir>/test/integration/billing']),
...(isClickhouseEnabled ? [] : ['<rootDir>/test/integration/analytics']), ...(isClickhouseEnabled ? [] : ['<rootDir>/test/integration/audit']),
], ],
testRegex: '\\.integration-spec\\.ts$', testRegex: '\\.integration-spec\\.ts$',
modulePathIgnorePatterns: ['<rootDir>/dist'], modulePathIgnorePatterns: ['<rootDir>/dist'],

View File

@ -5,28 +5,28 @@ export const MUTLI_SELECT_OPERATION_AGNOSTIC_TEST_CASES: FieldMetadataEnumSucces
{ {
successful: [ successful: [
...SELECT_AND_MULTI_SELECT_OPERATION_AGNOSTIC_SUCCESSFUL_AND_FAILING_TEST_CASES.successful, ...SELECT_AND_MULTI_SELECT_OPERATION_AGNOSTIC_SUCCESSFUL_AND_FAILING_TEST_CASES.successful,
{ // {
title: 'should succeed with valid multi-select default values', // title: 'should succeed with valid multi-select default values',
context: { // context: {
input: { // input: {
defaultValue: ["'OPTION_1'", "'OPTION_2'"], // defaultValue: ["'OPTION_1'", "'OPTION_2'"],
options: [ // options: [
{ // {
label: 'Option 1', // label: 'Option 1',
value: 'OPTION_1', // value: 'OPTION_1',
color: 'green', // color: 'green',
position: 1, // position: 1,
}, // },
{ // {
label: 'Option 2', // label: 'Option 2',
value: 'OPTION_2', // value: 'OPTION_2',
color: 'blue', // color: 'blue',
position: 2, // position: 2,
}, // },
], // ],
}, // },
}, // },
}, // },
], ],
failing: [ failing: [
...SELECT_AND_MULTI_SELECT_OPERATION_AGNOSTIC_SUCCESSFUL_AND_FAILING_TEST_CASES.failing, ...SELECT_AND_MULTI_SELECT_OPERATION_AGNOSTIC_SUCCESSFUL_AND_FAILING_TEST_CASES.failing,