diff --git a/packages/expo-sms/src/__tests__/SMS-test.ts b/packages/expo-sms/src/__tests__/SMS-test.ts index 888b998d77ddb..d9e865f4618e1 100644 --- a/packages/expo-sms/src/__tests__/SMS-test.ts +++ b/packages/expo-sms/src/__tests__/SMS-test.ts @@ -1,13 +1,34 @@ import { NativeModulesProxy } from '@unimodules/core'; import * as SMS from '../SMS'; +import { MMSAttachmentType } from '../SMS.types'; it(`normalizes one phone number into an array`, async () => { const { ExpoSMS } = NativeModulesProxy; await SMS.sendSMSAsync('0123456789', 'test'); - expect(ExpoSMS.sendSMSAsync).toHaveBeenLastCalledWith(['0123456789'], 'test'); + expect(ExpoSMS.sendSMSAsync).toHaveBeenLastCalledWith(['0123456789'], 'test', undefined); await SMS.sendSMSAsync(['0123456789', '9876543210'], 'test'); - expect(ExpoSMS.sendSMSAsync).toHaveBeenLastCalledWith(['0123456789', '9876543210'], 'test'); + expect(ExpoSMS.sendSMSAsync).toHaveBeenLastCalledWith( + ['0123456789', '9876543210'], + 'test', + undefined + ); +}); + +it(`passes attachmentData parameter to native`, async () => { + const { ExpoSMS } = NativeModulesProxy; + + await SMS.sendSMSAsync('0123456789', 'test'); + expect(ExpoSMS.sendSMSAsync).toHaveBeenLastCalledWith(['0123456789'], 'test', undefined); + + const attachmentData = { + contentUri: 'path/myfile.png', + iOSFilename: 'myfile.png', + iOSType: 'public.png', + androidType: 'image/png', + } as MMSAttachmentType; + await SMS.sendSMSAsync('0123456789', 'test', attachmentData); + expect(ExpoSMS.sendSMSAsync).toHaveBeenLastCalledWith(['0123456789'], 'test', attachmentData); });