fix(Postgres Node): Account for JSON expressions (#12012)

Co-authored-by: Shireen Missi <94372015+ShireenMissi@users.noreply.github.com>
This commit is contained in:
Dana
2024-12-20 18:35:23 +01:00
committed by GitHub
parent d4116630a6
commit 06b86af735
4 changed files with 140 additions and 23 deletions

View File

@@ -13,6 +13,7 @@ import {
replaceEmptyStringsByNulls,
wrapData,
convertArraysToPostgresFormat,
isJSON,
} from '../../v2/helpers/utils';
const node: INode = {
@@ -26,6 +27,15 @@ const node: INode = {
},
};
describe('Test PostgresV2, isJSON', () => {
it('should return true for valid JSON', () => {
expect(isJSON('{"key": "value"}')).toEqual(true);
});
it('should return false for invalid JSON', () => {
expect(isJSON('{"key": "value"')).toEqual(false);
});
});
describe('Test PostgresV2, wrapData', () => {
it('should wrap object in json', () => {
const data = {