feat: 🎸 add No scopes add to roles/role/scopes route (#2338)

* feat: 🎸 add No scopes add to roles/role/scopes route

✅ Closes: https://hashicorp.atlassian.net/browse/ICU-13878

* feat: 🎸 add new role ability

✅ Closes: https://hashicorp.atlassian.net/browse/ICU-13878

* refactor: 💡 fix permission for setting grant scopes on role

✅ Closes: https://hashicorp.atlassian.net/browse/ICU-13878
This commit is contained in:
Cameron Perera authored and Lisbet Alvarez committed 2024-07-15 17:23:00 -07:00
1 parent 2bc314d271
commit 85bce84356
9 files changed
+67 -7

No files matched your search

@@ -75,4 +75,22 @@ module('Acceptance | roles | scopes', function (hooks) {
`/scopes/${instances.scopes.global.id}/scopes`,
);
});
test('user sees no scopes message and action when role has no grant scopes', async function (assert) {
instances.role.update({ grant_scope_ids: [] });
await visit(urls.roleScopes);
assert.dom('.role-grant-scopes div').includesText('No scopes added');
assert.dom('.role-grant-scopes div div:nth-child(3) a').isVisible();
});
test('user does not see action to add scopes when role has no grant scopes without proper permissions', async function (assert) {
instances.role.update({
grant_scope_ids: [],
authorized_actions: instances.role.authorized_actions.filter(
(action) => action !== 'set-grant-scopes',
),
});
await visit(urls.roleScopes);
assert.dom('.role-grant-scopes div div:nth-child(3) a').doesNotExist();
});
});