uses emoji version for tests (#6277)

This commit is contained in:
Joffrey JAFFEUX 2018-08-16 14:06:56 +02:00 committed by GitHub
parent 10a3499d68
commit edf26a0931
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 5 deletions

View File

@ -1,3 +1,4 @@
import { IMAGE_VERSION as v } from "pretty-text/emoji";
import { acceptance } from "helpers/qunit-helpers"; import { acceptance } from "helpers/qunit-helpers";
acceptance("Emoji", { loggedIn: true }); acceptance("Emoji", { loggedIn: true });
@ -11,7 +12,7 @@ QUnit.test("emoji is cooked properly", async assert => {
find(".d-editor-preview:visible") find(".d-editor-preview:visible")
.html() .html()
.trim(), .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>' `<p>this is an emoji <img src="/images/emoji/emoji_one/blonde_woman.png?v=${v}" title=":blonde_woman:" class="emoji" alt=":blonde_woman:"></p>`
); );
await click("#reply-control .btn.create"); await click("#reply-control .btn.create");
@ -19,7 +20,7 @@ QUnit.test("emoji is cooked properly", async assert => {
find(".topic-post:last .cooked p") find(".topic-post:last .cooked p")
.html() .html()
.trim(), .trim(),
'this is an emoji <img src="/images/emoji/emoji_one/blonde_woman.png?v=5" title=":blonde_woman:" class="emoji" alt=":blonde_woman:">' `this is an emoji <img src="/images/emoji/emoji_one/blonde_woman.png?v=${v}" title=":blonde_woman:" class="emoji" alt=":blonde_woman:">`
); );
}); });
@ -32,7 +33,7 @@ QUnit.test("skin toned emoji is cooked properly", async assert => {
find(".d-editor-preview:visible") find(".d-editor-preview:visible")
.html() .html()
.trim(), .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>' `<p>this is an emoji <img src="/images/emoji/emoji_one/blonde_woman/5.png?v=${v}" title=":blonde_woman:t5:" class="emoji" alt=":blonde_woman:t5:"></p>`
); );
await click("#reply-control .btn.create"); await click("#reply-control .btn.create");
@ -40,6 +41,6 @@ QUnit.test("skin toned emoji is cooked properly", async assert => {
find(".topic-post:last .cooked p") find(".topic-post:last .cooked p")
.html() .html()
.trim(), .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:">' `this is an emoji <img src="/images/emoji/emoji_one/blonde_woman/5.png?v=${v}" title=":blonde_woman:t5:" class="emoji" alt=":blonde_woman:t5:">`
); );
}); });

View File

@ -1,4 +1,6 @@
import { acceptance } from "helpers/qunit-helpers"; import { acceptance } from "helpers/qunit-helpers";
import { IMAGE_VERSION as v } from "pretty-text/emoji";
acceptance("Topic", { acceptance("Topic", {
loggedIn: true, loggedIn: true,
pretend(server, helper) { pretend(server, helper) {
@ -181,7 +183,7 @@ QUnit.test("Updating the topic title with emojis", async assert => {
find(".fancy-title") find(".fancy-title")
.html() .html()
.trim(), .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">', `emojis title <img src="/images/emoji/emoji_one/bike.png?v=${v}" title="bike" alt="bike" class="emoji"> <img src="/images/emoji/emoji_one/blonde_woman/6.png?v=${v}" title="blonde_woman:t6" alt="blonde_woman:t6" class="emoji">`,
"it displays the new title with emojis" "it displays the new title with emojis"
); );
}); });