mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
33
test/javascripts/acceptance/emoji-test.js.es6
Normal file
33
test/javascripts/acceptance/emoji-test.js.es6
Normal file
@@ -0,0 +1,33 @@
|
||||
import { acceptance } from "helpers/qunit-helpers";
|
||||
|
||||
acceptance("Emoji", { loggedIn: true });
|
||||
|
||||
test("emoji is cooked properly", () => {
|
||||
visit("/t/internationalization-localization/280");
|
||||
click('#topic-footer-buttons .btn.create');
|
||||
|
||||
fillIn('.d-editor-input', "this is an emoji :blonde_woman:");
|
||||
andThen(() => {
|
||||
equal(find('.d-editor-preview:visible').html().trim(), "<p>this is an emoji <img src=\"/images/emoji/emoji_one/blonde_woman.png?v=5\" title=\":blonde_woman:\" class=\"emoji\" alt=\":blonde_woman:\"></p>");
|
||||
});
|
||||
|
||||
click('#reply-control .btn.create');
|
||||
andThen(() => {
|
||||
equal(find('.topic-post:last .cooked p').html().trim(), "this is an emoji <img src=\"/images/emoji/emoji_one/blonde_woman.png?v=5\" title=\":blonde_woman:\" class=\"emoji\" alt=\":blonde_woman:\">");
|
||||
});
|
||||
});
|
||||
|
||||
test("skin toned emoji is cooked properly", () => {
|
||||
visit("/t/internationalization-localization/280");
|
||||
click('#topic-footer-buttons .btn.create');
|
||||
|
||||
fillIn('.d-editor-input', "this is an emoji :blonde_woman:t5:");
|
||||
andThen(() => {
|
||||
equal(find('.d-editor-preview:visible').html().trim(), "<p>this is an emoji <img src=\"/images/emoji/emoji_one/blonde_woman/5.png?v=5\" title=\":blonde_woman:t5:\" class=\"emoji\" alt=\":blonde_woman:t5:\"></p>");
|
||||
});
|
||||
|
||||
click('#reply-control .btn.create');
|
||||
andThen(() => {
|
||||
equal(find('.topic-post:last .cooked p').html().trim(), "this is an emoji <img src=\"/images/emoji/emoji_one/blonde_woman/5.png?v=5\" title=\":blonde_woman:t5:\" class=\"emoji\" alt=\":blonde_woman:t5:\">");
|
||||
});
|
||||
});
|
||||
@@ -137,3 +137,16 @@ test("Reply as new message", () => {
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
test("Updating the topic title with emojis", () => {
|
||||
visit("/t/internationalization-localization/280");
|
||||
click('#topic-title .fa-pencil');
|
||||
|
||||
fillIn('#edit-title', 'emojis title :bike: :blonde_woman:t6:');
|
||||
|
||||
click('#topic-title .submit-edit');
|
||||
|
||||
andThen(() => {
|
||||
equal(find('.fancy-title').html().trim(), 'emojis title <img src=\"/images/emoji/emoji_one/bike.png?v=5\" title=\"bike\" alt=\"bike\" class=\"emoji\"> <img src=\"/images/emoji/emoji_one/blonde_woman/6.png?v=5\" title=\"blonde_woman:t6\" alt=\"blonde_woman:t6\" class=\"emoji\">', 'it displays the new title with emojis');
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user