mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
fix: 🐛 broken emojis when wrap text (#6153)
* fix: 🐛 broken emojis when wrap text * refactor: Delete unnecessary "else" (reduce indentation) * fix: remove code block that causes the emojis to disappear * Apply suggestions from code review Co-authored-by: David Luzar <luzar.david@gmail.com> * fix: 🚑 possibly undefined value * Add spec Co-authored-by: David Luzar <luzar.david@gmail.com> Co-authored-by: Aakansha Doshi <aakansha1216@gmail.com>
This commit is contained in:
parent
cf38c0f933
commit
b52c8943e4
2 changed files with 85 additions and 73 deletions
|
@ -12,6 +12,20 @@ describe("Test wrapText", () => {
|
|||
expect(res).toBe("Hello whats up ");
|
||||
});
|
||||
|
||||
it("should work with emojis", () => {
|
||||
const text = "😀";
|
||||
const maxWidth = 1;
|
||||
const res = wrapText(text, font, maxWidth);
|
||||
expect(res).toBe("😀");
|
||||
});
|
||||
|
||||
it("should show the text correctly when min width reached", () => {
|
||||
const text = "Hello😀";
|
||||
const maxWidth = 10;
|
||||
const res = wrapText(text, font, maxWidth);
|
||||
expect(res).toBe("H\ne\nl\nl\no\n😀");
|
||||
});
|
||||
|
||||
describe("When text doesn't contain new lines", () => {
|
||||
const text = "Hello whats up";
|
||||
[
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue