2018-09-25 16:28:26 +00:00
|
|
|
import { module, test } from 'qunit';
|
|
|
|
import { setupRenderingTest } from 'ember-qunit';
|
|
|
|
import { render, findAll, find } from '@ember/test-helpers';
|
2018-04-03 14:16:57 +00:00
|
|
|
import hbs from 'htmlbars-inline-precompile';
|
|
|
|
|
2018-09-25 16:28:26 +00:00
|
|
|
module('Integration | Component | upgrade page', function(hooks) {
|
|
|
|
setupRenderingTest(hooks);
|
2018-04-03 14:16:57 +00:00
|
|
|
|
2018-09-25 16:28:26 +00:00
|
|
|
test('it renders with defaults', async function(assert) {
|
|
|
|
await render(hbs`
|
|
|
|
{{upgrade-page}}
|
|
|
|
<div id="modal-wormhole"></div>
|
|
|
|
`);
|
2018-04-03 14:16:57 +00:00
|
|
|
|
2018-09-25 16:28:26 +00:00
|
|
|
assert.equal(
|
2019-06-14 21:46:18 +00:00
|
|
|
find('.page-header .title').textContent.trim(),
|
|
|
|
'Vault Enterprise',
|
|
|
|
'renders default page title'
|
|
|
|
);
|
|
|
|
assert.equal(
|
|
|
|
find('[data-test-empty-state-title]').textContent.trim(),
|
|
|
|
'Upgrade to use this feature',
|
|
|
|
'renders default title'
|
|
|
|
);
|
|
|
|
assert.equal(
|
|
|
|
find('[data-test-empty-state-message]').textContent.trim(),
|
|
|
|
'You will need Vault Enterprise with this feature included to use this feature.',
|
|
|
|
'renders default message'
|
2018-09-25 16:28:26 +00:00
|
|
|
);
|
|
|
|
assert.equal(findAll('[data-test-upgrade-link]').length, 1, 'renders upgrade link');
|
|
|
|
});
|
2018-04-03 14:16:57 +00:00
|
|
|
|
2018-09-25 16:28:26 +00:00
|
|
|
test('it renders with custom attributes', async function(assert) {
|
|
|
|
await render(hbs`
|
2019-06-14 21:46:18 +00:00
|
|
|
{{upgrade-page title="Test Feature Title" featureName="Specific Feature Name" minimumEdition="Vault Enterprise Premium"}}
|
2018-09-25 16:28:26 +00:00
|
|
|
<div id="modal-wormhole"></div>
|
|
|
|
`);
|
2018-04-03 14:16:57 +00:00
|
|
|
|
2018-09-25 16:28:26 +00:00
|
|
|
assert.equal(
|
|
|
|
find('.page-header .title').textContent.trim(),
|
|
|
|
'Test Feature Title',
|
2019-06-14 21:46:18 +00:00
|
|
|
'renders custom page title'
|
|
|
|
);
|
|
|
|
assert.equal(
|
|
|
|
find('[data-test-empty-state-title]').textContent.trim(),
|
|
|
|
'Upgrade to use Specific Feature Name',
|
|
|
|
'renders custom title'
|
2018-09-25 16:28:26 +00:00
|
|
|
);
|
|
|
|
assert.equal(
|
2019-06-14 21:46:18 +00:00
|
|
|
find('[data-test-empty-state-message]').textContent.trim(),
|
|
|
|
'You will need Vault Enterprise Premium with Specific Feature Name included to use this feature.',
|
|
|
|
'renders custom message'
|
2018-09-25 16:28:26 +00:00
|
|
|
);
|
|
|
|
});
|
2018-04-03 14:16:57 +00:00
|
|
|
});
|