0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-20 22:42:53 -05:00

Removed need for snapshot updates for feature flags

- prior to this commit, if you add or remove a faeture flag, you also have to update the snapshots for the settings tests
- feature flags are intended to be very easy to add and remove, and so this extra step doesn't fit with our needs
- it's also unnecessary, we don't need to verify the exact contents of the labs setting
This commit is contained in:
Hannah Wolfe 2022-08-15 15:36:14 +01:00
parent 54aa9f016b
commit 22fd7f289c
No known key found for this signature in database
GPG key ID: AB586C3B5AE5C037
2 changed files with 20 additions and 11 deletions

View file

@ -230,7 +230,7 @@ Object {
},
Object {
"key": "labs",
"value": "{\\"activitypub\\":true,\\"auditLog\\":true,\\"urlCache\\":true,\\"beforeAfterCard\\":true,\\"freeTrial\\":true,\\"newsletterPaywall\\":true,\\"members\\":true}",
"value": StringMatching /\\\\\\{\\[\\^\\\\s\\]\\+\\\\\\}/,
},
Object {
"key": "slack_url",
@ -569,7 +569,7 @@ Object {
},
Object {
"key": "labs",
"value": "{\\"newsletterPaywall\\":true,\\"members\\":true}",
"value": StringMatching /\\\\\\{\\[\\^\\\\s\\]\\+\\\\\\}/,
},
Object {
"key": "slack_url",
@ -858,7 +858,7 @@ Object {
},
Object {
"key": "labs",
"value": "{\\"newsletterPaywall\\":true,\\"members\\":true}",
"value": StringMatching /\\\\\\{\\[\\^\\\\s\\]\\+\\\\\\}/,
},
Object {
"key": "slack_url",
@ -1146,7 +1146,7 @@ Object {
},
Object {
"key": "labs",
"value": "{\\"newsletterPaywall\\":true,\\"members\\":true}",
"value": StringMatching /\\\\\\{\\[\\^\\\\s\\]\\+\\\\\\}/,
},
Object {
"key": "slack_url",
@ -1439,7 +1439,7 @@ Object {
},
Object {
"key": "labs",
"value": "{\\"newsletterPaywall\\":true,\\"members\\":true}",
"value": StringMatching /\\\\\\{\\[\\^\\\\s\\]\\+\\\\\\}/,
},
Object {
"key": "slack_url",
@ -1727,7 +1727,7 @@ Object {
},
Object {
"key": "labs",
"value": "{\\"newsletterPaywall\\":true,\\"members\\":true}",
"value": StringMatching /\\\\\\{\\[\\^\\\\s\\]\\+\\\\\\}/,
},
Object {
"key": "slack_url",
@ -2078,7 +2078,7 @@ Object {
},
Object {
"key": "labs",
"value": "{\\"newsletterPaywall\\":true,\\"members\\":true}",
"value": StringMatching /\\\\\\{\\[\\^\\\\s\\]\\+\\\\\\}/,
},
Object {
"key": "slack_url",

View file

@ -15,6 +15,10 @@ const publicHashSettingMatcher = {
value: stringMatching(/[a-z0-9]{30}/)
};
const labsSettingMatcher = {
value: stringMatching(/\{[^\s]+\}/)
};
const matchSettingsArray = (length) => {
const settingsArray = new Array(length).fill(settingsMatcher);
@ -23,6 +27,11 @@ const matchSettingsArray = (length) => {
settingsArray[25] = publicHashSettingMatcher;
}
if (length > 56) {
// Item at index 56 is the lab settings, which changes as we add and remove features
settingsArray[56] = labsSettingMatcher;
}
return settingsArray;
};