mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-03-11 02:12:21 -05:00
Cleaned up public settings test suite
refs https://github.com/TryGhost/Team/issues/509
refs c2a3297f5d
- Before introducing new public setting made sure the test is up to date and checks everything it was intended to.
This commit is contained in:
parent
c2a3297f5d
commit
e133c45314
1 changed files with 6 additions and 3 deletions
|
@ -79,9 +79,12 @@ describe('Settings Content API', function () {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
// settings.should.have.properties(publicProperties);
|
settings.should.have.properties(publicProperties);
|
||||||
// Object.keys(settings).length.should.equal(22);
|
|
||||||
|
// The length below should only change when public settings have been removed or added
|
||||||
|
Object.keys(settings).length.should.equal(24);
|
||||||
Object.keys(settings).should.deepEqual(defaultSettingsKeys);
|
Object.keys(settings).should.deepEqual(defaultSettingsKeys);
|
||||||
|
|
||||||
// Verify that we are returning the defaults for each value
|
// Verify that we are returning the defaults for each value
|
||||||
_.forEach(settings, (value, settingsKey) => {
|
_.forEach(settings, (value, settingsKey) => {
|
||||||
// `url` does not come from the settings cache
|
// `url` does not come from the settings cache
|
||||||
|
@ -90,7 +93,7 @@ describe('Settings Content API', function () {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
let defaultKey = _.findKey(publicSettings, v => v === settingsKey);
|
let defaultKey = publicSettings[settingsKey];
|
||||||
let defaultValue = _.find(flattenedPublicSettings, setting => setting.key === defaultKey).defaultValue;
|
let defaultValue = _.find(flattenedPublicSettings, setting => setting.key === defaultKey).defaultValue;
|
||||||
|
|
||||||
// Convert empty strings to null
|
// Convert empty strings to null
|
||||||
|
|
Loading…
Add table
Reference in a new issue