-
+
-
diff --git a/ui/lib/core/addon/templates/components/box-radio.hbs b/ui/lib/core/addon/components/box-radio.hbs
similarity index 100%
rename from ui/lib/core/addon/templates/components/box-radio.hbs
rename to ui/lib/core/addon/components/box-radio.hbs
diff --git a/ui/lib/core/addon/components/box-radio.js b/ui/lib/core/addon/components/box-radio.js
index c01c13ba0b..556a13e00a 100644
--- a/ui/lib/core/addon/components/box-radio.js
+++ b/ui/lib/core/addon/components/box-radio.js
@@ -1,3 +1,5 @@
+import Component from '@glimmer/component';
+
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
@@ -21,13 +23,8 @@
* @param {string} [tooltipMessage=default] - The message that shows in the tooltip if the radio option is disabled
*/
-import Component from '@glimmer/component';
-import layout from '../templates/components/box-radio';
-import { setComponentTemplate } from '@ember/component';
-
-class BoxRadio extends Component {
- disabled = false;
- tooltipMessage = 'This option is not available to you at this time.';
+export default class BoxRadio extends Component {
+ get tooltipMessage() {
+ return this.args.tooltipMessage || 'This option is not available to you at this time.';
+ }
}
-
-export default setComponentTemplate(layout, BoxRadio);
diff --git a/ui/lib/core/app/components/alert-popup.js b/ui/lib/core/app/components/alert-popup.js
new file mode 100644
index 0000000000..cc0cbb2212
--- /dev/null
+++ b/ui/lib/core/app/components/alert-popup.js
@@ -0,0 +1 @@
+export { default } from 'core/components/alert-popup';
diff --git a/ui/tests/integration/components/alert-popup-test.js b/ui/tests/integration/components/alert-popup-test.js
new file mode 100644
index 0000000000..25f476e8d5
--- /dev/null
+++ b/ui/tests/integration/components/alert-popup-test.js
@@ -0,0 +1,58 @@
+import { module, test } from 'qunit';
+import { setupRenderingTest } from 'vault/tests/helpers';
+import { render } from '@ember/test-helpers';
+import { hbs } from 'ember-cli-htmlbars';
+import { click } from '@ember/test-helpers';
+
+module('Integration | Component | alert-popup', function (hooks) {
+ setupRenderingTest(hooks);
+
+ hooks.beforeEach(function () {
+ this.set('message', 'some very important alert');
+ this.set('type', 'warning');
+ this.set('close', () => this.set('closed', true));
+ });
+
+ test('it renders the alert popup input', async function (assert) {
+ await render(hbs`
+
+ `);
+
+ assert.dom(this.element).hasText('Warning some very important alert');
+ });
+
+ test('it invokes the close action', async function (assert) {
+ assert.expect(1);
+
+ await render(hbs`
+
+ `);
+ await click('.close-button');
+
+ assert.true(this.closed);
+ });
+
+ test('it renders the alert popup with different colors based on types', async function (assert) {
+ await render(hbs`
+
+ `);
+
+ assert.dom('.message').hasClass('is-highlight');
+
+ this.set('type', 'info');
+
+ await render(hbs`
+
+ `);
+
+ assert.dom('.message').hasClass('is-info');
+
+ this.set('type', 'danger');
+
+ await render(hbs`
+
+ `);
+
+ assert.dom('.message').hasClass('is-danger');
+ });
+});