From d552d06a87cc7d598ca395d3d07fa91f439fc783 Mon Sep 17 00:00:00 2001 From: calcaide Date: Mon, 9 Dec 2024 16:59:58 -0800 Subject: [PATCH] Change validation field from name (optional) to address (required) --- .../tests/acceptance/host-catalogs/hosts/create-test.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/ui/admin/tests/acceptance/host-catalogs/hosts/create-test.js b/ui/admin/tests/acceptance/host-catalogs/hosts/create-test.js index 17b003aa3e..ccb2b23a20 100644 --- a/ui/admin/tests/acceptance/host-catalogs/hosts/create-test.js +++ b/ui/admin/tests/acceptance/host-catalogs/hosts/create-test.js @@ -129,8 +129,6 @@ module('Acceptance | host-catalogs | hosts | create', function (hooks) { 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) { this.server.post('/hosts', () => { return new Response( @@ -143,8 +141,8 @@ module('Acceptance | host-catalogs | hosts | create', function (hooks) { details: { request_fields: [ { - name: 'name', - description: 'Name is required.', + name: 'address', + description: 'Address is required.', }, ], }, @@ -158,7 +156,7 @@ module('Acceptance | host-catalogs | hosts | create', function (hooks) { .dom(commonSelectors.ALERT_TOAST_BODY) .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) {