@@ -18,6 +18,7 @@ import type {
1818 QuickBooksEmailTransactionParams ,
1919 QuickBooksReadAttachmentsParams ,
2020} from '@/tools/quickbooks/types'
21+ import { QUICKBOOKS_EMAILABLE_TRANSACTION_PROPERTIES } from '@/tools/quickbooks/types'
2122
2223const auth = { accessToken : 'access-token' , realmId : '123456789' }
2324
@@ -88,6 +89,31 @@ describe('QuickBooks document tools', () => {
8889 } ,
8990 } )
9091 } )
92+
93+ it ( 'advertises one optional sales and purchasing transaction output superset' , ( ) => {
94+ const record = quickbooksEmailTransactionTool . outputs ?. record
95+ expect ( record ?. properties ) . toBe ( QUICKBOOKS_EMAILABLE_TRANSACTION_PROPERTIES )
96+ expect ( record ?. properties ) . toMatchObject ( {
97+ CustomerRef : { optional : true } ,
98+ ExpirationDate : { optional : true } ,
99+ VendorRef : { optional : true } ,
100+ APAccountRef : { optional : true } ,
101+ POStatus : { optional : true } ,
102+ LinkedTxn : { optional : true } ,
103+ } )
104+ expect ( record ?. properties ?. Line ) . toMatchObject ( {
105+ optional : true ,
106+ items : {
107+ properties : {
108+ SalesItemLineDetail : { optional : true } ,
109+ AccountBasedExpenseLineDetail : { optional : true } ,
110+ ItemBasedExpenseLineDetail : { optional : true } ,
111+ } ,
112+ } ,
113+ } )
114+ expect ( record ?. properties ?. Id . optional ) . not . toBe ( true )
115+ expect ( record ?. properties ?. CustomerRef . optional ) . toBe ( true )
116+ } )
91117} )
92118
93119describe ( 'QuickBooks attachment metadata reads' , ( ) => {
0 commit comments