mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-14 21:27:23 +01:00
update test to use the correct author_name format
This commit is contained in:
@@ -32,6 +32,7 @@ describe('slack', () => {
|
|||||||
},
|
},
|
||||||
message: {
|
message: {
|
||||||
id: 'chat-id',
|
id: 'chat-id',
|
||||||
|
username: 'author',
|
||||||
user: 'Author',
|
user: 'Author',
|
||||||
uuid: 'author-id',
|
uuid: 'author-id',
|
||||||
text: 'some text',
|
text: 'some text',
|
||||||
@@ -54,7 +55,7 @@ describe('slack', () => {
|
|||||||
attachments: [{
|
attachments: [{
|
||||||
fallback: 'Flag Message',
|
fallback: 'Flag Message',
|
||||||
color: 'danger',
|
color: 'danger',
|
||||||
author_name: `Author - author@example.com - author-id\n${timestamp}`,
|
author_name: `@author Author (author@example.com; author-id)\n${timestamp}`,
|
||||||
title: 'Flag in Some group - (private guild)',
|
title: 'Flag in Some group - (private guild)',
|
||||||
title_link: undefined,
|
title_link: undefined,
|
||||||
text: 'some text',
|
text: 'some text',
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ describe('POST /chat/:chatId/flag', () => {
|
|||||||
attachments: [{
|
attachments: [{
|
||||||
fallback: 'Flag Message',
|
fallback: 'Flag Message',
|
||||||
color: 'danger',
|
color: 'danger',
|
||||||
author_name: `${anotherUser.profile.name} - ${anotherUser.auth.local.email} - ${anotherUser._id}\n${timestamp}`,
|
author_name: `@${anotherUser.auth.local.username} ${anotherUser.profile.name} (${anotherUser.auth.local.email}; ${anotherUser._id})\n${timestamp}`,
|
||||||
title: 'Flag in Test Guild',
|
title: 'Flag in Test Guild',
|
||||||
title_link: `${BASE_URL}/groups/guild/${group._id}`,
|
title_link: `${BASE_URL}/groups/guild/${group._id}`,
|
||||||
text: TEST_MESSAGE,
|
text: TEST_MESSAGE,
|
||||||
@@ -102,7 +102,7 @@ describe('POST /chat/:chatId/flag', () => {
|
|||||||
attachments: [{
|
attachments: [{
|
||||||
fallback: 'Flag Message',
|
fallback: 'Flag Message',
|
||||||
color: 'danger',
|
color: 'danger',
|
||||||
author_name: `${newUser.profile.name} - ${newUser.auth.local.email} - ${newUser._id}\n${timestamp}`,
|
author_name: `@${newUser.auth.local.username} ${newUser.profile.name} (${newUser.auth.local.email}; ${newUser._id})\n${timestamp}`,
|
||||||
title: 'Flag in Test Guild',
|
title: 'Flag in Test Guild',
|
||||||
title_link: `${BASE_URL}/groups/guild/${group._id}`,
|
title_link: `${BASE_URL}/groups/guild/${group._id}`,
|
||||||
text: TEST_MESSAGE,
|
text: TEST_MESSAGE,
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ try {
|
|||||||
* @returns {string}
|
* @returns {string}
|
||||||
*/
|
*/
|
||||||
function formatUser (formatObj) {
|
function formatUser (formatObj) {
|
||||||
return `@${formatObj.name} ${formatObj.displayName} (${formatObj.email}; ${formatObj.uuid}`;
|
return `@${formatObj.name} ${formatObj.displayName} (${formatObj.email}; ${formatObj.uuid})`;
|
||||||
}
|
}
|
||||||
|
|
||||||
function sendFlagNotification ({
|
function sendFlagNotification ({
|
||||||
|
|||||||
Reference in New Issue
Block a user