mirror of
https://github.com/hashicorp/vault.git
synced 2026-02-19 02:49:18 -05:00
* Update page headers that were missed in other prs * VAULT-40928 replication headers * VAULT-40926 swagger ui page header * VAULT-40921 remaining core pageheader * VAULT-40929 sync headeres * Fix replication tests * Fix tests! * Fix eslint error * Fix mislabel * Add badge selector * Fix failing tests Co-authored-by: Kianna <30884335+kiannaquach@users.noreply.github.com>
62 lines
2.1 KiB
JavaScript
62 lines
2.1 KiB
JavaScript
/**
|
|
* Copyright IBM Corp. 2016, 2025
|
|
* SPDX-License-Identifier: BUSL-1.1
|
|
*/
|
|
|
|
import { module, test } from 'qunit';
|
|
import { setupRenderingTest } from 'ember-qunit';
|
|
import { setupEngine } from 'ember-engines/test-support';
|
|
import hbs from 'htmlbars-inline-precompile';
|
|
import { render } from '@ember/test-helpers';
|
|
import { PAGE } from 'vault/tests/helpers/sync/sync-selectors';
|
|
import { GENERAL } from 'vault/tests/helpers/general-selectors';
|
|
|
|
const { breadcrumb } = PAGE;
|
|
|
|
module('Integration | Component | sync | SyncHeader', function (hooks) {
|
|
setupRenderingTest(hooks);
|
|
setupEngine(hooks, 'sync');
|
|
|
|
hooks.beforeEach(function () {
|
|
this.version = this.owner.lookup('service:version');
|
|
this.flags = this.owner.lookup('service:flags');
|
|
this.title = 'Secrets Sync';
|
|
this.renderComponent = () => {
|
|
return render(hbs`<SyncHeader @title={{this.title}} @breadcrumbs={{this.breadcrumbs}} />`, {
|
|
owner: this.engine,
|
|
});
|
|
};
|
|
});
|
|
|
|
test('it should render breadcrumbs', async function (assert) {
|
|
this.breadcrumbs = [{ label: 'Destinations', route: 'destinations' }];
|
|
await this.renderComponent();
|
|
assert.dom(breadcrumb).includesText('Destinations', 'renders breadcrumb');
|
|
});
|
|
|
|
module('ent', function (hooks) {
|
|
hooks.beforeEach(async function () {
|
|
this.version.type = 'enterprise';
|
|
});
|
|
|
|
test('it should render title if license has secrets sync feature', async function (assert) {
|
|
this.version.features = ['Secrets Sync'];
|
|
await this.renderComponent();
|
|
|
|
assert.dom(GENERAL.hdsPageHeaderTitle).hasText('Secrets Sync');
|
|
});
|
|
});
|
|
|
|
module('managed', function (hooks) {
|
|
hooks.beforeEach(function () {
|
|
this.version.type = 'enterprise';
|
|
this.flags.featureFlags = ['VAULT_CLOUD_ADMIN_NAMESPACE'];
|
|
});
|
|
|
|
test('it should render title and plus badge', async function (assert) {
|
|
await this.renderComponent();
|
|
assert.dom(GENERAL.hdsPageHeaderTitle).hasText('Secrets Sync');
|
|
assert.dom(GENERAL.badge('Plus feature')).hasText('Plus feature', 'Plus feature badge renders');
|
|
});
|
|
});
|
|
});
|