Skip to content

Commit

Permalink
Change validation field from name (optional) to address (required)
Browse files Browse the repository at this point in the history
  • Loading branch information
calcaide committed Dec 10, 2024
1 parent b59afd3 commit d552d06
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions ui/admin/tests/acceptance/host-catalogs/hosts/create-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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.',
},
],
},
Expand All @@ -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) {
Expand Down

0 comments on commit d552d06

Please sign in to comment.