From 6e8cf67a6f7c20f9e43dd7bfc111f6b494e11c50 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 14 Feb 2019 11:04:50 +0100 Subject: Fix mention notification with a remote account --- server/tests/api/users/user-notifications.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'server/tests/api') diff --git a/server/tests/api/users/user-notifications.ts b/server/tests/api/users/user-notifications.ts index 5260d64cc..72b6a0aa2 100644 --- a/server/tests/api/users/user-notifications.ts +++ b/server/tests/api/users/user-notifications.ts @@ -506,6 +506,20 @@ describe('Test users notifications', function () { await removeAccountFromAccountBlocklist(servers[ 0 ].url, userAccessToken, 'root') }) + it('Should not send a new mention notification if the remote account mention a local account', async function () { + this.timeout(20000) + + const resVideo = await uploadVideo(servers[0].url, servers[0].accessToken, { name: 'super video' }) + const uuid = resVideo.body.video.uuid + + await waitJobs(servers) + const resThread = await addVideoCommentThread(servers[1].url, servers[1].accessToken, uuid, '@user_1 hello') + const threadId = resThread.body.comment.id + + await waitJobs(servers) + await checkCommentMention(baseParams, uuid, threadId, threadId, 'super root 2 name', 'absence') + }) + it('Should send a new mention notification after local comments', async function () { this.timeout(10000) -- cgit v1.2.3 From 7a338188f3ce6c3aa53054afaa936aa807d65fd8 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 14 Feb 2019 11:56:23 +0100 Subject: Fix from header in contact form --- server/tests/api/server/contact-form.ts | 3 ++- server/tests/api/server/email.ts | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'server/tests/api') diff --git a/server/tests/api/server/contact-form.ts b/server/tests/api/server/contact-form.ts index 93221d0a3..06a2f89b0 100644 --- a/server/tests/api/server/contact-form.ts +++ b/server/tests/api/server/contact-form.ts @@ -45,7 +45,8 @@ describe('Test contact form', function () { const email = emails[0] - expect(email['from'][0]['address']).equal('toto@example.com') + expect(email['from'][0]['address']).equal('test-admin@localhost') + expect(email['from'][0]['name']).equal('toto@example.com') expect(email['to'][0]['address']).equal('admin1@example.com') expect(email['subject']).contains('Contact form') expect(email['text']).contains('my super message') diff --git a/server/tests/api/server/email.ts b/server/tests/api/server/email.ts index f96c57b66..f8f16f54f 100644 --- a/server/tests/api/server/email.ts +++ b/server/tests/api/server/email.ts @@ -89,6 +89,7 @@ describe('Test emails', function () { const email = emails[0] + expect(email['from'][0]['name']).equal('localhost:9001') expect(email['from'][0]['address']).equal('test-admin@localhost') expect(email['to'][0]['address']).equal('user_1@example.com') expect(email['subject']).contains('password') @@ -133,6 +134,7 @@ describe('Test emails', function () { const email = emails[1] + expect(email['from'][0]['name']).equal('localhost:9001') expect(email['from'][0]['address']).equal('test-admin@localhost') expect(email['to'][0]['address']).equal('admin1@example.com') expect(email['subject']).contains('abuse') @@ -152,6 +154,7 @@ describe('Test emails', function () { const email = emails[2] + expect(email['from'][0]['name']).equal('localhost:9001') expect(email['from'][0]['address']).equal('test-admin@localhost') expect(email['to'][0]['address']).equal('user_1@example.com') expect(email['subject']).contains(' blocked') @@ -169,6 +172,7 @@ describe('Test emails', function () { const email = emails[3] + expect(email['from'][0]['name']).equal('localhost:9001') expect(email['from'][0]['address']).equal('test-admin@localhost') expect(email['to'][0]['address']).equal('user_1@example.com') expect(email['subject']).contains(' unblocked') @@ -188,6 +192,7 @@ describe('Test emails', function () { const email = emails[4] + expect(email['from'][0]['name']).equal('localhost:9001') expect(email['from'][0]['address']).equal('test-admin@localhost') expect(email['to'][0]['address']).equal('user_1@example.com') expect(email['subject']).contains(' blacklisted') @@ -205,6 +210,7 @@ describe('Test emails', function () { const email = emails[5] + expect(email['from'][0]['name']).equal('localhost:9001') expect(email['from'][0]['address']).equal('test-admin@localhost') expect(email['to'][0]['address']).equal('user_1@example.com') expect(email['subject']).contains(' unblacklisted') @@ -224,6 +230,7 @@ describe('Test emails', function () { const email = emails[6] + expect(email['from'][0]['name']).equal('localhost:9001') expect(email['from'][0]['address']).equal('test-admin@localhost') expect(email['to'][0]['address']).equal('user_1@example.com') expect(email['subject']).contains('Verify') -- cgit v1.2.3