diff --git a/ghost/core/test/e2e-api/admin/__snapshots__/settings.test.js.snap b/ghost/core/test/e2e-api/admin/__snapshots__/settings.test.js.snap index 19d568e27d..c305a9f4ed 100644 --- a/ghost/core/test/e2e-api/admin/__snapshots__/settings.test.js.snap +++ b/ghost/core/test/e2e-api/admin/__snapshots__/settings.test.js.snap @@ -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", diff --git a/ghost/core/test/e2e-api/admin/settings.test.js b/ghost/core/test/e2e-api/admin/settings.test.js index cf263d4cb3..08d43f3bfa 100644 --- a/ghost/core/test/e2e-api/admin/settings.test.js +++ b/ghost/core/test/e2e-api/admin/settings.test.js @@ -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; }; @@ -190,7 +199,7 @@ describe('Settings API', function () { .matchHeaderSnapshot({ etag: anyEtag }); - + // Check returned WITH prefix const val = body.settings.find(setting => setting.key === 'icon'); assert.ok(val); @@ -243,11 +252,11 @@ describe('Settings API', function () { }); }); - mockManager.assert.sentEmailCount(1); + mockManager.assert.sentEmailCount(1); mockManager.assert.sentEmail({ subject: 'Verify email address', to: 'support@example.com' - }); + }); }); it('does not trigger email verification flow if members_support_address remains the same', async function () { @@ -402,7 +411,7 @@ describe('Settings API', function () { to: 'test@test.com' }); }); - + it('can do validateMembersEmailUpdate', async function () { const magicLink = await membersService.api.getMagicLink('test@test.com'); const magicLinkUrl = new URL(magicLink);