forked from FoundKeyGang/FoundKey
Update tests
This commit is contained in:
parent
1e2b484929
commit
579b61a806
1 changed files with 38 additions and 13 deletions
29
test/mfm.ts
29
test/mfm.ts
|
@ -54,7 +54,8 @@ describe('Text', () => {
|
||||||
], tokens2);
|
], tokens2);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('mention', () => {
|
describe('mention', () => {
|
||||||
|
it('local', () => {
|
||||||
const tokens = analyze('@himawari お腹ペコい');
|
const tokens = analyze('@himawari お腹ペコい');
|
||||||
assert.deepEqual([
|
assert.deepEqual([
|
||||||
{ type: 'mention', content: '@himawari', username: 'himawari', host: null },
|
{ type: 'mention', content: '@himawari', username: 'himawari', host: null },
|
||||||
|
@ -62,13 +63,37 @@ describe('Text', () => {
|
||||||
], tokens);
|
], tokens);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('remote mention', () => {
|
it('remote', () => {
|
||||||
const tokens = analyze('@hima_sub@namori.net お腹ペコい');
|
const tokens = analyze('@hima_sub@namori.net お腹ペコい');
|
||||||
assert.deepEqual([
|
assert.deepEqual([
|
||||||
{ type: 'mention', content: '@hima_sub@namori.net', username: 'hima_sub', host: 'namori.net' },
|
{ type: 'mention', content: '@hima_sub@namori.net', username: 'hima_sub', host: 'namori.net' },
|
||||||
{ type: 'text', content: ' お腹ペコい' }
|
{ type: 'text', content: ' お腹ペコい' }
|
||||||
], tokens);
|
], tokens);
|
||||||
});
|
});
|
||||||
|
/*
|
||||||
|
it('ignore', () => {
|
||||||
|
const tokens = analyze('idolm@ster');
|
||||||
|
assert.deepEqual([
|
||||||
|
{ type: 'text', content: 'idolm@ster' }
|
||||||
|
], tokens);
|
||||||
|
|
||||||
|
const tokens2 = analyze('@a\n@b\n@c');
|
||||||
|
assert.deepEqual([
|
||||||
|
{ type: 'mention', content: '@a', username: 'a', host: null },
|
||||||
|
{ type: 'text', content: '\n' },
|
||||||
|
{ type: 'mention', content: '@b', username: 'b', host: null },
|
||||||
|
{ type: 'text', content: '\n' },
|
||||||
|
{ type: 'mention', content: '@c', username: 'c', host: null }
|
||||||
|
], tokens2);
|
||||||
|
|
||||||
|
const tokens3 = analyze('**x**@a');
|
||||||
|
assert.deepEqual([
|
||||||
|
{ type: 'bold', content: '**x**', bold: 'x' },
|
||||||
|
{ type: 'mention', content: '@a', username: 'a', host: null }
|
||||||
|
], tokens3);
|
||||||
|
});
|
||||||
|
*/
|
||||||
|
});
|
||||||
|
|
||||||
it('hashtag', () => {
|
it('hashtag', () => {
|
||||||
const tokens1 = analyze('Strawberry Pasta #alice');
|
const tokens1 = analyze('Strawberry Pasta #alice');
|
||||||
|
|
Loading…
Reference in a new issue