Skip to content

Commit

Permalink
test: add hashed phone number test for modular api
Browse files Browse the repository at this point in the history
  • Loading branch information
matinzd committed Aug 14, 2024
1 parent 889a7d3 commit 830cec4
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/analytics/__tests__/analytics.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -881,6 +881,14 @@ describe('Analytics', function () {
expect(initiateOnDeviceConversionMeasurementWithHashedEmailAddress).toBeDefined();
});

it('`initiateOnDeviceConversionMeasurementWithHashedPhoneNumber` should throw if the value is in E.164 format', function () {
expect(() =>
initiateOnDeviceConversionMeasurementWithHashedPhoneNumber(getAnalytics(), '+1234567890'),
).toThrowError(
"firebase.analytics().initiateOnDeviceConversionMeasurementWithHashedPhoneNumber(*) 'hashedPhoneNumber' expected a sha256-hashed value of a phone number in E.164 format.",
);
});

it('`initiateOnDeviceConversionMeasurementWithPhoneNumber` function is properly exposed to end user', function () {
expect(initiateOnDeviceConversionMeasurementWithPhoneNumber).toBeDefined();
});
Expand Down

0 comments on commit 830cec4

Please sign in to comment.