From 3b4abed18b9ff578fd0fdc8200e5338062e607a3 Mon Sep 17 00:00:00 2001 From: Angelina Filippova Date: Tue, 4 Aug 2020 00:57:17 +0300 Subject: [PATCH] Fix tests for args setting in Pleroma.Upload.Filter.Mogrify --- test/modules/normalizers/parseTuples.test.js | 6 ++---- test/modules/normalizers/wrapUpdatedSettings.test.js | 4 ++-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/test/modules/normalizers/parseTuples.test.js b/test/modules/normalizers/parseTuples.test.js index a918c618..ff039135 100644 --- a/test/modules/normalizers/parseTuples.test.js +++ b/test/modules/normalizers/parseTuples.test.js @@ -269,8 +269,6 @@ describe('Parse tuples', () => { const expectedSenderTuple = { ':sender': { email: 'test@email.com', nickname: 'test' }} const expectedSenderString = { ':sender': { email: 'test@email.com' }} - console.log(parseTuples(senderEmpty, ':welcome')) - expect(_.isEqual(expectedSenderEmpty, parseTuples(senderEmpty, ':welcome'))).toBeTruthy() expect(_.isEqual(expectedSenderTuple, parseTuples(senderTuple, ':welcome'))).toBeTruthy() expect(_.isEqual(expectedSenderString, parseTuples(senderString, ':welcome'))).toBeTruthy() @@ -291,8 +289,8 @@ describe('Parse tuples', () => { }) it('parses args setting in Pleroma.Upload.Filter.Mogrify', () => { - const tuples = [{ tuple: [':args', ['strip', { tuple: ['implode', '1'] }]]}] - const expectedResult = { ':args': ['strip', 'implode'] } + const tuples = [{ tuple: [':args', ['strip', '{ "implode", "1" }']]}] + const expectedResult = { ':args': ['strip', '{ "implode", "1" }'] } const result = parseTuples(tuples, 'Pleroma.Upload.Filter.Mogrify') expect(_.isEqual(expectedResult, result)).toBeTruthy() diff --git a/test/modules/normalizers/wrapUpdatedSettings.test.js b/test/modules/normalizers/wrapUpdatedSettings.test.js index dedb5c34..78f8ee6e 100644 --- a/test/modules/normalizers/wrapUpdatedSettings.test.js +++ b/test/modules/normalizers/wrapUpdatedSettings.test.js @@ -357,14 +357,14 @@ describe('Wrap settings', () => { it('wraps args setting in Pleroma.Upload.Filter.Mogrify group', () => { const settings = { 'Pleroma.Upload.Filter.Mogrify': { ':args': [ ['string', ['list', 'string'], ['list', 'tuple']], - ['strip', 'implode'] + ['strip', '{ "implode", "1"]}'] ]}} const state = { ':pleroma': { 'Pleroma.Upload.Filter.Mogrify': {}}} const result = wrapUpdatedSettings(':pleroma', settings, state) const expectedResult = [{ group: ':pleroma', key: 'Pleroma.Upload.Filter.Mogrify', - value: [{tuple: [':args', ['strip', {tuple: ['implode', '1']}]]}] + value: [{tuple: [':args', ['strip', '{ "implode", "1"]}']]}] }] expect(_.isEqual(result, expectedResult)).toBeTruthy()