forked from cadence/out-of-your-element
Fix emoji_id references and add tests
This commit is contained in:
parent
9fbef15ad1
commit
e3b2c844d8
8 changed files with 77 additions and 19 deletions
21
d2m/converters/emoji-to-key.test.js
Normal file
21
d2m/converters/emoji-to-key.test.js
Normal file
|
@ -0,0 +1,21 @@
|
|||
// @ts-check
|
||||
|
||||
const {test} = require("supertape")
|
||||
const {emojiToKey} = require("./emoji-to-key")
|
||||
const data = require("../../test/data")
|
||||
const Ty = require("../../types")
|
||||
|
||||
test("emoji2key: unicode emoji works", async t => {
|
||||
const result = await emojiToKey({id: null, name: "🐈"})
|
||||
t.equal(result, "🐈")
|
||||
})
|
||||
|
||||
test("emoji2key: custom emoji works", async t => {
|
||||
const result = await emojiToKey({id: "230201364309868544", name: "hippo", animated: false})
|
||||
t.equal(result, "mxc://cadence.moe/qWmbXeRspZRLPcjseyLmeyXC")
|
||||
})
|
||||
|
||||
test("emoji2key: custom animated emoji works", async t => {
|
||||
const result = await emojiToKey({id: "393635038903926784", name: "hipposcope", animated: true})
|
||||
t.equal(result, "mxc://cadence.moe/WbYqNlACRuicynBfdnPYtmvc")
|
||||
})
|
Loading…
Add table
Add a link
Reference in a new issue