2019-03-15 12:44:49 +08:00
import { IMAGE _VERSION as v } from "pretty-text/emoji/version" ;
2017-06-05 20:06:23 +08:00
import { acceptance } from "helpers/qunit-helpers" ;
acceptance ( "Emoji" , { loggedIn : true } ) ;
2018-07-19 18:11:18 +08:00
QUnit . test ( "emoji is cooked properly" , async ( assert ) => {
await visit ( "/t/internationalization-localization/280" ) ;
await click ( "#topic-footer-buttons .btn.create" ) ;
2017-06-05 20:06:23 +08:00
2018-07-19 18:11:18 +08:00
await fillIn ( ".d-editor-input" , "this is an emoji :blonde_woman:" ) ;
assert . equal (
find ( ".d-editor-preview:visible" ) . html ( ) . trim ( ) ,
2018-08-16 20:06:56 +08:00
` <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> `
2018-07-19 18:11:18 +08:00
) ;
2017-06-05 20:06:23 +08:00
} ) ;
2018-07-19 18:11:18 +08:00
QUnit . test ( "skin toned emoji is cooked properly" , async ( assert ) => {
await visit ( "/t/internationalization-localization/280" ) ;
await click ( "#topic-footer-buttons .btn.create" ) ;
2017-06-05 20:06:23 +08:00
2018-07-19 18:11:18 +08:00
await fillIn ( ".d-editor-input" , "this is an emoji :blonde_woman:t5:" ) ;
assert . equal (
find ( ".d-editor-preview:visible" ) . html ( ) . trim ( ) ,
2018-08-16 20:06:56 +08:00
` <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> `
2018-07-19 18:11:18 +08:00
) ;
2017-06-05 20:06:23 +08:00
} ) ;