Skip to content

Commit 9176886

Browse files
Add another test
1 parent b2c31c1 commit 9176886

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

packages/snaps-controllers/src/snaps/registry/json.test.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff 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(

0 commit comments

Comments
 (0)