1 /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
3 import { mdToOneLinePlainText } from '@server/helpers/markdown'
4 import { expect } from 'chai'
6 describe('Markdown helpers', function () {
8 describe('Plain text', function () {
10 it('Should convert a list to plain text', function () {
11 const result = mdToOneLinePlainText(`* list 1
15 expect(result).to.equal('list 1, list 2, list 3')
18 it('Should convert a list with indentation to plain text', function () {
19 const result = mdToOneLinePlainText(`Hello:
24 expect(result).to.equal('Hello: list 1, list 2, list 3')
27 it('Should convert HTML to plain text', function () {
28 const result = mdToOneLinePlainText(`**Hello** <strong>coucou</strong>`)
30 expect(result).to.equal('Hello coucou')
33 it('Should convert tags to plain text', function () {
34 const result = mdToOneLinePlainText(`#déconversion\n#newage\n#histoire`)
36 expect(result).to.equal('#déconversion #newage #histoire')