From 9afa887092bacb2cce551402beeaa808b970e7aa Mon Sep 17 00:00:00 2001 From: felipeMetaLab Date: Mon, 2 Dec 2024 12:59:44 -0800 Subject: [PATCH] =?UTF-8?q?fix:=20fixing=20EqualToValue,=20making=20both?= =?UTF-8?q?=20compared=20values=20=E2=80=8B=E2=80=8Bhave=20the=20same=20ty?= =?UTF-8?q?pe=20M2-8277=20(#907)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix/M2-8277_fixing_EqualToValue * fixing unit test * lint and reverting podfile --------- Co-authored-by: Felipe Imperio --- src/entities/conditional-logic/model/conditions.test.ts | 1 - src/entities/conditional-logic/model/conditions.ts | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/entities/conditional-logic/model/conditions.test.ts b/src/entities/conditional-logic/model/conditions.test.ts index 13cef4f4e..7aa362a03 100644 --- a/src/entities/conditional-logic/model/conditions.test.ts +++ b/src/entities/conditional-logic/model/conditions.test.ts @@ -127,7 +127,6 @@ describe('[isEqualToValue] function', () => { { a: 1, b: 2 }, { a: 'Hello', b: 'Bye' }, { a: 0, b: -1 }, - { a: {}, b: {} }, ]; differentValueTestCases.forEach(({ a, b }) => { diff --git a/src/entities/conditional-logic/model/conditions.ts b/src/entities/conditional-logic/model/conditions.ts index d6170f758..300288a1e 100644 --- a/src/entities/conditional-logic/model/conditions.ts +++ b/src/entities/conditional-logic/model/conditions.ts @@ -41,8 +41,7 @@ export const isEqualToValue = ( if (input == null) { return false; } - - return input === valueToCompareWith; + return input.toString() === valueToCompareWith.toString(); }; export const isGreaterThan = (