File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -123,6 +123,26 @@ describe('Client', () => {
123123 } ) ;
124124 } ) ;
125125
126+ describe ( '.delete' , ( ) => {
127+ it ( 'should create a new request and call it' , ( ) => {
128+ let call = client . unauthenticatedRequest = jest . fn ( ) ;
129+ client . accessToken = { bearerToken : ( ) => {
130+ return { then : resolve => resolve ( 'token' ) } ;
131+ } } ;
132+ client . delete ( path , params ) ;
133+ expect ( call ) . toHaveBeenCalledWith ( 'DELETE' , path , params , 'token' ) ;
134+ } ) ;
135+
136+ it ( 'should work without params' , ( ) => {
137+ let call = client . unauthenticatedRequest = jest . fn ( ) ;
138+ client . accessToken = { bearerToken : ( ) => {
139+ return { then : resolve => resolve ( 'token' ) } ;
140+ } } ;
141+ client . delete ( path ) ;
142+ expect ( call ) . toHaveBeenCalledWith ( 'DELETE' , path , { } , 'token' ) ;
143+ } ) ;
144+ } ) ;
145+
126146 describe ( '.unauthenticatedRequest' , ( ) => {
127147 it ( 'should create a new request and call it' , ( ) => {
128148 client . accessToken . bearerToken = jest . fn ( ( ) => Promise . resolve ( 'data' ) ) ;
You can’t perform that action at this time.
0 commit comments