mirror of
https://github.com/hashicorp/vault.git
synced 2026-05-28 04:10:44 -04:00
* copies v2 form components from POC branch * fixes issue in form-config-generator when path parameters are not defined * adds api code-generator for snippet creation * expands cli and terraform code generators * updates form-config-generator to return api path from spec * fixes issue setting field value in v2-form class * updates form-config types * updates v2 form and renderer components to conditional render fields * adds v2 form apply component * updates v2 form wizard component to support apply step * add support for field types (text input variants, text area, checkbox, radio, masked input) and add test coverage * Dynamic field visibility and Select field support * [POC] Public PKI (mocked) Wizard - revert this before merging * Revert "[POC] Public PKI (mocked) Wizard - revert this before merging" This reverts commit 66646f1d7a71d0e67028ebcabcfe33925197ffc9. * cleanup & address copilot pr comments * address PR comments --------- Co-authored-by: Shannon Roberts (Beagin) <beagins@users.noreply.github.com> Co-authored-by: Jordan Reimer <jordan.reimer@hashicorp.com>
47 lines
1.6 KiB
JavaScript
47 lines
1.6 KiB
JavaScript
/**
|
|
* Copyright IBM Corp. 2016, 2026
|
|
* SPDX-License-Identifier: BUSL-1.1
|
|
*/
|
|
|
|
import { render } from '@ember/test-helpers';
|
|
import { hbs } from 'ember-cli-htmlbars';
|
|
import { module, test } from 'qunit';
|
|
import { setupRenderingTest } from 'vault/tests/helpers';
|
|
|
|
module('Integration | Component | form/v2/error-alert', function (hooks) {
|
|
setupRenderingTest(hooks);
|
|
|
|
test('it renders the default title and error message', async function (assert) {
|
|
this.error = 'Something went wrong';
|
|
|
|
await render(hbs`
|
|
<Form::V2::ErrorAlert @error={{this.error}} />
|
|
`);
|
|
|
|
assert.dom('.hds-alert').exists('renders alert');
|
|
assert.dom('.hds-alert__title').hasText('Submission error', 'renders default title');
|
|
assert.dom('.hds-alert__description').hasText('Something went wrong', 'renders error message');
|
|
});
|
|
|
|
test('it renders a custom title', async function (assert) {
|
|
this.error = 'Configuration failed';
|
|
this.title = 'Configuration Error';
|
|
|
|
await render(hbs`
|
|
<Form::V2::ErrorAlert @error={{this.error}} @title={{this.title}} />
|
|
`);
|
|
|
|
assert.dom('.hds-alert__title').hasText('Configuration Error', 'renders custom title');
|
|
assert.dom('.hds-alert__description').hasText('Configuration failed', 'renders error message');
|
|
});
|
|
|
|
test('it renders without an error message', async function (assert) {
|
|
await render(hbs`
|
|
<Form::V2::ErrorAlert />
|
|
`);
|
|
|
|
assert.dom('.hds-alert').exists('renders alert');
|
|
assert.dom('.hds-alert__title').hasText('Submission error', 'renders default title');
|
|
assert.dom('.hds-alert__description').hasText('', 'renders empty description');
|
|
});
|
|
});
|