Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ function buildExpectedMessage(vote: OffchainVoteWithDaoId): string {
: offchainVoteCastMessages.withoutReason;

return replacePlaceholders(template, {
address: vote.voter,
daoId: vote.daoId,
proposalTitle: vote.proposalTitle,
...(hasReason && { reason: vote.reason! }),
Expand All @@ -89,7 +88,7 @@ function buildExpectedPayload(vote: OffchainVoteWithDaoId): NotificationPayload
channelUserId: STUB_USER.channel_user_id,
message: buildExpectedMessage(vote),
bot_token: undefined,
metadata: undefined,
metadata: { addresses: { address: vote.voter } },
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@ export class OffchainVoteCastTriggerHandler extends BaseTriggerHandler<OffchainV
[user],
message,
eventId,
vote.daoId
vote.daoId,
{ addresses: { address: vote.voter } }
);
}

Expand All @@ -126,7 +127,6 @@ export class OffchainVoteCastTriggerHandler extends BaseTriggerHandler<OffchainV
: offchainVoteCastMessages.withoutReason;

return replacePlaceholders(messageTemplate, {
address: vote.voter,
daoId: vote.daoId,
proposalTitle: vote.proposalTitle,
...(hasReason && { reason: vote.reason! })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ describe('Offchain Vote Cast Trigger - Integration Test', () => {
expect(message.text).toContain('🗳️');
expect(message.text).toContain(proposalTitle);
expect(message.text).toContain('Reason: "Fully support this initiative!"');
expect(message.text).toContain('vitalik.eth');
expect(message.text).not.toContain(voterAddress);
});

test('should NOT send duplicate notifications for same offchain vote', async () => {
Expand Down
Loading