chore: 🤖 Migrate form.inpu to use Hds::TextInput::Field` (#2145)

* chore: 🤖 Migrate `form.inpu` to use Hds::TextInput::Field`

Migrate `form/group`, `form/host-static`, `form/host-catalog/aws` and
`form/host-catalog/azure` forms to use `Hds::TextInputField instead of
`form.input`

✅ Closes: https://hashicorp.atlassian.net/browse/ICU-12466

* refactor: 💡 use `data-test` attributes for testing

use `data-test` attributes for testing error messaging.

✅ Closes: https://hashicorp.atlassian.net/browse/ICU-12466

* refactor: 💡 field argument cleanup

field argument cleanup

✅ Closes: https://hashicorp.atlassian.net/browse/ICU-12466

* refactor: 💡 switch `disabled` argument to `readonly`

switch `disabled` argument to `readonly`

✅ Closes: https://hashicorp.atlassian.net/browse/ICU-12466
This commit is contained in:
Devon Anderson authored and GitHub committed 2024-02-27 13:52:50 -05:00
1 parent 3fc865d226
commit 26a77edbc7
11 files changed
+198 -160

No files matched your search

@@ -115,7 +115,7 @@ module('Acceptance | groups | create', function (hooks) {
'Displays primary error message.',
);
assert.strictEqual(
find('.rose-form-error-message').textContent.trim(),
find('[data-test-error-message-name]').textContent.trim(),
'Name is required.',
'Displays field-level errors.',
);
@@ -102,7 +102,7 @@ module('Acceptance | groups | update', function (hooks) {
'Displays primary error message.',
);
assert.strictEqual(
find('.rose-form-error-message').textContent.trim(),
find('[data-test-error-message-name]').textContent.trim(),
'Name is required.',
'Displays field-level errors.',
);
@@ -188,7 +188,7 @@ module('Acceptance | host-catalogs | create', function (hooks) {
'The request was invalid.',
);
assert.ok(
find('.rose-form-error-message').textContent.trim(),
find('[data-test-error-message-name]').textContent.trim(),
'Name is required.',
);
});
@@ -151,7 +151,7 @@ module('Acceptance | host-catalogs | hosts | create', function (hooks) {
'The request was invalid.',
);
assert.ok(
find('.rose-form-error-message').textContent.trim(),
find('[data-test-error-message-name]').textContent.trim(),
'Name is required.',
);
});
@@ -130,7 +130,7 @@ module('Acceptance | host-catalogs | hosts | update', function (hooks) {
'The request was invalid.',
);
assert.ok(
find('.rose-form-error-message').textContent.trim(),
find('[data-test-error-message-name]').textContent.trim(),
'Name is required.',
);
});
@@ -123,7 +123,7 @@ module('Acceptance | host-catalogs | update', function (hooks) {
await click('[type="submit"]');
assert.dom('[role="alert"] div').hasText('The request was invalid.');
assert.dom('.rose-form-error-message').hasText('Name is required.');
assert.dom('[data-test-error-message-name]').hasText('Name is required.');
});
test('can discard unsaved host catalog changes via dialog', async function (assert) {