mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-17 23:44:39 -05:00
Improved test settings fixtures
no issue - the settings fixtures file was becoming hard to use because settings have been appended to it on an as-used basis which meant it was difficult to reason about the base-state in acceptance tests and was never really in sync with the default settings state for a Ghost site - added a utility function to create a settings object with the `id` defined to avoid problems with manually updating the ids in the list - updated to include all default settings with their default values if not already set to a specific testing value in the old fixtures
This commit is contained in:
parent
3d0e4c9380
commit
b123b297b6
4 changed files with 141 additions and 289 deletions
|
@ -1,278 +1,117 @@
|
||||||
/* eslint-disable camelcase */
|
/* eslint-disable camelcase */
|
||||||
|
import moment from 'moment';
|
||||||
|
|
||||||
|
let id = 0;
|
||||||
|
|
||||||
|
function setting(group, key, value) {
|
||||||
|
id = id + 1;
|
||||||
|
|
||||||
|
return {
|
||||||
|
id,
|
||||||
|
group,
|
||||||
|
key,
|
||||||
|
value,
|
||||||
|
updated_at: moment.utc().format(),
|
||||||
|
updated_by: 1,
|
||||||
|
created_at: moment.utc().format(),
|
||||||
|
created_by: 1
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
// These settings represent a default new site setup
|
||||||
|
// Real default settings can be found in https://github.com/TryGhost/Ghost/blob/main/core/server/data/schema/default-settings/default-settings.json
|
||||||
export default [
|
export default [
|
||||||
{
|
// SITE
|
||||||
id: 1,
|
setting('site', 'title', 'Test Blog'),
|
||||||
created_at: '2015-09-11T09:44:30.805Z',
|
setting('site', 'description', 'Thoughts, stories and ideas'),
|
||||||
created_by: 1,
|
setting('site', 'logo', '/content/images/2013/Nov/logo.png'),
|
||||||
key: 'title',
|
setting('site', 'cover_image', '/content/images/2014/Feb/cover.jpg'),
|
||||||
group: 'site',
|
setting('site', 'icon', '/content/images/2014/Feb/favicon.ico'),
|
||||||
updated_at: '2015-10-04T16:26:05.195Z',
|
setting('site', 'accent_color', '#ff1a75'),
|
||||||
updated_by: 1,
|
setting('site', 'locale', 'en'),
|
||||||
value: 'Test Blog'
|
setting('site', 'timezone', 'Etc/UTC'),
|
||||||
},
|
setting('site', 'codeinjection_head', null),
|
||||||
{
|
setting('site', 'codeinjection_foot', null),
|
||||||
id: 2,
|
setting('site', 'facebook', 'test'),
|
||||||
created_at: '2015-09-11T09:44:30.806Z',
|
setting('site', 'twitter', '@test'),
|
||||||
created_by: 1,
|
setting('site', 'navigation', JSON.stringify([
|
||||||
key: 'description',
|
{label: 'Home', url: '/'},
|
||||||
group: 'site',
|
{label: 'About', url: '/about'}
|
||||||
updated_at: '2015-10-04T16:26:05.198Z',
|
])),
|
||||||
updated_by: 1,
|
setting('site', 'secondary_navigation', JSON.stringify([])),
|
||||||
value: 'Thoughts, stories and ideas.'
|
setting('site', 'meta_title', null),
|
||||||
},
|
setting('site', 'meta_description', null),
|
||||||
{
|
setting('site', 'og_image', null),
|
||||||
id: 3,
|
setting('site', 'og_title', null),
|
||||||
key: 'logo',
|
setting('site', 'og_description', null),
|
||||||
value: '/content/images/2013/Nov/logo.png',
|
setting('site', 'twitter_image', null),
|
||||||
group: 'site',
|
setting('site', 'twitter_title', null),
|
||||||
created_at: '2013-11-25T14:48:11.000Z',
|
setting('site', 'twitter_description', null),
|
||||||
created_by: 1,
|
|
||||||
updated_at: '2015-10-27T17:39:58.273Z',
|
// THEME
|
||||||
updated_by: 1
|
setting('theme', 'active_theme', 'Casper'),
|
||||||
},
|
|
||||||
{
|
// PRIVATE
|
||||||
id: 4,
|
setting('private', 'is_private', 'false'),
|
||||||
key: 'cover_image',
|
setting('private', 'password', ''),
|
||||||
value: '/content/images/2014/Feb/cover.jpg',
|
setting('private', 'public_hash', ''),
|
||||||
group: 'site',
|
|
||||||
created_at: '2013-11-25T14:48:11.000Z',
|
// MEMBERS
|
||||||
created_by: 1,
|
setting('members', 'default_content_visibility', 'public'),
|
||||||
updated_at: '2015-10-27T17:39:58.276Z',
|
setting('members', 'default_content_visibility_tiers', JSON.stringify([])),
|
||||||
updated_by: 1
|
setting('members', 'members_signup_access', 'all'),
|
||||||
},
|
setting('members', 'members_support_address', 'noreply'),
|
||||||
{
|
setting('members', 'stripe_secret_key', null),
|
||||||
id: 5,
|
setting('members', 'stripe_publishable_key', null),
|
||||||
key: 'locale',
|
setting('members', 'stripe_plans', JSON.stringify([])),
|
||||||
value: 'en',
|
setting('members', 'stripe_connect_publishable_key', 'pk_test_for_stripe'),
|
||||||
group: 'site',
|
setting('members', 'stripe_connect_secret_key', 'sk_test_for_stripe'),
|
||||||
created_at: '2013-11-25T14:48:11.000Z',
|
setting('members', 'stripe_connect_livemode', null),
|
||||||
created_by: 1,
|
setting('members', 'stripe_connect_display_name', null),
|
||||||
updated_at: '2015-10-27T17:39:58.278Z',
|
setting('members', 'stripe_connect_account_id', null),
|
||||||
updated_by: 1
|
setting('members', 'members_monthly_price_id', null),
|
||||||
},
|
setting('members', 'members_yearly_price_id', null),
|
||||||
{
|
|
||||||
id: 10,
|
// PORTAL
|
||||||
created_at: '2015-09-11T09:44:30.809Z',
|
setting('portal', 'portal_name', 'true'),
|
||||||
created_by: 1,
|
setting('portal', 'portal_button', 'true'),
|
||||||
key: 'codeinjection_head',
|
setting('portal', 'portal_plans', JSON.stringify(['free'])),
|
||||||
group: 'site',
|
setting('portal', 'portal_products', JSON.stringify([])),
|
||||||
updated_at: '2015-09-23T13:32:49.858Z',
|
setting('portal', 'portal_button_style', 'icon-and-text'),
|
||||||
updated_by: 1,
|
setting('portal', 'portal_button_icon', null),
|
||||||
value: ''
|
setting('portal', 'portal_button_signup_text', 'Subscribe'),
|
||||||
},
|
|
||||||
{
|
// EMAIL
|
||||||
id: 11,
|
setting('email', 'mailgun_domain', null),
|
||||||
created_at: '2015-09-11T09:44:30.809Z',
|
setting('email', 'mailgun_api_key', null),
|
||||||
created_by: 1,
|
setting('email', 'mailgun_base_url', null),
|
||||||
key: 'codeinjection_foot',
|
setting('email', 'email_track_opens', 'true'),
|
||||||
group: 'site',
|
setting('email', 'email_verification_required', 'false'),
|
||||||
updated_at: '2015-09-23T13:32:49.858Z',
|
|
||||||
updated_by: 1,
|
// AMP
|
||||||
value: ''
|
setting('amp', 'amp', 'false'),
|
||||||
},
|
setting('amp', 'amp_gtag_id', null),
|
||||||
{
|
|
||||||
id: 12,
|
// FIRSTPROMOTER
|
||||||
key: 'labs',
|
setting('firstpromoter', 'firstpromoter', 'false'),
|
||||||
value: JSON.stringify({
|
setting('firstpromoter', 'firstpromoter_id', null),
|
||||||
// Keep the GA flags that are not yet cleaned up in frontend code here
|
|
||||||
}),
|
// LABS
|
||||||
group: 'labs',
|
setting('labs', 'labs', JSON.stringify({
|
||||||
created_at: '2015-01-12T18:29:01.000Z',
|
// Keep the GA flags that are not yet cleaned up in frontend code here
|
||||||
created_by: 1,
|
})),
|
||||||
updated_at: '2015-10-27T17:39:58.288Z',
|
|
||||||
updated_by: 1
|
// SLACK
|
||||||
},
|
setting('slack', 'slack_url', ''),
|
||||||
{
|
setting('slack', 'slack_username', 'Ghost'),
|
||||||
id: 13,
|
|
||||||
created_at: '2015-09-11T09:44:30.810Z',
|
// UNSPLASH
|
||||||
created_by: 1,
|
setting('unsplash', 'unsplash', 'true'),
|
||||||
key: 'navigation',
|
|
||||||
group: 'site',
|
// VIEWS
|
||||||
updated_at: '2015-09-23T13:32:49.868Z',
|
setting('views', 'shared_views', JSON.stringify([])),
|
||||||
updated_by: 1,
|
|
||||||
value: JSON.stringify([
|
// EDITOR
|
||||||
{label: 'Home', url: '/'},
|
setting('editor', 'editor_default_email_recipients', 'visibility'),
|
||||||
{label: 'About', url: '/about'}
|
setting('editor', 'editor_default_email_recipients_filter', 'all')
|
||||||
])
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 14,
|
|
||||||
created_at: '2015-09-11T09:44:30.810Z',
|
|
||||||
created_by: 1,
|
|
||||||
key: 'is_private',
|
|
||||||
group: 'private',
|
|
||||||
updated_at: '2015-09-23T13:32:49.868Z',
|
|
||||||
updated_by: 1,
|
|
||||||
value: false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 15,
|
|
||||||
created_at: '2015-09-11T09:44:30.810Z',
|
|
||||||
created_by: 1,
|
|
||||||
key: 'password',
|
|
||||||
group: 'private',
|
|
||||||
updated_at: '2015-09-23T13:32:49.868Z',
|
|
||||||
updated_by: 1,
|
|
||||||
value: ''
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 16,
|
|
||||||
created_at: '2016-05-05T15:04:03.115Z',
|
|
||||||
created_by: 1,
|
|
||||||
key: 'slack_username',
|
|
||||||
group: 'slack',
|
|
||||||
updated_at: '2022-05-05T18:33:09.168Z',
|
|
||||||
updated_by: 1,
|
|
||||||
value: 'Ghost'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 17,
|
|
||||||
created_at: '2016-05-05T15:40:12.133Z',
|
|
||||||
created_by: 1,
|
|
||||||
key: 'facebook',
|
|
||||||
group: 'site',
|
|
||||||
updated_at: '2016-05-08T15:20:25.953Z',
|
|
||||||
updated_by: 1,
|
|
||||||
value: 'test'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 18,
|
|
||||||
created_at: '2016-05-05T15:40:12.134Z',
|
|
||||||
created_by: 1,
|
|
||||||
key: 'twitter',
|
|
||||||
group: 'site',
|
|
||||||
updated_at: '2016-05-08T15:20:25.954Z',
|
|
||||||
updated_by: 1,
|
|
||||||
value: '@test'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 19,
|
|
||||||
created_at: '2015-09-11T09:44:30.810Z',
|
|
||||||
created_by: 1,
|
|
||||||
key: 'timezone',
|
|
||||||
group: 'site',
|
|
||||||
updated_at: '2015-09-23T13:32:49.868Z',
|
|
||||||
updated_by: 1,
|
|
||||||
value: 'Etc/UTC'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 21,
|
|
||||||
created_at: '2017-01-09T08:40:59.000Z',
|
|
||||||
created_by: 1,
|
|
||||||
key: 'amp',
|
|
||||||
group: 'amp',
|
|
||||||
updated_at: '2017-01-09T08:49:42.991Z',
|
|
||||||
updated_by: 1,
|
|
||||||
value: 'true'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 22,
|
|
||||||
key: 'icon',
|
|
||||||
value: '/content/images/2014/Feb/favicon.ico',
|
|
||||||
group: 'site',
|
|
||||||
created_at: '2013-11-25T14:48:11.000Z',
|
|
||||||
created_by: 1,
|
|
||||||
updated_at: '2015-10-27T17:39:58.276Z',
|
|
||||||
updated_by: 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 23,
|
|
||||||
group: 'members',
|
|
||||||
key: 'members_subscription_settings',
|
|
||||||
value: '{"allowSelfSignup":true,"fromAddress":"noreply","paymentProcessors":[{"adapter":"stripe","config":{"secret_token":"","public_token":"","tier":{"name":"Ghost Subscription"},"plans":[{"name":"Monthly","currency":"usd","interval":"month","amount":""},{"name":"Yearly","currency":"usd","interval":"year","amount":""}]}}]}',
|
|
||||||
created_at: '2019-10-09T09:49:00.000Z',
|
|
||||||
created_by: 1,
|
|
||||||
updated_at: '2019-10-09T09:49:00.000Z',
|
|
||||||
updated_by: 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 24,
|
|
||||||
group: 'email',
|
|
||||||
key: 'bulk_email_settings',
|
|
||||||
value: '{"provider":"mailgun","apiKey":"","domain":"","baseUrl":""}',
|
|
||||||
created_at: '2019-10-09T09:49:00.000Z',
|
|
||||||
created_by: 1,
|
|
||||||
updated_at: '2019-10-09T09:49:00.000Z',
|
|
||||||
updated_by: 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 25,
|
|
||||||
key: 'secondary_navigation',
|
|
||||||
group: 'site',
|
|
||||||
created_at: '2019-11-20T09:44:30.810Z',
|
|
||||||
created_by: 1,
|
|
||||||
updated_at: '2019-11-20T13:32:49.868Z',
|
|
||||||
updated_by: 1,
|
|
||||||
value: JSON.stringify([])
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 26,
|
|
||||||
created_at: '2020-01-09T08:40:59.000Z',
|
|
||||||
created_by: 1,
|
|
||||||
key: 'unsplash',
|
|
||||||
group: 'unsplash',
|
|
||||||
updated_at: '2020-01-09T08:49:42.991Z',
|
|
||||||
updated_by: 1,
|
|
||||||
value: 'true'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 27,
|
|
||||||
created_at: '2021-11-01T15:44:43.494Z',
|
|
||||||
created_by: 1,
|
|
||||||
key: 'active_theme',
|
|
||||||
group: 'theme',
|
|
||||||
updated_at: '2021-11-01T15:44:43.494Z',
|
|
||||||
updated_by: 1,
|
|
||||||
value: 'casper'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 28,
|
|
||||||
created_at: '2022-02-16T09:38:00.000Z',
|
|
||||||
created_by: 1,
|
|
||||||
key: 'members_signup_access',
|
|
||||||
group: 'members',
|
|
||||||
updated_at: '2022-02-16T09:38:00.000Z',
|
|
||||||
updated_by: 1,
|
|
||||||
value: 'all'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 29,
|
|
||||||
created_at: '2022-02-16T09:38:00.000Z',
|
|
||||||
created_by: 1,
|
|
||||||
key: 'default_content_visibility',
|
|
||||||
group: 'members',
|
|
||||||
updated_at: '2022-02-16T09:38:00.000Z',
|
|
||||||
updated_by: 1,
|
|
||||||
value: 'public'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 30,
|
|
||||||
created_at: '2022-02-16T09:38:00.000Z',
|
|
||||||
created_by: 1,
|
|
||||||
key: 'default_content_visibility_tiers',
|
|
||||||
group: 'members',
|
|
||||||
updated_at: '2022-02-16T09:38:00.000Z',
|
|
||||||
updated_by: 1,
|
|
||||||
value: '[]'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 31,
|
|
||||||
created_at: '2022-02-21T13:47:00.000Z',
|
|
||||||
created_by: 1,
|
|
||||||
key: 'email_track_opens',
|
|
||||||
group: 'email',
|
|
||||||
updated_at: '2022-02-21T13:47:00.000Z',
|
|
||||||
updated_by: 1,
|
|
||||||
value: 'true'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 33,
|
|
||||||
created_at: '2016-05-05T15:04:03.115Z',
|
|
||||||
created_by: 1,
|
|
||||||
key: 'slack_url',
|
|
||||||
group: 'slack',
|
|
||||||
updated_at: '2022-05-05T18:33:09.168Z',
|
|
||||||
updated_by: 1,
|
|
||||||
value: ''
|
|
||||||
}
|
|
||||||
];
|
];
|
||||||
|
|
|
@ -66,19 +66,19 @@ describe('Acceptance: Settings - Integrations - AMP', function () {
|
||||||
// has correct url
|
// has correct url
|
||||||
expect(currentURL(), 'currentURL').to.equal('/settings/integrations/amp');
|
expect(currentURL(), 'currentURL').to.equal('/settings/integrations/amp');
|
||||||
|
|
||||||
// AMP is enabled by default
|
// AMP is disabled by default
|
||||||
expect(find('[data-test-amp-checkbox]').checked, 'AMP checkbox').to.be.true;
|
expect(find('[data-test-amp-checkbox]').checked, 'AMP checkbox').to.be.false;
|
||||||
|
|
||||||
await click('[data-test-amp-checkbox]');
|
await click('[data-test-amp-checkbox]');
|
||||||
|
|
||||||
expect(find('[data-test-amp-checkbox]').checked, 'AMP checkbox').to.be.false;
|
expect(find('[data-test-amp-checkbox]').checked, 'AMP checkbox').to.be.true;
|
||||||
|
|
||||||
await click('[data-test-save-button]');
|
await click('[data-test-save-button]');
|
||||||
|
|
||||||
let [lastRequest] = this.server.pretender.handledRequests.slice(-1);
|
let [lastRequest] = this.server.pretender.handledRequests.slice(-1);
|
||||||
let params = JSON.parse(lastRequest.requestBody);
|
let params = JSON.parse(lastRequest.requestBody);
|
||||||
|
|
||||||
expect(params.settings.findBy('key', 'amp').value).to.equal(false);
|
expect(params.settings.findBy('key', 'amp').value).to.equal(true);
|
||||||
|
|
||||||
// CMD-S shortcut works
|
// CMD-S shortcut works
|
||||||
await click('[data-test-amp-checkbox]');
|
await click('[data-test-amp-checkbox]');
|
||||||
|
@ -93,8 +93,8 @@ describe('Acceptance: Settings - Integrations - AMP', function () {
|
||||||
let [newRequest] = this.server.pretender.handledRequests.slice(-1);
|
let [newRequest] = this.server.pretender.handledRequests.slice(-1);
|
||||||
params = JSON.parse(newRequest.requestBody);
|
params = JSON.parse(newRequest.requestBody);
|
||||||
|
|
||||||
expect(find('[data-test-amp-checkbox]').checked, 'AMP checkbox').to.be.true;
|
expect(find('[data-test-amp-checkbox]').checked, 'AMP checkbox').to.be.false;
|
||||||
expect(params.settings.findBy('key', 'amp').value).to.equal(true);
|
expect(params.settings.findBy('key', 'amp').value).to.equal(false);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('warns when leaving without saving', async function () {
|
it('warns when leaving without saving', async function () {
|
||||||
|
@ -103,12 +103,12 @@ describe('Acceptance: Settings - Integrations - AMP', function () {
|
||||||
// has correct url
|
// has correct url
|
||||||
expect(currentURL(), 'currentURL').to.equal('/settings/integrations/amp');
|
expect(currentURL(), 'currentURL').to.equal('/settings/integrations/amp');
|
||||||
|
|
||||||
// AMP is enabled by default
|
// AMP is disabled by default
|
||||||
expect(find('[data-test-amp-checkbox]').checked, 'AMP checkbox default').to.be.true;
|
expect(find('[data-test-amp-checkbox]').checked, 'AMP checkbox default').to.be.false;
|
||||||
|
|
||||||
await click('[data-test-amp-checkbox]');
|
await click('[data-test-amp-checkbox]');
|
||||||
|
|
||||||
expect(find('[data-test-amp-checkbox]').checked, 'AMP checkbox after click').to.be.false;
|
expect(find('[data-test-amp-checkbox]').checked, 'AMP checkbox after click').to.be.true;
|
||||||
|
|
||||||
await visit('/settings/staff');
|
await visit('/settings/staff');
|
||||||
|
|
||||||
|
@ -124,7 +124,7 @@ describe('Acceptance: Settings - Integrations - AMP', function () {
|
||||||
expect(currentURL(), 'currentURL after return').to.equal('/settings/integrations/amp');
|
expect(currentURL(), 'currentURL after return').to.equal('/settings/integrations/amp');
|
||||||
|
|
||||||
// settings were not saved
|
// settings were not saved
|
||||||
expect(find('[data-test-amp-checkbox]').checked, 'AMP checkbox').to.be.true;
|
expect(find('[data-test-amp-checkbox]').checked, 'AMP checkbox').to.be.false;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -82,7 +82,7 @@ describe('Acceptance: Settings - Code-Injection', function () {
|
||||||
let [lastRequest] = this.server.pretender.handledRequests.slice(-1);
|
let [lastRequest] = this.server.pretender.handledRequests.slice(-1);
|
||||||
let params = JSON.parse(lastRequest.requestBody);
|
let params = JSON.parse(lastRequest.requestBody);
|
||||||
|
|
||||||
expect(params.settings.findBy('key', 'codeinjection_head').value).to.equal('');
|
expect(params.settings.findBy('key', 'codeinjection_head').value).to.equal(null);
|
||||||
expect(find('[data-test-save-button]').textContent.trim(), 'save button text').to.equal('Save');
|
expect(find('[data-test-save-button]').textContent.trim(), 'save button text').to.equal('Save');
|
||||||
|
|
||||||
// CMD-S shortcut works
|
// CMD-S shortcut works
|
||||||
|
@ -96,7 +96,7 @@ describe('Acceptance: Settings - Code-Injection', function () {
|
||||||
let [newRequest] = this.server.pretender.handledRequests.slice(-1);
|
let [newRequest] = this.server.pretender.handledRequests.slice(-1);
|
||||||
params = JSON.parse(newRequest.requestBody);
|
params = JSON.parse(newRequest.requestBody);
|
||||||
|
|
||||||
expect(params.settings.findBy('key', 'codeinjection_head').value).to.equal('');
|
expect(params.settings.findBy('key', 'codeinjection_head').value).to.equal(null);
|
||||||
expect(find('[data-test-save-button]').textContent.trim(), 'save button text').to.equal('Save');
|
expect(find('[data-test-save-button]').textContent.trim(), 'save button text').to.equal('Save');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -92,13 +92,15 @@ describe('Acceptance: Settings - Integrations - Custom', function () {
|
||||||
|
|
||||||
describe('navigation', function () {
|
describe('navigation', function () {
|
||||||
beforeEach(async function () {
|
beforeEach(async function () {
|
||||||
|
this.server.loadFixtures('settings');
|
||||||
|
|
||||||
let role = this.server.create('role', {name: 'Administrator'});
|
let role = this.server.create('role', {name: 'Administrator'});
|
||||||
this.server.create('user', {roles: [role]});
|
this.server.create('user', {roles: [role]});
|
||||||
|
|
||||||
return await authenticateSession();
|
return await authenticateSession();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('renders correctly', async function () {
|
it('renders defaults correctly', async function () {
|
||||||
await visit('/settings/integrations');
|
await visit('/settings/integrations');
|
||||||
|
|
||||||
// slack is not configured in the fixtures
|
// slack is not configured in the fixtures
|
||||||
|
@ -107,7 +109,18 @@ describe('Acceptance: Settings - Integrations - Custom', function () {
|
||||||
'slack app status'
|
'slack app status'
|
||||||
).to.equal('Configure');
|
).to.equal('Configure');
|
||||||
|
|
||||||
// amp is enabled in the fixtures
|
// amp is disabled in the fixtures
|
||||||
|
expect(
|
||||||
|
find('[data-test-app="amp"] [data-test-app-status]').textContent.trim(),
|
||||||
|
'amp app status'
|
||||||
|
).to.equal('Configure');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('renders AMP active state', async function () {
|
||||||
|
this.server.db.settings.update({key: 'amp', value: true});
|
||||||
|
await visit('/settings/integrations');
|
||||||
|
|
||||||
|
// amp switches to active when enabled
|
||||||
expect(
|
expect(
|
||||||
find('[data-test-app="amp"] [data-test-app-status]').textContent.trim(),
|
find('[data-test-app="amp"] [data-test-app-status]').textContent.trim(),
|
||||||
'amp app status'
|
'amp app status'
|
||||||
|
|
Loading…
Add table
Reference in a new issue