File tree Expand file tree Collapse file tree 2 files changed +11
-5
lines changed
examples/packages/notifications Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Original file line number Diff line number Diff line change 77 "url" : " https://github.com/MetaMask/snaps.git"
88 },
99 "source" : {
10- "shasum" : " jrOzxCG7RKSqVS0TPw4sZiUoB4A00AXqdfkA5iGJ94g =" ,
10+ "shasum" : " DV0AnwJKM1iKxKscfZOjr/y8qAKP0tdp8wU+2PBMxk8 =" ,
1111 "location" : {
1212 "npm" : {
1313 "filePath" : " dist/bundle.js" ,
Original file line number Diff line number Diff line change @@ -168,7 +168,7 @@ export const toRespondWithError: MatcherFunction<[expected: Json]> = function (
168168export const toSendNotification : MatcherFunction <
169169 [
170170 expectedMessage : string ,
171- expectedType : EnumToUnion < NotificationType > ,
171+ expectedType ? : EnumToUnion < NotificationType > ,
172172 expectedTitle ?: string | undefined ,
173173 expectedContent ?: JSXElement | undefined ,
174174 expectedFooterLink ?: { text : string ; href : string } | undefined ,
@@ -202,7 +202,7 @@ export const toSendNotification: MatcherFunction<
202202 return false ;
203203 }
204204
205- if ( type !== expectedType ) {
205+ if ( expectedType && type !== expectedType ) {
206206 return false ;
207207 }
208208
@@ -248,7 +248,11 @@ export const toSendNotification: MatcherFunction<
248248 expectedMessage ,
249249 ) } \n`;
250250
251- testMessage += `Expected type: ${ this . utils . printExpected ( expectedType ) } \n` ;
251+ if ( expectedType ) {
252+ testMessage += `Expected type: ${ this . utils . printExpected (
253+ expectedType ,
254+ ) } \n`;
255+ }
252256
253257 if ( title ) {
254258 testMessage += `Expected title: ${ this . utils . printExpected (
@@ -277,7 +281,9 @@ export const toSendNotification: MatcherFunction<
277281 notifMessage ,
278282 ) } \n`;
279283
280- testMessage += `Received type: ${ this . utils . printReceived ( type ) } \n` ;
284+ if ( expectedType ) {
285+ testMessage += `Received type: ${ this . utils . printReceived ( type ) } \n` ;
286+ }
281287
282288 if ( title ) {
283289 testMessage += `Received title: ${ this . utils . printReceived ( title ) } \n` ;
You can’t perform that action at this time.
0 commit comments