Skip to content

Commit

Permalink
test: add string value check for hashed email address
Browse files Browse the repository at this point in the history
  • Loading branch information
matinzd committed Aug 19, 2024
1 parent 455c45d commit 3467469
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/analytics/__tests__/analytics.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand Down

0 comments on commit 3467469

Please sign in to comment.