more cases for messageHelper just in case

This commit is contained in:
Aster Fialla
2026-02-18 16:28:35 -05:00
parent da9a3d2c8a
commit acd9ce7c3e

View File

@@ -44,7 +44,10 @@ describe('messageHelper', () => {
describe(`parseProxyTags`, () => { describe(`parseProxyTags`, () => {
const membersFor1 = [ const membersFor1 = [
{name: "somePerson", proxy: "--text"}, {name: "somePerson", proxy: "--text"},
{name: "someSecondPerson", proxy: undefined} {name: "someSecondPerson", proxy: undefined},
, {name: "someOtherPerson", proxy: "?text}"},
{name: "someLastPerson", proxy: "{text}"},
{name: "someEmojiPerson", proxy: "⭐text"},
] ]
const membersFor2 = [] const membersFor2 = []
@@ -69,6 +72,9 @@ describe('messageHelper', () => {
['1', 'hello', attachmentUrl, {}], ['1', 'hello', attachmentUrl, {}],
['1', '--hello', attachmentUrl, {member: membersFor1[0], message: 'hello', hasAttachment: true}], ['1', '--hello', attachmentUrl, {member: membersFor1[0], message: 'hello', hasAttachment: true}],
['1', '--', attachmentUrl, {member: membersFor1[0], message: '', hasAttachment: true}], ['1', '--', attachmentUrl, {member: membersFor1[0], message: '', hasAttachment: true}],
['1', '?hello}', null, {member: membersFor1[3], message: 'hello'}],
['1', '{hello}', null, {member: membersFor1[4], message: 'hello'}],
['1', '⭐hello', null, {member: membersFor1[5], message: 'hello'}],
['2', 'hello', null, undefined], ['2', 'hello', null, undefined],
['2', '--hello', null, undefined], ['2', '--hello', null, undefined],
['2', 'hello', attachmentUrl, undefined], ['2', 'hello', attachmentUrl, undefined],
@@ -77,7 +83,7 @@ describe('messageHelper', () => {
['3', '--hello', null, {}], ['3', '--hello', null, {}],
['3', 'hello', attachmentUrl, {}], ['3', 'hello', attachmentUrl, {}],
['3', '--hello', attachmentUrl,{}], ['3', '--hello', attachmentUrl,{}],
])('Member %s returns correct proxy', (specificAuthorId, content, attachmentUrl, expected) => { ])('ID %s with string %s returns correct proxy', async(specificAuthorId, content, attachmentUrl, expected) => {
// Act // Act
return messageHelper.parseProxyTags(specificAuthorId, content, attachmentUrl).then((res) => { return messageHelper.parseProxyTags(specificAuthorId, content, attachmentUrl).then((res) => {
// Assert // Assert