diff --git a/apps/editor/src/__test__/unit/markdown/mdCommand.spec.ts b/apps/editor/src/__test__/unit/markdown/mdCommand.spec.ts index 4fb9bc0f49..aeb81cef87 100644 --- a/apps/editor/src/__test__/unit/markdown/mdCommand.spec.ts +++ b/apps/editor/src/__test__/unit/markdown/mdCommand.spec.ts @@ -292,6 +292,17 @@ describe('addImage command', () => { expect(getTextContent(mde)).toBe('![image](myurl%20%28%29%5B%5D%3C%3E)'); }); + + it('should not decode url which is already encoded', () => { + cmd.exec('addImage', { + altText: 'image', + imageUrl: 'https://firebasestorage.googleapis.com/images%2Fimage.png?alt=media', + }); + + expect(getTextContent(mde)).toBe( + '![image](https://firebasestorage.googleapis.com/images%2Fimage.png?alt=media)' + ); + }); }); describe('addLink command', () => { @@ -318,6 +329,17 @@ describe('addLink command', () => { expect(getTextContent(mde)).toBe('[TOAST UI](myurl%20%28%29%5B%5D%3C%3E)'); }); + + it('should not decode url which is already encoded', () => { + cmd.exec('addLink', { + linkText: 'TOAST UI', + linkUrl: 'https://firebasestorage.googleapis.com/links%2Fimage.png?alt=media', + }); + + expect(getTextContent(mde)).toBe( + '[TOAST UI](https://firebasestorage.googleapis.com/links%2Fimage.png?alt=media)' + ); + }); }); describe('heading command', () => { diff --git a/apps/editor/src/__test__/unit/wysiwyg/wwCommand.spec.ts b/apps/editor/src/__test__/unit/wysiwyg/wwCommand.spec.ts index 73bf45daac..3b6bcb6119 100644 --- a/apps/editor/src/__test__/unit/wysiwyg/wwCommand.spec.ts +++ b/apps/editor/src/__test__/unit/wysiwyg/wwCommand.spec.ts @@ -484,14 +484,14 @@ describe('wysiwyg commands', () => { expect(wwe.getHTML()).toBe('