Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Chocobozzz committed Dec 19, 2024
1 parent cf92135 commit 88f5990
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/tests/src/server-helpers/markdown.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */

import { mdToOneLinePlainText } from '@peertube/peertube-server/core/helpers/markdown.js'
import { mdToPlainText } from '@peertube/peertube-server/core/helpers/markdown.js'
import { expect } from 'chai'

describe('Markdown helpers', function () {

describe('Plain text', function () {

it('Should convert a list to plain text', function () {
const result = mdToOneLinePlainText(`* list 1
const result = mdToPlainText(`* list 1
* list 2
* list 3`)

expect(result).to.equal('list 1, list 2, list 3')
})

it('Should convert a list with indentation to plain text', function () {
const result = mdToOneLinePlainText(`Hello:
const result = mdToPlainText(`Hello:
* list 1
* list 2
* list 3`)
Expand All @@ -25,13 +25,13 @@ describe('Markdown helpers', function () {
})

it('Should convert HTML to plain text', function () {
const result = mdToOneLinePlainText(`**Hello** <strong>coucou</strong>`)
const result = mdToPlainText(`**Hello** <strong>coucou</strong>`)

expect(result).to.equal('Hello coucou')
})

it('Should convert tags to plain text', function () {
const result = mdToOneLinePlainText(`#déconversion\n#newage\n#histoire`)
const result = mdToPlainText(`#déconversion\n#newage\n#histoire`)

expect(result).to.equal('#déconversion #newage #histoire')
})
Expand Down

0 comments on commit 88f5990

Please sign in to comment.