@nodebb/nodebb-plugin-reactions 3.1.3 → 3.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nodebb/nodebb-plugin-reactions",
3
- "version": "3.1.3",
3
+ "version": "3.1.5",
4
4
  "nbbpm": {
5
5
  "compatibility": "^4.16.0"
6
6
  },
package/test/index.js CHANGED
@@ -63,8 +63,10 @@ describe('helpers.resolveReaction', () => {
63
63
  assert.strictEqual(helpers.resolveReaction(':blobwtf:', [{ type: 'Emoji', name: ':fire:' }]), 'fire');
64
64
  });
65
65
 
66
- it('should return null for a custom emoji tag that does not match locally', () => {
67
- assert.strictEqual(helpers.resolveReaction(':blobwtf:', [{ type: 'Emoji', name: ':blobwtf:' }]), null);
66
+ it('should return { emoji, emojiTag } for a custom emoji tag that does not match locally', () => {
67
+ const tag = [{ type: 'Emoji', name: ':blobcatonfire:', id: 'https://example.org/emojis/blobcatonfire.png' }];
68
+ const result = helpers.resolveReaction(':blobcatonfire:', tag);
69
+ assert.deepStrictEqual(result, { emoji: 'blobcatonfire', emojiTag: tag[0] });
68
70
  });
69
71
 
70
72
  it('should return null for unresolvable content', () => {
@@ -208,17 +210,8 @@ describe('ActivityPub (FEP-c0e0)', () => {
208
210
  assert.strictEqual(await posts.getPostField(postData.pid, 'upvotes'), 0);
209
211
  });
210
212
 
211
- it('should ignore unresolvable custom emoji', async () => {
212
- const res = mockRes();
213
- await controllers.activitypub.postInbox({
214
- body: reactionActivity({
215
- content: ':blobwtf:',
216
- tag: [{ type: 'Emoji', name: ':blobwtf:' }],
217
- }),
218
- }, res);
219
-
220
- assert.strictEqual(res.statusCode, 202);
221
- assert.strictEqual(await db.setCount(`pid:${postData.pid}:reactions`), 0);
213
+ it.skip('should store custom emoji even when tag has no icon url', async () => {
214
+ // TODO: requires activitypub.emoji module availability in test sandbox
222
215
  });
223
216
 
224
217
  describe('with posts:upvote revoked from the fediverse pseudo-user', () => {