mirror of
https://activitypub.software/TransFem-org/sfm-js
synced 2024-11-28 17:03:03 +00:00
update test
This commit is contained in:
parent
d0e33e8fef
commit
ffa45abfd8
1 changed files with 21 additions and 3 deletions
24
test/main.ts
24
test/main.ts
|
@ -434,14 +434,17 @@ describe('fn', () => {
|
||||||
|
|
||||||
it('composite', () => {
|
it('composite', () => {
|
||||||
const input =
|
const input =
|
||||||
`<center>
|
`before
|
||||||
|
<center>
|
||||||
Hello [tada everynyan! 🎉]
|
Hello [tada everynyan! 🎉]
|
||||||
|
|
||||||
I'm @ai, A bot of misskey!
|
I'm @ai, A bot of misskey!
|
||||||
|
|
||||||
https://github.com/syuilo/ai
|
https://github.com/syuilo/ai
|
||||||
</center>`;
|
</center>
|
||||||
|
after`;
|
||||||
const output = [
|
const output = [
|
||||||
|
TEXT('before'),
|
||||||
CENTER([
|
CENTER([
|
||||||
TEXT('Hello '),
|
TEXT('Hello '),
|
||||||
FN('tada', { }, [
|
FN('tada', { }, [
|
||||||
|
@ -452,11 +455,26 @@ https://github.com/syuilo/ai
|
||||||
MENTION('ai', null, '@ai'),
|
MENTION('ai', null, '@ai'),
|
||||||
TEXT(', A bot of misskey!\n\n'),
|
TEXT(', A bot of misskey!\n\n'),
|
||||||
N_URL('https://github.com/syuilo/ai')
|
N_URL('https://github.com/syuilo/ai')
|
||||||
])
|
]),
|
||||||
|
TEXT('after')
|
||||||
];
|
];
|
||||||
assert.deepStrictEqual(parse(input), output);
|
assert.deepStrictEqual(parse(input), output);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('toString', () => {
|
||||||
|
const input =
|
||||||
|
`before
|
||||||
|
<center>
|
||||||
|
Hello [tada everynyan! 🎉]
|
||||||
|
|
||||||
|
I'm @ai, A bot of misskey!
|
||||||
|
|
||||||
|
https://github.com/syuilo/ai
|
||||||
|
</center>
|
||||||
|
after`;
|
||||||
|
assert.strictEqual(toString(parse(input)), input);
|
||||||
|
});
|
||||||
|
|
||||||
describe('inspect', () => {
|
describe('inspect', () => {
|
||||||
it('replace text', () => {
|
it('replace text', () => {
|
||||||
const input = 'good morning [tada everynyan!]';
|
const input = 'good morning [tada everynyan!]';
|
||||||
|
|
Loading…
Reference in a new issue