discourse/test/javascripts/acceptance/emoji-test.js.es6

54 lines
1.7 KiB
Plaintext
Raw Normal View History

2017-06-05 08:06:23 -04:00
import { acceptance } from "helpers/qunit-helpers";
acceptance("Emoji", { loggedIn: true });
2017-06-14 13:57:58 -04:00
QUnit.test("emoji is cooked properly", assert => {
2017-06-05 08:06:23 -04:00
visit("/t/internationalization-localization/280");
2018-06-15 11:03:24 -04:00
click("#topic-footer-buttons .btn.create");
2017-06-05 08:06:23 -04:00
2018-06-15 11:03:24 -04:00
fillIn(".d-editor-input", "this is an emoji :blonde_woman:");
2017-06-05 08:06:23 -04:00
andThen(() => {
2018-06-15 11:03:24 -04:00
assert.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>'
);
2017-06-05 08:06:23 -04:00
});
2018-06-15 11:03:24 -04:00
click("#reply-control .btn.create");
2017-06-05 08:06:23 -04:00
andThen(() => {
2018-06-15 11:03:24 -04:00
assert.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:">'
);
2017-06-05 08:06:23 -04:00
});
});
2017-06-14 13:57:58 -04:00
QUnit.test("skin toned emoji is cooked properly", assert => {
2017-06-05 08:06:23 -04:00
visit("/t/internationalization-localization/280");
2018-06-15 11:03:24 -04:00
click("#topic-footer-buttons .btn.create");
2017-06-05 08:06:23 -04:00
2018-06-15 11:03:24 -04:00
fillIn(".d-editor-input", "this is an emoji :blonde_woman:t5:");
2017-06-05 08:06:23 -04:00
andThen(() => {
2018-06-15 11:03:24 -04:00
assert.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>'
);
2017-06-05 08:06:23 -04:00
});
2018-06-15 11:03:24 -04:00
click("#reply-control .btn.create");
2017-06-05 08:06:23 -04:00
andThen(() => {
2018-06-15 11:03:24 -04:00
assert.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:">'
);
2017-06-05 08:06:23 -04:00
});
});