File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
src/LiveComponent/assets/test Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -240,9 +240,19 @@ class MockedAjaxCall {
240
240
const params = new URLSearchParams ( {
241
241
data : JSON . stringify ( this . expectedSentData )
242
242
} ) ;
243
- matcherObject . url = `end:?${ params . toString ( ) } ` ;
243
+ matcherObject . functionMatcher = ( url : string ) => {
244
+ return url . includes ( `?${ params . toString ( ) } ` ) ;
245
+ } ;
244
246
} else {
245
- matcherObject . body = this . getRequestBody ( ) ;
247
+ // match the body, by without "updatedModels" which is not important
248
+ // and also difficult/tedious to always assert
249
+ matcherObject . functionMatcher = ( url : string , request : any ) => {
250
+ const body = JSON . parse ( request . body ) ;
251
+ delete body . updatedModels ;
252
+
253
+ return JSON . stringify ( body ) === JSON . stringify ( this . getRequestBody ( ) ) ;
254
+ } ;
255
+
246
256
if ( this . expectedActions . length === 1 ) {
247
257
matcherObject . url = `end:/${ this . expectedActions [ 0 ] . name } ` ;
248
258
} else if ( this . expectedActions . length > 1 ) {
You can’t perform that action at this time.
0 commit comments