forked from AkkomaGang/admin-fe
Fix tests for args setting in Pleroma.Upload.Filter.Mogrify
This commit is contained in:
parent
8e1825ae1a
commit
3b4abed18b
2 changed files with 4 additions and 6 deletions
|
@ -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()
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue