Skip to content

Commit 85e2522

Browse files
committed
Add verifyUrlOrCreateDataUrl Unicode test
1 parent b9328ba commit 85e2522

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

packages/wrapper/test/editorApp.test.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,14 @@ describe('Test EditorApp', () => {
2828
expect(verifyUrlOrCreateDataUrl(text)).toBe(`data:text/plain;base64,${base64}`);
2929
});
3030

31+
test('verifyUrlorCreateDataUrl: url', () => {
32+
const text = '✓✓';
33+
const bytes = new TextEncoder().encode(text);
34+
const binString = Array.from(bytes, (b) => String.fromCodePoint(b)).join('');
35+
const base64 = btoa(binString);
36+
expect(verifyUrlOrCreateDataUrl(text)).toBe(`data:text/plain;base64,${base64}`);
37+
});
38+
3139
test('config defaults', () => {
3240
const wrapperConfig = createWrapperConfigExtendedApp();
3341
const app = new EditorApp(wrapperConfig.$type, wrapperConfig.editorAppConfig);

0 commit comments

Comments
 (0)