mirror of
https://github.com/hashicorp/vault.git
synced 2025-08-10 08:37:00 +02:00
* adds LinkStatus component to NavHeader to display banner with HCP link status * adds changelog entry * adds period to connected status message * updates hcp link status to current cluster polling to automatically update state
37 lines
1.3 KiB
JavaScript
37 lines
1.3 KiB
JavaScript
import { module, test } from 'qunit';
|
|
import { setupRenderingTest } from 'ember-qunit';
|
|
import { render } from '@ember/test-helpers';
|
|
import { hbs } from 'ember-cli-htmlbars';
|
|
import { setupMirage } from 'ember-cli-mirage/test-support';
|
|
|
|
module('Integration | Component | link-status', function (hooks) {
|
|
setupRenderingTest(hooks);
|
|
setupMirage(hooks);
|
|
|
|
// this can be removed once feature is released for OSS
|
|
hooks.beforeEach(function () {
|
|
this.owner.lookup('service:version').set('isEnterprise', true);
|
|
});
|
|
|
|
test('it does not render disconnected status', async function (assert) {
|
|
await render(hbs`<LinkStatus @status="disconnected" />`);
|
|
|
|
assert.dom('.navbar-status').doesNotExist('Banner is hidden for disconnected state');
|
|
});
|
|
|
|
test('it renders connected status', async function (assert) {
|
|
await render(hbs`<LinkStatus @status="connected" />`);
|
|
|
|
assert.dom('.navbar-status').hasClass('connected', 'Correct class renders for connected state');
|
|
assert
|
|
.dom('[data-test-link-status]')
|
|
.hasText(
|
|
'This self-managed Vault is linked to the HashiCorp Cloud Platform.',
|
|
'Copy renders for connected state'
|
|
);
|
|
assert
|
|
.dom('[data-test-link-status] a')
|
|
.hasAttribute('href', 'https://portal.cloud.hashicorp.com/sign-in', 'HCP sign in link renders');
|
|
});
|
|
});
|