summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/text.ts14
1 files changed, 12 insertions, 2 deletions
diff --git a/test/text.ts b/test/text.ts
index 711aad8167..8ce55cd1bc 100644
--- a/test/text.ts
+++ b/test/text.ts
@@ -9,9 +9,11 @@ const syntaxhighlighter = require('../built/text/parse/core/syntax-highlighter')
describe('Text', () => {
it('can be analyzed', () => {
- const tokens = analyze('@himawari お腹ペコい :cat: #yryr');
+ const tokens = analyze('@himawari @hima_sub@namori.net お腹ペコい :cat: #yryr');
assert.deepEqual([
{ type: 'mention', content: '@himawari', username: 'himawari', host: null },
+ { type: 'text', content: ' '},
+ { type: 'mention', content: '@hima_sub@namori.net', username: 'hima_sub', host: 'namori.net' },
{ type: 'text', content: ' お腹ペコい ' },
{ type: 'emoji', content: ':cat:', emoji: 'cat'},
{ type: 'text', content: ' '},
@@ -20,7 +22,7 @@ describe('Text', () => {
});
it('can be inverted', () => {
- const text = '@himawari お腹ペコい :cat: #yryr';
+ const text = '@himawari @hima_sub@namori.net お腹ペコい :cat: #yryr';
assert.equal(analyze(text).map(x => x.content).join(''), text);
});
@@ -41,6 +43,14 @@ describe('Text', () => {
], tokens);
});
+ it('remote mention', () => {
+ const tokens = analyze('@hima_sub@namori.net お腹ペコい');
+ assert.deepEqual([
+ { type: 'mention', content: '@hima_sub@namori.net', username: 'hima_sub', host: 'namori.net' },
+ { type: 'text', content: ' お腹ペコい' }
+ ], tokens);
+ });
+
it('hashtag', () => {
const tokens = analyze('Strawberry Pasta #alice');
assert.deepEqual([