Skip to content
Snippets Groups Projects
Commit 0c6625f3 authored by Angelina Filippova's avatar Angelina Filippova
Browse files

Add test for wrapping settings with type [`list`, `map`]

parent e42e2683
No related branches found
No related tags found
No related merge requests found
......@@ -341,6 +341,40 @@ describe('Wrap settings', () => {
expect(_.isEqual(result2, expectedResult2)).toBeTruthy()
})
it('wraps settings with type [`list`, `map`]', () => {
const settings = { ':manifest': { ':icons': [['map', 'list'], [
{ ':src': '/static/logo.png', ':type': 'image/png' },
{ ':src': '/static/icon.png', ':type': 'image/png' }
]]}}
const state = { ':pleroma': { ':manifest': {
':background_color': '#191b22',
':theme_color': '#282c37',
':icons': [
[
{ 'id': 'f21318c4', 'key': ':src', 'value': '/static/logo.png' },
{ 'id': 'f4b87549', 'key': ':type', 'value': 'image/png' }
], [
{ 'id': 'f31d351e', 'key': ':src', 'value': '/static/icon.png' },
{ 'id': 'f1455852', 'key': ':type', 'value': 'image/png' }
]
]
}}}
const result = wrapUpdatedSettings(':pleroma', settings, state)
const expectedResult = [{
group: ':pleroma',
key: ':manifest',
value: [{ tuple: [':icons', [
{ ':src': '/static/logo.png', ':type': 'image/png' },
{ ':src': '/static/icon.png', ':type': 'image/png' }
]]}]
}]
expect(_.isEqual(result, expectedResult)).toBeTruthy()
})
it('wraps IP setting', () => {
const settings = { ':gopher': { ':ip': ['tuple', '127.0.0.1']}}
const state = { ':pleroma': { ':gopher': {}}}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment