Skip to content

Commit

Permalink
added a test to ensure Unicode/Emoji support
Browse files Browse the repository at this point in the history
  • Loading branch information
ignacionr committed Jun 25, 2018
1 parent 319b33d commit 9e7e9d1
Showing 1 changed file with 21 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,25 @@
import {TextBlock} from "../../card-elements";
import {AdaptiveCard,TextBlock} from "../../card-elements";

test('TextBlock should be instantiated', ()=>{
const textBlock = new TextBlock();
expect(textBlock).toEqual(expect.anything());
})
})

const emoji_message = "Mix 🗣 emoji inside 🙌 text";
const simple_test_card = {
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"type": "AdaptiveCard",
"version": "1.0",
"body": [{
"type": "TextBlock",
"text": emoji_message
}]
};

test('TextBlock should allow for Unicode chars including Emoji', ()=>{
const ac = new AdaptiveCard();
ac.parse(simple_test_card);
const result = ac.render();
const text = result.textContent.trim();
expect(text).toEqual(emoji_message);
});

0 comments on commit 9e7e9d1

Please sign in to comment.