Skip to content

Commit 4d8d095

Browse files
committed
test: RT-253 proper src attribute for images
1 parent f8fc462 commit 4d8d095

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

test/toRedactor.test.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -222,8 +222,15 @@ describe("Testing json to html conversion", () => {
222222
let jsonValue = expectedValue["fix_EB-745"].expectedJson
223223

224224
let htmlValue = toRedactor(jsonValue)
225-
let testResult = isEqual(htmlValue, expectedValue["fix_EB-745"].html)
226-
expect(testResult).toBe(true)
225+
expect(htmlValue).toBe(expectedValue["fix_EB-745"].html)
227226
})
227+
228+
test("RT-253 - should convert to proper HTML image code", () => {
229+
const json = {"type":"doc","attrs":{},"children":[{"type":"img","attrs":{"url":"https://picsum.photos/200","width":100},"children":[{"text":""}]}],"_version":3 }
230+
const html = toRedactor(json);
231+
console.log(html)
232+
expect(html).toBe('<img width="100" src="https://picsum.photos/200"/>');
233+
});
228234

229-
})
235+
})
236+

0 commit comments

Comments
 (0)