@@ -876,132 +876,4 @@ describe('PerDiem', () => {
876876 expect ( perDiemTransactions . length ) . toBeGreaterThan ( 0 ) ;
877877 } ) ;
878878 } ) ;
879-
880- describe ( 'submitPerDiemExpense with conciergeReportID' , ( ) => {
881- it ( 'should accept conciergeReportID and submit per diem expense successfully' , async ( ) => {
882- const iouReportID = '2' ;
883- const policyID = 'B' ;
884-
885- await Onyx . merge ( `${ ONYXKEYS . COLLECTION . REPORT } ${ iouReportID } ` , {
886- reportID : iouReportID ,
887- policyID,
888- type : CONST . REPORT . TYPE . EXPENSE ,
889- ownerAccountID : currentUserPersonalDetails . accountID ,
890- } ) ;
891-
892- submitPerDiemExpense ( {
893- currentUserAccountIDParam : currentUserPersonalDetails . accountID ,
894- currentUserEmailParam : currentUserPersonalDetails . login ?? '' ,
895- hasViolations : false ,
896- isASAPSubmitBetaEnabled : false ,
897- participantParams : {
898- payeeEmail : currentUserPersonalDetails . login ,
899- payeeAccountID : currentUserPersonalDetails . accountID ,
900- participant : { } ,
901- } ,
902- report : {
903- reportID : '1' ,
904- iouReportID,
905- } ,
906- transactionParams : {
907- created : DateUtils . getDBTime ( ) ,
908- currency : CONST . CURRENCY . USD ,
909- customUnit : {
910- customUnitID : 'A' ,
911- name : CONST . CUSTOM_UNITS . NAME_PER_DIEM_INTERNATIONAL ,
912- customUnitRateID : 'B' ,
913- subRates : [ { id : '1' , name : 'rate_a' , quantity : 1 , rate : 2 } ] ,
914- attributes : { dates : { end : '' , start : '' } } ,
915- } ,
916- } ,
917- policyRecentlyUsedCurrencies : [ ] ,
918- policyParams : {
919- policy : { ...createRandomPolicy ( 1 ) } ,
920- } ,
921- quickAction : undefined ,
922- betas : [ CONST . BETAS . ALL ] ,
923- personalDetails : { [ RORY_ACCOUNT_ID ] : { accountID : RORY_ACCOUNT_ID , login : RORY_EMAIL } } ,
924- conciergeReportID : 'concierge789' ,
925- } ) ;
926-
927- await waitForBatchedUpdates ( ) ;
928-
929- const transactions = await new Promise < OnyxCollection < Transaction > > ( ( resolve ) => {
930- const connection = Onyx . connect ( {
931- key : ONYXKEYS . COLLECTION . TRANSACTION ,
932- waitForCollectionCallback : true ,
933- callback : ( value ) => {
934- Onyx . disconnect ( connection ) ;
935- resolve ( value ) ;
936- } ,
937- } ) ;
938- } ) ;
939-
940- const perDiemTransactions = Object . values ( transactions ?? { } ) . filter ( ( tx ) => tx ?. iouRequestType === CONST . IOU . REQUEST_TYPE . PER_DIEM ) ;
941- expect ( perDiemTransactions . length ) . toBeGreaterThan ( 0 ) ;
942- } ) ;
943-
944- it ( 'should work when conciergeReportID is undefined' , async ( ) => {
945- const iouReportID = '2' ;
946- const policyID = 'B' ;
947-
948- await Onyx . merge ( `${ ONYXKEYS . COLLECTION . REPORT } ${ iouReportID } ` , {
949- reportID : iouReportID ,
950- policyID,
951- type : CONST . REPORT . TYPE . EXPENSE ,
952- ownerAccountID : currentUserPersonalDetails . accountID ,
953- } ) ;
954-
955- submitPerDiemExpense ( {
956- currentUserAccountIDParam : currentUserPersonalDetails . accountID ,
957- currentUserEmailParam : currentUserPersonalDetails . login ?? '' ,
958- hasViolations : false ,
959- isASAPSubmitBetaEnabled : false ,
960- participantParams : {
961- payeeEmail : currentUserPersonalDetails . login ,
962- payeeAccountID : currentUserPersonalDetails . accountID ,
963- participant : { } ,
964- } ,
965- report : {
966- reportID : '1' ,
967- iouReportID,
968- } ,
969- transactionParams : {
970- created : DateUtils . getDBTime ( ) ,
971- currency : CONST . CURRENCY . USD ,
972- customUnit : {
973- customUnitID : 'A' ,
974- name : CONST . CUSTOM_UNITS . NAME_PER_DIEM_INTERNATIONAL ,
975- customUnitRateID : 'B' ,
976- subRates : [ { id : '1' , name : 'rate_a' , quantity : 1 , rate : 2 } ] ,
977- attributes : { dates : { end : '' , start : '' } } ,
978- } ,
979- } ,
980- policyRecentlyUsedCurrencies : [ ] ,
981- policyParams : {
982- policy : { ...createRandomPolicy ( 1 ) } ,
983- } ,
984- quickAction : undefined ,
985- betas : [ CONST . BETAS . ALL ] ,
986- personalDetails : { [ RORY_ACCOUNT_ID ] : { accountID : RORY_ACCOUNT_ID , login : RORY_EMAIL } } ,
987- conciergeReportID : undefined ,
988- } ) ;
989-
990- await waitForBatchedUpdates ( ) ;
991-
992- const transactions = await new Promise < OnyxCollection < Transaction > > ( ( resolve ) => {
993- const connection = Onyx . connect ( {
994- key : ONYXKEYS . COLLECTION . TRANSACTION ,
995- waitForCollectionCallback : true ,
996- callback : ( value ) => {
997- Onyx . disconnect ( connection ) ;
998- resolve ( value ) ;
999- } ,
1000- } ) ;
1001- } ) ;
1002-
1003- const perDiemTransactions = Object . values ( transactions ?? { } ) . filter ( ( tx ) => tx ?. iouRequestType === CONST . IOU . REQUEST_TYPE . PER_DIEM ) ;
1004- expect ( perDiemTransactions . length ) . toBeGreaterThan ( 0 ) ;
1005- } ) ;
1006- } ) ;
1007879} ) ;
0 commit comments