From 516c14995020eede0d584f8a3ad5f4d450db654b Mon Sep 17 00:00:00 2001 From: RgnDunes Date: Mon, 13 May 2024 01:49:59 +0530 Subject: [PATCH] [test]: add missing UT --- .../__tests__/getMaskedPhoneNumber.test.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/packages/i18nify-js/src/modules/phoneNumber/__tests__/getMaskedPhoneNumber.test.ts b/packages/i18nify-js/src/modules/phoneNumber/__tests__/getMaskedPhoneNumber.test.ts index db788aa3..7e65b29f 100644 --- a/packages/i18nify-js/src/modules/phoneNumber/__tests__/getMaskedPhoneNumber.test.ts +++ b/packages/i18nify-js/src/modules/phoneNumber/__tests__/getMaskedPhoneNumber.test.ts @@ -153,4 +153,17 @@ describe('phoneNumber - getMaskedPhoneNumber', () => { 'maskedDigitsCount exceeds phone number length. Value of "maskedDigitsCount" is 20', ); }); + + it('should format the phone number without including the dial code when withDialCode is false', () => { + const options = { + countryCode: 'US', + withDialCode: false, + maskingOptions: { + completeMasking: true, + }, + }; + const expectedOutput = 'xxx-xxx-xxxx'; + const result = getMaskedPhoneNumber(options as GetMaskedPhoneNumberOptions); + expect(result).toBe(expectedOutput); + }); });