diff --git a/packages/examples/packages/images/snap.manifest.json b/packages/examples/packages/images/snap.manifest.json
index d071ce7856..f0c0c2e667 100644
--- a/packages/examples/packages/images/snap.manifest.json
+++ b/packages/examples/packages/images/snap.manifest.json
@@ -7,7 +7,7 @@
"url": "https://github.com/MetaMask/snaps.git"
},
"source": {
- "shasum": "UKBWUM+VMGi3YPuP2zhT3fpfB5MgN7muuU2MBaW5964=",
+ "shasum": "6hmcWrwBG05b5UlKIzJppBhfqqi+C/YxFSQgJrFjh64=",
"location": {
"npm": {
"filePath": "dist/bundle.js",
diff --git a/packages/examples/packages/images/src/images/icon.png b/packages/examples/packages/images/src/images/icon.png
new file mode 100644
index 0000000000..080a3b8477
Binary files /dev/null and b/packages/examples/packages/images/src/images/icon.png differ
diff --git a/packages/examples/packages/images/src/images/icon.svg b/packages/examples/packages/images/src/images/icon.svg
new file mode 100644
index 0000000000..5dc14b4dc1
--- /dev/null
+++ b/packages/examples/packages/images/src/images/icon.svg
@@ -0,0 +1,5 @@
+
diff --git a/packages/examples/packages/images/src/index.test.ts b/packages/examples/packages/images/src/index.test.ts
index eae8ddbd78..f398bcf39a 100644
--- a/packages/examples/packages/images/src/index.test.ts
+++ b/packages/examples/packages/images/src/index.test.ts
@@ -26,7 +26,7 @@ describe('onRpcRequest', () => {
describe('getQrCode', () => {
it('generates a QR code for the given data', async () => {
- const { request, close } = await installSnap();
+ const { request } = await installSnap();
const response = request({
method: 'getQrCode',
@@ -46,16 +46,14 @@ describe('onRpcRequest', () => {
await ui.ok();
expect(await response).toRespondWith(null);
-
- await close();
});
});
describe('getCat', () => {
- // This test is flaky so we disable it for now
+ // This test is flaky, so we disable it for now.
// eslint-disable-next-line jest/no-disabled-tests
it.skip('shows a cat', async () => {
- const { request, close } = await installSnap();
+ const { request } = await installSnap();
const response = request({
method: 'getCat',
@@ -84,8 +82,66 @@ describe('onRpcRequest', () => {
await ui.ok();
expect(await response).toRespondWith(null);
+ });
+ });
+
+ describe('getSvgIcon', () => {
+ it('shows an SVG icon', async () => {
+ const { request } = await installSnap();
+
+ const response = request({
+ method: 'getSvgIcon',
+ });
+
+ const ui = await response.getInterface();
+ // eslint-disable-next-line jest/prefer-strict-equal
+ expect(ui.content).toEqual({
+ type: 'panel',
+ children: [
+ {
+ type: 'text',
+ value: 'Here is an SVG icon:',
+ },
+ {
+ type: 'image',
+ value: expect.stringContaining('