From 34674698e527ff6ef754943e27e6cb2d25eb27ad Mon Sep 17 00:00:00 2001 From: matinzd <24797481+matinzd@users.noreply.github.com> Date: Mon, 19 Aug 2024 15:37:57 +0200 Subject: [PATCH] test: add string value check for hashed email address --- packages/analytics/__tests__/analytics.test.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packages/analytics/__tests__/analytics.test.ts b/packages/analytics/__tests__/analytics.test.ts index 588997fa0b..209452dd2b 100644 --- a/packages/analytics/__tests__/analytics.test.ts +++ b/packages/analytics/__tests__/analytics.test.ts @@ -881,6 +881,15 @@ describe('Analytics', function () { expect(initiateOnDeviceConversionMeasurementWithHashedEmailAddress).toBeDefined(); }); + it('`initiateOnDeviceConversionMeasurementWithHashedEmailAddress` throws if not a string', function () { + expect(() => + // @ts-ignore + firebase.analytics().initiateOnDeviceConversionMeasurementWithHashedEmailAddress(true), + ).toThrowError( + "firebase.analytics().initiateOnDeviceConversionMeasurementWithHashedEmailAddress(*) 'hashedEmailAddress' expected a string value.", + ); + }); + it('`initiateOnDeviceConversionMeasurementWithHashedPhoneNumber` should throw if the value is in E.164 format', function () { expect(() => initiateOnDeviceConversionMeasurementWithHashedPhoneNumber(getAnalytics(), '+1234567890'),