@@ -47,6 +47,7 @@ import {
4747 isExpensifyCard ,
4848 isExpensifyCardFullySetUp ,
4949 isMatchingCard ,
50+ isPersonalCard ,
5051 lastFourNumbersFromCardName ,
5152 maskCardNumber ,
5253 sortCardsByCardholderName ,
@@ -2139,6 +2140,47 @@ describe('CardUtils', () => {
21392140 } ) ;
21402141 } ) ;
21412142
2143+ describe ( 'PersonalCard (isPersonalCard)' , ( ) => {
2144+ it ( 'should return true when card has no fundID or fundID is "0"' , ( ) => {
2145+ const cardWithNoFundID : Card = {
2146+ accountID : 1 ,
2147+ bank : CONST . COMPANY_CARD . FEED_BANK_NAME . VISA ,
2148+ cardID : 1 ,
2149+ cardName : 'Personal Visa' ,
2150+ domainName : '' ,
2151+ fraud : 'none' ,
2152+ lastFourPAN : '1234' ,
2153+ lastScrape : '' ,
2154+ lastUpdated : '' ,
2155+ state : 3 ,
2156+ } ;
2157+ expect ( isPersonalCard ( cardWithNoFundID ) ) . toBe ( true ) ;
2158+
2159+ const cardWithZeroFundID : Card = {
2160+ ...cardWithNoFundID ,
2161+ fundID : '0' ,
2162+ } ;
2163+ expect ( isPersonalCard ( cardWithZeroFundID ) ) . toBe ( true ) ;
2164+ } ) ;
2165+
2166+ it ( 'should return true when card is CSV imported personal card (bank is PERSONAL_CARD.BANK_NAME.CSV)' , ( ) => {
2167+ const csvPersonalCard : Card = {
2168+ accountID : 1 ,
2169+ bank : CONST . PERSONAL_CARD . BANK_NAME . CSV ,
2170+ cardID : 2 ,
2171+ cardName : 'My Imported Card' ,
2172+ domainName : '' ,
2173+ fraud : 'none' ,
2174+ fundID : '1' ,
2175+ lastFourPAN : '5678' ,
2176+ lastScrape : '' ,
2177+ lastUpdated : '' ,
2178+ state : 3 ,
2179+ } ;
2180+ expect ( isPersonalCard ( csvPersonalCard ) ) . toBe ( true ) ;
2181+ } ) ;
2182+ } ) ;
2183+
21422184 describe ( 'isExpensifyCard' , ( ) => {
21432185 it ( 'should return true for Expensify Card' , ( ) => {
21442186 const card : Card = {
0 commit comments