fix(integration-tests): auth with multiworkspace and skip clickhouse … (#11630)
…tests
This commit is contained in:
@ -3,6 +3,7 @@ import { JestConfigWithTsJest, pathsToModuleNameMapper } from 'ts-jest';
|
||||
import { NodeEnvironment } from 'src/engine/core-modules/twenty-config/interfaces/node-environment.interface';
|
||||
|
||||
const isBillingEnabled = process.env.IS_BILLING_ENABLED === 'true';
|
||||
const isClickhouseEnabled = process.env.CLICKHOUSE_URL !== undefined;
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
const tsConfig = require('./tsconfig.json');
|
||||
@ -16,9 +17,11 @@ const jestConfig: JestConfigWithTsJest = {
|
||||
moduleFileExtensions: ['js', 'json', 'ts'],
|
||||
rootDir: '.',
|
||||
testEnvironment: 'node',
|
||||
testRegex: isBillingEnabled
|
||||
? '\\.integration-spec\\.ts$'
|
||||
: '^(?!.*billing).*\\.integration-spec\\.ts$',
|
||||
testPathIgnorePatterns: [
|
||||
...(isBillingEnabled ? [] : ['<rootDir>/test/integration/billing']),
|
||||
...(isClickhouseEnabled ? [] : ['<rootDir>/test/integration/analytics']),
|
||||
],
|
||||
testRegex: '\\.integration-spec\\.ts$',
|
||||
modulePathIgnorePatterns: ['<rootDir>/dist'],
|
||||
globalSetup: '<rootDir>/test/integration/utils/setup-test.ts',
|
||||
globalTeardown: '<rootDir>/test/integration/utils/teardown-test.ts',
|
||||
|
||||
@ -5,6 +5,7 @@ import { createClient, ClickHouseClient } from '@clickhouse/client';
|
||||
|
||||
import { GenericTrackEvent } from 'src/engine/core-modules/analytics/utils/events/track/track';
|
||||
import { OBJECT_RECORD_CREATED_EVENT } from 'src/engine/core-modules/analytics/utils/events/track/object-record/object-record-created';
|
||||
|
||||
describe('ClickHouse Event Registration (integration)', () => {
|
||||
let clickhouseClient: ClickHouseClient;
|
||||
|
||||
|
||||
@ -4,6 +4,13 @@ const SERVER_URL = `http://localhost:${APP_PORT}`;
|
||||
|
||||
const client = request(SERVER_URL);
|
||||
|
||||
const ORIGIN = new URL(SERVER_URL);
|
||||
|
||||
ORIGIN.hostname =
|
||||
process.env.IS_MULTIWORKSPACE_ENABLED === 'true'
|
||||
? `acme.${ORIGIN.hostname}`
|
||||
: ORIGIN.hostname;
|
||||
|
||||
const auth = {
|
||||
email: 'tim@apple.dev',
|
||||
password: 'Applecar2025',
|
||||
@ -28,7 +35,7 @@ describe('AuthResolve (integration)', () => {
|
||||
|
||||
return client
|
||||
.post('/graphql')
|
||||
.set('Origin', SERVER_URL)
|
||||
.set('Origin', ORIGIN.toString())
|
||||
.send(queryData)
|
||||
.expect(200)
|
||||
.expect((res) => {
|
||||
@ -62,7 +69,7 @@ describe('AuthResolve (integration)', () => {
|
||||
|
||||
return client
|
||||
.post('/graphql')
|
||||
.set('Origin', SERVER_URL)
|
||||
.set('Origin', ORIGIN.toString())
|
||||
.send(queryData)
|
||||
.expect(200)
|
||||
.expect((res) => {
|
||||
|
||||
Reference in New Issue
Block a user