summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorotofune <otofune@gmail.com>2017-03-01 03:15:45 +0000
committerotofune <otofune@gmail.com>2017-03-01 03:19:50 +0000
commite9284a797d486ceb9fabe33437c101ad0f5ae6e5 (patch)
tree8a2c7079ff24a326dd19e7666c01e58318c9dff4
parent[common] text & [web] common > scripts > text compiler: support emoji (diff)
downloadmisskey-e9284a797d486ceb9fabe33437c101ad0f5ae6e5.tar.gz
misskey-e9284a797d486ceb9fabe33437c101ad0f5ae6e5.tar.bz2
misskey-e9284a797d486ceb9fabe33437c101ad0f5ae6e5.zip
[test] add emoji test
-rw-r--r--test/text.ts11
1 files changed, 10 insertions, 1 deletions
diff --git a/test/text.ts b/test/text.ts
index 64247953bf..8a210575d9 100644
--- a/test/text.ts
+++ b/test/text.ts
@@ -9,10 +9,12 @@ const syntaxhighlighter = require('../src/common/text/core/syntax-highlighter');
describe('Text', () => {
it('is correctly analyzed', () => {
- const tokens = analyze('@himawari お腹ペコい #yryr');
+ const tokens = analyze('@himawari お腹ペコい :cat: #yryr');
assert.deepEqual([
{ type: 'mention', content: '@himawari', username: 'himawari' },
{ type: 'text', content: ' お腹ペコい ' },
+ { type: 'emoji', content: ':cat:', emoji: 'cat'},
+ { type: 'text', content: ' '},
{ type: 'hashtag', content: '#yryr', hashtag: 'yryr' }
], tokens);
});
@@ -48,6 +50,13 @@ describe('Text', () => {
], tokens);
});
+ it('emoji', () => {
+ const tokens = analyze(':cat:');
+ assert.deepEqual([
+ { type: 'emoji', content: ':cat:', emoji: 'cat'}
+ ], tokens);
+ });
+
it('block code', () => {
const tokens = analyze('```\nvar x = "Strawberry Pasta";\n```');
assert.equal(tokens[0].type, 'code');