1 /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
4 import { mdToOneLinePlainText } from '@server/helpers/markdown'
5 import { expect } from 'chai'
7 describe('Markdown helpers', function () {
9 describe('Plain text', function () {
11 it('Should convert a list to plain text', function () {
12 const result = mdToOneLinePlainText(`* list 1
16 expect(result).to.equal('list 1, list 2, list 3')
19 it('Should convert a list with indentation to plain text', function () {
20 const result = mdToOneLinePlainText(`Hello:
25 expect(result).to.equal('Hello: list 1, list 2, list 3')
28 it('Should convert HTML to plain text', function () {
29 const result = mdToOneLinePlainText(`**Hello** <strong>coucou</strong>`)
31 expect(result).to.equal('Hello coucou')
34 it('Should convert tags to plain text', function () {
35 const result = mdToOneLinePlainText(`#déconversion\n#newage\n#histoire`)
37 expect(result).to.equal('#déconversion #newage #histoire')