Change validation field from name (optional) to address (required) (#2619)

This commit is contained in:
Carlos Alcaide Corvo authored and GitHub committed 2024-12-11 08:04:45 -08:00
1 parent 0623d4ad47
commit 40c8ceeca6
1 file changed
+3 -5
@@ -129,8 +129,6 @@ module('Acceptance | host-catalogs | hosts | create', function (hooks) {
assert.strictEqual(getHostCount(), count); assert.strictEqual(getHostCount(), count);
}); });
// TODO: the field should change to address and not name. Name is optional for host but address
// is required, so to make the test realistic we should be testing address
test('saving a new host with invalid fields displays error messages', async function (assert) { test('saving a new host with invalid fields displays error messages', async function (assert) {
this.server.post('/hosts', () => { this.server.post('/hosts', () => {
return new Response( return new Response(
@@ -143,8 +141,8 @@ module('Acceptance | host-catalogs | hosts | create', function (hooks) {
details: { details: {
request_fields: [ request_fields: [
{ {
name: 'name', name: 'address',
description: 'Name is required.', description: 'Address is required.',
}, },
], ],
}, },
@@ -158,7 +156,7 @@ module('Acceptance | host-catalogs | hosts | create', function (hooks) {
.dom(commonSelectors.ALERT_TOAST_BODY) .dom(commonSelectors.ALERT_TOAST_BODY)
.hasText('The request was invalid.'); .hasText('The request was invalid.');
assert.dom(commonSelectors.FIELD_NAME_ERROR).hasText('Name is required.'); assert.dom(selectors.FIELD_ADDRESS_ERROR).hasText('Address is required.');
}); });
test('users cannot directly navigate to new host route without proper authorization', async function (assert) { test('users cannot directly navigate to new host route without proper authorization', async function (assert) {