feat(repocard): parse emojis in description (#67)

* feat: add remove_emojis option

Removes emojis in repo card description

* feat: parse emojis

* feat: rename remove_emojis to show_emojis option for consistency

* docs: update docs

Co-authored-by: anuraghazra <hazru.anurag@gmail.com>
This commit is contained in:
Mario Lubenka
2020-07-24 15:26:26 +02:00
committed by GitHub
parent 7973805cf7
commit 3a9ded0a09
4 changed files with 23 additions and 3 deletions

View File

@ -73,6 +73,18 @@ describe("Test renderRepoCard", () => {
);
});
it("should render emojis", () => {
document.body.innerHTML = renderRepoCard({
...data_repo.repository,
description: "This is a text with a :poop: poo emoji",
});
// poop emoji may not show in all editors but it's there between "a" and "poo"
expect(document.getElementsByClassName("description")[0]).toHaveTextContent(
"This is a text with a 💩 poo emoji"
);
});
it("should shift the text position depending on language length", () => {
document.body.innerHTML = renderRepoCard({
...data_repo.repository,