diff --git a/ui/admin/tests/acceptance/host-catalogs/host-sets/create-test.js b/ui/admin/tests/acceptance/host-catalogs/host-sets/create-test.js index 732b6db48..a7ede23ed 100644 --- a/ui/admin/tests/acceptance/host-catalogs/host-sets/create-test.js +++ b/ui/admin/tests/acceptance/host-catalogs/host-sets/create-test.js @@ -70,7 +70,7 @@ module('Acceptance | host-catalogs | host sets | create', function (hooks) { authenticateSession({}); }); - test('can create new host', async function (assert) { + test('can create new host sets', async function (assert) { assert.expect(1); const count = getHostSetCount(); await visit(urls.newHostSet); @@ -79,6 +79,18 @@ module('Acceptance | host-catalogs | host sets | create', function (hooks) { assert.equal(getHostSetCount(), count + 1); }); + test('Users cannot create a new host set without proper authorization', async function (assert) { + assert.expect(2); + instances.hostCatalog.authorized_collection_actions['host-sets'] = []; + await visit(urls.hostCatalog); + assert.notOk( + instances.hostCatalog.authorized_collection_actions['host-sets'].includes( + 'create' + ) + ); + assert.notOk(find(`.rose-layout-page-actions [href="${urls.newHostSet}"]`)); + }); + test('Users cannot navigate to new host sets route without proper authorization', async function (assert) { assert.expect(2); instances.hostCatalog.authorized_collection_actions['host-sets'] = [];