From 74f01c429a251cfb4fb5cf2d2cd804f572eb9898 Mon Sep 17 00:00:00 2001 From: Barbara Valdez <34872381+barbaravaldez@users.noreply.github.com> Date: Wed, 29 Jun 2022 14:13:54 -0700 Subject: [PATCH] Add more tests to cell image attachments (#19851) * add more tests to cell image attachments * remove cell attachment image name with spaces test --- .../contrib/notebook/test/browser/notebookMarkdown.test.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/sql/workbench/contrib/notebook/test/browser/notebookMarkdown.test.ts b/src/sql/workbench/contrib/notebook/test/browser/notebookMarkdown.test.ts index 0e559fb6e9..6f3a2d3237 100644 --- a/src/sql/workbench/contrib/notebook/test/browser/notebookMarkdown.test.ts +++ b/src/sql/workbench/contrib/notebook/test/browser/notebookMarkdown.test.ts @@ -110,6 +110,12 @@ suite('NotebookMarkdownRenderer', () => { result = notebookMarkdownRenderer.renderMarkdown({ value: `![altText](attachment:ads.png)`, isTrusted: true }, { cellAttachments: JSON.parse('{"ads2.png":"image/png"}') }); assert.strictEqual(result.innerHTML, `

altText

`, 'Cell attachment no image data failed'); + + result = notebookMarkdownRenderer.renderMarkdown({ value: `![altText](attachment:ads.jpg)`, isTrusted: true }, { cellAttachments: JSON.parse('{"ads.jpg":{"image/jpeg":"iVBORw0KGgoAAAANSUhEUgAAAggg=="}}') }); + assert.strictEqual(result.innerHTML, `

altText

`, 'Cell attachment jpg image data failed'); + + result = notebookMarkdownRenderer.renderMarkdown({ value: `![altText](attachment:ads!@#$%^&.jpg)`, isTrusted: true }, { cellAttachments: JSON.parse('{"ads!@#$%^&.jpg":{"image/jpeg":"iVBORw0KGgoAAAANSUhEUgAAAggg=="}}') }); + assert.strictEqual(result.innerHTML, `

altText

`, 'Cell attachment image name with symbols failed'); }); suite('Schema validation', function () {