@@ -34,12 +34,14 @@ describe('snap_setState', () => {
3434 const updateSnapState = jest . fn ( ) . mockReturnValue ( null ) ;
3535 const getUnlockPromise = jest . fn ( ) . mockResolvedValue ( undefined ) ;
3636 const hasPermission = jest . fn ( ) . mockReturnValue ( true ) ;
37+ const getSnap = jest . fn ( ) . mockReturnValue ( { preinstalled : false } ) ;
3738
3839 const hooks = {
3940 getSnapState,
4041 updateSnapState,
4142 getUnlockPromise,
4243 hasPermission,
44+ getSnap,
4345 } ;
4446
4547 const engine = new JsonRpcEngine ( ) ;
@@ -87,12 +89,14 @@ describe('snap_setState', () => {
8789 const updateSnapState = jest . fn ( ) . mockReturnValue ( null ) ;
8890 const getUnlockPromise = jest . fn ( ) . mockResolvedValue ( undefined ) ;
8991 const hasPermission = jest . fn ( ) . mockReturnValue ( true ) ;
92+ const getSnap = jest . fn ( ) . mockReturnValue ( { preinstalled : false } ) ;
9093
9194 const hooks = {
9295 getSnapState,
9396 updateSnapState,
9497 getUnlockPromise,
9598 hasPermission,
99+ getSnap,
96100 } ;
97101
98102 const engine = new JsonRpcEngine ( ) ;
@@ -141,12 +145,14 @@ describe('snap_setState', () => {
141145 const updateSnapState = jest . fn ( ) . mockReturnValue ( null ) ;
142146 const getUnlockPromise = jest . fn ( ) . mockResolvedValue ( undefined ) ;
143147 const hasPermission = jest . fn ( ) . mockReturnValue ( true ) ;
148+ const getSnap = jest . fn ( ) . mockReturnValue ( { preinstalled : false } ) ;
144149
145150 const hooks = {
146151 getSnapState,
147152 updateSnapState,
148153 getUnlockPromise,
149154 hasPermission,
155+ getSnap,
150156 } ;
151157
152158 const engine = new JsonRpcEngine ( ) ;
@@ -200,12 +206,14 @@ describe('snap_setState', () => {
200206 const updateSnapState = jest . fn ( ) . mockReturnValue ( null ) ;
201207 const getUnlockPromise = jest . fn ( ) . mockResolvedValue ( undefined ) ;
202208 const hasPermission = jest . fn ( ) . mockReturnValue ( false ) ;
209+ const getSnap = jest . fn ( ) . mockReturnValue ( { preinstalled : false } ) ;
203210
204211 const hooks = {
205212 getSnapState,
206213 updateSnapState,
207214 getUnlockPromise,
208215 hasPermission,
216+ getSnap,
209217 } ;
210218
211219 const engine = new JsonRpcEngine ( ) ;
@@ -252,12 +260,14 @@ describe('snap_setState', () => {
252260 const updateSnapState = jest . fn ( ) . mockReturnValue ( null ) ;
253261 const getUnlockPromise = jest . fn ( ) . mockResolvedValue ( undefined ) ;
254262 const hasPermission = jest . fn ( ) . mockReturnValue ( true ) ;
263+ const getSnap = jest . fn ( ) . mockReturnValue ( { preinstalled : false } ) ;
255264
256265 const hooks = {
257266 getSnapState,
258267 updateSnapState,
259268 getUnlockPromise,
260269 hasPermission,
270+ getSnap,
261271 } ;
262272
263273 const engine = new JsonRpcEngine ( ) ;
@@ -303,12 +313,14 @@ describe('snap_setState', () => {
303313 const updateSnapState = jest . fn ( ) . mockReturnValue ( null ) ;
304314 const getUnlockPromise = jest . fn ( ) . mockResolvedValue ( undefined ) ;
305315 const hasPermission = jest . fn ( ) . mockReturnValue ( true ) ;
316+ const getSnap = jest . fn ( ) . mockReturnValue ( { preinstalled : false } ) ;
306317
307318 const hooks = {
308319 getSnapState,
309320 updateSnapState,
310321 getUnlockPromise,
311322 hasPermission,
323+ getSnap,
312324 } ;
313325
314326 const engine = new JsonRpcEngine ( ) ;
@@ -358,12 +370,14 @@ describe('snap_setState', () => {
358370 const updateSnapState = jest . fn ( ) . mockReturnValue ( null ) ;
359371 const getUnlockPromise = jest . fn ( ) . mockResolvedValue ( undefined ) ;
360372 const hasPermission = jest . fn ( ) . mockReturnValue ( true ) ;
373+ const getSnap = jest . fn ( ) . mockReturnValue ( { preinstalled : false } ) ;
361374
362375 const hooks = {
363376 getSnapState,
364377 updateSnapState,
365378 getUnlockPromise,
366379 hasPermission,
380+ getSnap,
367381 } ;
368382
369383 const engine = new JsonRpcEngine ( ) ;
@@ -408,12 +422,14 @@ describe('snap_setState', () => {
408422 const updateSnapState = jest . fn ( ) . mockReturnValue ( null ) ;
409423 const getUnlockPromise = jest . fn ( ) . mockResolvedValue ( undefined ) ;
410424 const hasPermission = jest . fn ( ) . mockReturnValue ( true ) ;
425+ const getSnap = jest . fn ( ) . mockReturnValue ( { preinstalled : false } ) ;
411426
412427 const hooks = {
413428 getSnapState,
414429 updateSnapState,
415430 getUnlockPromise,
416431 hasPermission,
432+ getSnap,
417433 } ;
418434
419435 const engine = new JsonRpcEngine ( ) ;
@@ -461,12 +477,14 @@ describe('snap_setState', () => {
461477 const updateSnapState = jest . fn ( ) . mockReturnValue ( null ) ;
462478 const getUnlockPromise = jest . fn ( ) . mockResolvedValue ( undefined ) ;
463479 const hasPermission = jest . fn ( ) . mockReturnValue ( true ) ;
480+ const getSnap = jest . fn ( ) . mockReturnValue ( { preinstalled : false } ) ;
464481
465482 const hooks = {
466483 getSnapState,
467484 updateSnapState,
468485 getUnlockPromise,
469486 hasPermission,
487+ getSnap,
470488 } ;
471489
472490 const engine = new JsonRpcEngine ( ) ;
0 commit comments