mirror of
https://github.com/discourse/discourse.git
synced 2025-05-30 05:58:19 +08:00
FIX: Better emoji escaping for topic title
This commit also puts emojiVersion in its own erb file.
This commit is contained in:

committed by
Joffrey JAFFEUX

parent
135191d1d1
commit
35426b5ad6
@ -1,5 +1,5 @@
|
||||
import { acceptance } from "helpers/qunit-helpers";
|
||||
import { IMAGE_VERSION as v } from "pretty-text/emoji";
|
||||
import { IMAGE_VERSION as v } from "pretty-text/emoji/version";
|
||||
|
||||
acceptance("Topic", {
|
||||
loggedIn: true,
|
||||
@ -121,6 +121,23 @@ QUnit.test("Updating the topic title with emojis", async assert => {
|
||||
);
|
||||
});
|
||||
|
||||
QUnit.test("Updating the topic title with unicode emojis", async assert => {
|
||||
await visit("/t/internationalization-localization/280");
|
||||
await click("#topic-title .d-icon-pencil-alt");
|
||||
|
||||
await fillIn("#edit-title", "emojis title 👨🌾");
|
||||
|
||||
await click("#topic-title .submit-edit");
|
||||
|
||||
assert.equal(
|
||||
find(".fancy-title")
|
||||
.html()
|
||||
.trim(),
|
||||
`emojis title <img src="/images/emoji/emoji_one/man_farmer.png?v=${v}" title="man_farmer" alt="man_farmer" class="emoji">`,
|
||||
"it displays the new title with escaped unicode emojis"
|
||||
);
|
||||
});
|
||||
|
||||
acceptance("Topic featured links", {
|
||||
loggedIn: true,
|
||||
settings: {
|
||||
|
Reference in New Issue
Block a user