mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2024-11-22 01:47:39 -07:00
[test] add emoji test
This commit is contained in:
parent
8bcdc08042
commit
c11a47a4a3
1 changed files with 10 additions and 1 deletions
11
test/text.ts
11
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');
|
||||
|
|
Loading…
Reference in a new issue