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:
Naz 2021-03-04 15:41:49 +13:00
parent c2a3297f5d
commit e133c45314

View File

@ -79,9 +79,12 @@ describe('Settings Content API', function () {
});
});
// settings.should.have.properties(publicProperties);
// Object.keys(settings).length.should.equal(22);
settings.should.have.properties(publicProperties);
// 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);
// Verify that we are returning the defaults for each value
_.forEach(settings, (value, settingsKey) => {
// `url` does not come from the settings cache
@ -90,7 +93,7 @@ describe('Settings Content API', function () {
return;
}
let defaultKey = _.findKey(publicSettings, v => v === settingsKey);
let defaultKey = publicSettings[settingsKey];
let defaultValue = _.find(flattenedPublicSettings, setting => setting.key === defaultKey).defaultValue;
// Convert empty strings to null