From 4423c53cc4a79a7f350a2a91a068bc3981e13eeb Mon Sep 17 00:00:00 2001 From: dharini Date: Thu, 2 Sep 2021 15:58:45 -0700 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9B=20add=20test=20for=20manage?= =?UTF-8?q?=20catalog=20options?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../host-catalogs/host-sets/create-test.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) 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'] = [];