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

Add tests for wrapping regular settings

parent a550da95
No related branches found
No related tags found
1 merge request!77Ability to remove settings from db
This commit is part of merge request !77. Comments created here will be created in the context of that merge request.
...@@ -348,4 +348,27 @@ describe('Wrap settings', () => { ...@@ -348,4 +348,27 @@ describe('Wrap settings', () => {
expect(_.isEqual(result, expectedResult)).toBeTruthy() expect(_.isEqual(result, expectedResult)).toBeTruthy()
}) })
it('wraps regular settings', () => {
const settings = { ':http_security': {
':report_uri': ["string", "https://test.com"],
':ct_max_age': ["integer", 150000],
':sts': ["boolean", true],
':methods': [["list", "string"], ["POST", "PUT", "PATCH"]]
}}
const state = { ':pleroma': { ':http_security': {}}}
const result = wrapUpdatedSettings(':pleroma', settings, state)
const expectedResult = [{
group: ':pleroma',
key: ':http_security',
value: [
{ tuple: [":report_uri", "https://test.com"] },
{ tuple: [":ct_max_age", 150000] },
{ tuple: [":sts", true] },
{ tuple: [":methods", ["POST", "PUT", "PATCH"]] }
]
}]
expect(_.isEqual(result, expectedResult)).toBeTruthy()
})
}) })
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