11import {
2- INBOX_TYPES ,
32 getAllowedFileTypesByChannel ,
43 getMaxUploadSizeByChannel ,
4+ INBOX_TYPES ,
55} from '../src/fileUploadRules' ;
66
77describe ( 'uploadRules helper' , ( ) => {
@@ -15,6 +15,9 @@ describe('uploadRules helper', () => {
1515 expect ( accept ) . toContain ( 'text/plain' ) ;
1616 expect ( accept ) . toContain ( 'application/json' ) ;
1717 expect ( accept ) . toContain ( '.3gpp' ) ;
18+ expect ( accept ) . toContain ( 'application/x-pkcs12' ) ;
19+ expect ( accept ) . toContain ( 'application/pkcs12' ) ;
20+ expect ( accept ) . toContain ( '.pfx' ) ;
1821 } ) ;
1922
2023 it ( 'returns WhatsApp specific accept list' , ( ) => {
@@ -33,6 +36,8 @@ describe('uploadRules helper', () => {
3336 expect ( accept ) . not . toContain ( 'application/json' ) ;
3437 expect ( accept ) . not . toContain ( '.3gpp' ) ;
3538 expect ( accept ) . not . toContain ( 'image/gif' ) ;
39+ expect ( accept ) . not . toContain ( 'application/x-pkcs12' ) ;
40+ expect ( accept ) . not . toContain ( '.pfx' ) ;
3641 } ) ;
3742
3843 it ( 'returns Instagram specific accept list' , ( ) => {
@@ -73,13 +78,25 @@ describe('uploadRules helper', () => {
7378 expect ( accept ) . not . toContain ( 'audio/mp3' ) ;
7479 } ) ;
7580
76- it ( 'falls back to default accept list for Twilio SMS (no mimeGroups )' , ( ) => {
81+ it ( 'returns Twilio SMS accept list (default-aligned, excluding PFX )' , ( ) => {
7782 const accept = getAllowedFileTypesByChannel ( {
7883 channelType : INBOX_TYPES . TWILIO ,
7984 medium : 'sms' ,
8085 } ) ;
81- expect ( accept ) . toContain ( 'image/*' ) ;
86+ expect ( accept ) . toContain ( 'image/jpeg' ) ;
87+ expect ( accept ) . toContain ( 'image/png' ) ;
88+ expect ( accept ) . not . toContain ( 'image/*' ) ;
89+ expect ( accept ) . not . toContain ( 'image/gif' ) ;
90+ expect ( accept ) . toContain ( 'audio/*' ) ;
91+ expect ( accept ) . toContain ( 'video/*' ) ;
92+ expect ( accept ) . toContain ( 'text/plain' ) ;
93+ expect ( accept ) . toContain ( 'application/pdf' ) ;
94+ expect ( accept ) . toContain ( 'application/json' ) ;
8295 expect ( accept ) . toContain ( '.3gpp' ) ;
96+ expect ( accept ) . toContain ( '.xls' ) ;
97+ expect ( accept ) . not . toContain ( 'application/x-pkcs12' ) ;
98+ expect ( accept ) . not . toContain ( 'application/pkcs12' ) ;
99+ expect ( accept ) . not . toContain ( '.pfx' ) ;
83100 } ) ;
84101
85102 it ( 'handles empty object parameter' , ( ) => {
0 commit comments