mirror of
https://github.com/hashicorp/vault.git
synced 2025-08-19 21:51:09 +02:00
* manual cherry pick to deal with all the merge things * changelog * test fixes * Update 28148.txt * fix tests failures after main merge * fix test failures after main merge * Add Access Type and conditionally render WIF fields (#28149) * initial work. * remove access_type * better no model logic well kind of * rollback attrs * remove defaults * stopping point * wip changing back to sidebranch * hustling shuffling and serializing * some of the component test coverage * disable acces type if editing * test coverage * hide max retries that sneaky bugger * cleanup * cleanup * Update root-config.js * remove flash message check, locally passes great but on ci flaky * clean up * thank you chelsea * test clean up per enterprise vs community * address pr comments * welp a miss add * UI (sidebranch) WIF Issuer field (#28187) * Add type declaration files for aws config models * use updated task syntax for save method on configure-aws * fix types on edit route * fetch issuer on configure edit page if aws + enterprise * track issuer within configure-aws component * add placeholder support on form-field * Add warning if issuer changed from previous value or could not be read * cleanup * preliminary tests * dont use while loop so we can test the modal * tests * cleanup * fix tests * remove extra tracked value and duplicate changed attrs check * modal footer --------- Co-authored-by: Angel Garbarino <argarbarino@gmail.com> * Display issuer on Configuration details (#28209) * display issuer on configuration details * workflow complete, now on to testing * handle issuer things * fix all the broken tests things * add test coveragE: * cleanup * rename model/adapter * Update configure-aws.ts * Update aws-configuration-test.js * 90 percent there for pr comments * last one for tonight * a few more because why not * hasDirtyAttributes fixes * revert back to previous noRead->queryIssuerError --------- Co-authored-by: Chelsea Shaw <82459713+hashishaw@users.noreply.github.com>
58 lines
2.3 KiB
JavaScript
58 lines
2.3 KiB
JavaScript
/**
|
|
* Copyright (c) HashiCorp, Inc.
|
|
* SPDX-License-Identifier: BUSL-1.1
|
|
*/
|
|
|
|
import { module, test } from 'qunit';
|
|
import { setupRenderingTest } from 'vault/tests/helpers';
|
|
import { GENERAL } from 'vault/tests/helpers/general-selectors';
|
|
import { render } from '@ember/test-helpers';
|
|
import { hbs } from 'ember-cli-htmlbars';
|
|
import { CONFIGURABLE_SECRET_ENGINES } from 'vault/helpers/mountable-secret-engines';
|
|
import {
|
|
createConfig,
|
|
expectedConfigKeys,
|
|
expectedValueOfConfigKeys,
|
|
} from 'vault/tests/helpers/secret-engine/secret-engine-helpers';
|
|
|
|
module('Integration | Component | SecretEngine/ConfigurationDetails', function (hooks) {
|
|
setupRenderingTest(hooks);
|
|
|
|
hooks.beforeEach(function () {
|
|
this.store = this.owner.lookup('service:store');
|
|
this.configModels = [];
|
|
});
|
|
|
|
test('it shows prompt message if no config models are passed in', async function (assert) {
|
|
assert.expect(2);
|
|
await render(hbs`
|
|
<SecretEngine::ConfigurationDetails @typeDisplay="Display Name" />
|
|
`);
|
|
assert.dom(GENERAL.emptyStateTitle).hasText(`Display Name not configured`);
|
|
assert.dom(GENERAL.emptyStateMessage).hasText(`Get started by configuring your Display Name engine.`);
|
|
});
|
|
|
|
test('it shows config details if configModel(s) are passed in', async function (assert) {
|
|
assert.expect(21);
|
|
for (const type of CONFIGURABLE_SECRET_ENGINES) {
|
|
const backend = `test-${type}`;
|
|
this.configModels = createConfig(this.store, backend, type);
|
|
|
|
await render(hbs`<SecretEngine::ConfigurationDetails @configModels={{array this.configModels}}/>`);
|
|
for (const key of expectedConfigKeys(type)) {
|
|
assert.dom(GENERAL.infoRowLabel(key)).exists(`${key} on the ${type} config details exists.`);
|
|
const responseKeyAndValue = expectedValueOfConfigKeys(type, key);
|
|
assert
|
|
.dom(GENERAL.infoRowValue(key))
|
|
.hasText(responseKeyAndValue, `${key} value for the ${type} config details exists.`);
|
|
// make sure the ones that should be masked are masked, and others are not.
|
|
if (key === 'private_key' || key === 'public_key') {
|
|
assert.dom(GENERAL.infoRowValue(key)).hasClass('masked-input', `${key} is masked`);
|
|
} else {
|
|
assert.dom(GENERAL.infoRowValue(key)).doesNotHaveClass('masked-input', `${key} is not masked`);
|
|
}
|
|
}
|
|
}
|
|
});
|
|
});
|