File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
packages/snaps-controllers/src/snaps/registry Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -468,6 +468,23 @@ describe('JsonSnapsRegistry', () => {
468468 expect ( result ) . toBe ( '1.0.0' ) ;
469469 } ) ;
470470
471+ it ( 'resolves to the latest allowlisted version if compatible' , async ( ) => {
472+ fetchMock
473+ . mockResponseOnce ( JSON . stringify ( MOCK_DATABASE_COMPATIBILITY ) )
474+ . mockResponseOnce ( JSON . stringify ( MOCK_COMPATIBILITY_SIGNATURE_FILE ) ) ;
475+
476+ const { messenger } = getRegistry ( {
477+ clientConfig : { type : 'extension' , version : '15.0.0' as SemVerVersion } ,
478+ } ) ;
479+ const result = await messenger . call (
480+ 'SnapsRegistry:resolveVersion' ,
481+ MOCK_SNAP_ID ,
482+ '^1.0.0' as SemVerRange ,
483+ ) ;
484+
485+ expect ( result ) . toBe ( '1.1.0' ) ;
486+ } ) ;
487+
471488 it ( 'returns version range if snap is not on the allowlist' , async ( ) => {
472489 fetchMock
473490 . mockResponseOnce (
You can’t perform that action at this time.
0 commit comments