test: Fix failing tests on MySQL for Public API (#3520)

*  Generalize transformer

*  Use transformer

* 🧪 Fix expectations
This commit is contained in:
Iván Ovejero
2022-06-23 19:59:23 +02:00
committed by GitHub
parent 55bab19eb4
commit 3ee384fd87
4 changed files with 12 additions and 15 deletions

View File

@@ -21,7 +21,7 @@ import { Role } from './Role';
import { SharedWorkflow } from './SharedWorkflow';
import { SharedCredentials } from './SharedCredentials';
import { NoXss } from '../utils/customValidators';
import { answersFormatter, lowerCaser } from '../utils/transformers';
import { objectRetriever, lowerCaser } from '../utils/transformers';
export const MIN_PASSWORD_LENGTH = 8;
@@ -98,7 +98,7 @@ export class User {
@Column({
type: resolveDataType('json') as ColumnOptions['type'],
nullable: true,
transformer: answersFormatter,
transformer: objectRetriever,
})
personalizationAnswers: IPersonalizationSurveyAnswers | null;

View File

@@ -22,6 +22,7 @@ import * as config from '../../../config';
import { DatabaseType, IWorkflowDb } from '../..';
import { TagEntity } from './TagEntity';
import { SharedWorkflow } from './SharedWorkflow';
import { objectRetriever } from '../utils/transformers';
function resolveDataType(dataType: string) {
const dbType = config.getEnv('database.type');
@@ -95,6 +96,7 @@ export class WorkflowEntity implements IWorkflowDb {
@Column({
type: resolveDataType('json') as ColumnOptions['type'],
nullable: true,
transformer: objectRetriever,
})
staticData?: IDataObject;