aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/notifications
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-11-17 14:24:55 +0100
committerChocobozzz <me@florianbigard.com>2020-11-17 14:24:55 +0100
commit9afb5c10e5935e667e33219bdbd775e9ed1b4330 (patch)
tree2a05f7bac4e5d9f0ca239f07ade3586143881310 /server/tests/api/notifications
parent5c0ecc340ec635baa4549124cc0a055aa0de38f2 (diff)
downloadPeerTube-9afb5c10e5935e667e33219bdbd775e9ed1b4330.tar.gz
PeerTube-9afb5c10e5935e667e33219bdbd775e9ed1b4330.tar.zst
PeerTube-9afb5c10e5935e667e33219bdbd775e9ed1b4330.zip
Add email markdown tests
Diffstat (limited to 'server/tests/api/notifications')
-rw-r--r--server/tests/api/notifications/comments-notifications.ts22
1 files changed, 22 insertions, 0 deletions
diff --git a/server/tests/api/notifications/comments-notifications.ts b/server/tests/api/notifications/comments-notifications.ts
index dfe846cc4..fd009e9d9 100644
--- a/server/tests/api/notifications/comments-notifications.ts
+++ b/server/tests/api/notifications/comments-notifications.ts
@@ -165,6 +165,28 @@ describe('Test comments notifications', function () {
165 165
166 await checkNewCommentOnMyVideo(baseParams, uuid, commentId, threadId, 'presence') 166 await checkNewCommentOnMyVideo(baseParams, uuid, commentId, threadId, 'presence')
167 }) 167 })
168
169 it('Should convert markdown in comment to html', async function () {
170 this.timeout(10000)
171
172 const resVideo = await uploadVideo(servers[0].url, userAccessToken, { name: 'cool video' })
173 const uuid = resVideo.body.video.uuid
174
175 const commentText = '**hello** <a href="https://joinpeertube.org">world</a>, <h1>what do you think about peertube?</h1>'
176 const resComment = await addVideoCommentThread(servers[0].url, servers[0].accessToken, uuid, commentText)
177 const commentId = resComment.body.comment.id
178
179 await waitJobs(servers)
180 await checkNewCommentOnMyVideo(baseParams, uuid, commentId, commentId, 'presence')
181
182 const latestEmail = emails[emails.length - 1]
183
184 const expected = '<strong style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%;">hello</strong> ' +
185 '<a href="https://joinpeertube.org" target="_blank" rel="noopener noreferrer" style="-ms-text-size-adjust: 100%; ' +
186 '-webkit-text-size-adjust: 100%; text-decoration: none; color: #f2690d;">world</a>, </p>what do you think about peertube?'
187
188 expect(latestEmail['html']).to.contain(expected)
189 })
168 }) 190 })
169 191
170 describe('Mention notifications', function () { 192 describe('Mention notifications', function () {