test: 💍 add missing controller unit tests in admin-ui (#2553)

* test: 💍 add missing controller unit tests in admin-ui

✅ Closes: https://hashicorp.atlassian.net/browse/ICU-14740
This commit is contained in:
Lisbet Alvarez authored and GitHub committed 2024-11-12 09:27:07 -08:00
1 parent 7c1814118d
commit 57568f9a8c
77 files changed
+946 -81

No files matched your search

@@ -41,10 +41,10 @@ module('Unit | Controller | scopes/scope/roles/index', function (hooks) {
instances.scopes.global = this.server.create('scope', { id: 'global' });
instances.role = this.server.create('role', {
scopeId: 'global',
scope: instances.scopes.global,
});
instances.user = this.server.create('user', {
scopeId: 'global',
scope: instances.scopes.global,
});
urls.globalScope = `/scopes/global`;
@@ -12,5 +12,6 @@ module('Unit | Controller | scopes/scope/roles/new', function (hooks) {
test('it exists', function (assert) {
let controller = this.owner.lookup('controller:scopes/scope/roles/new');
assert.ok(controller);
assert.ok(controller.roles);
});
});
@@ -29,7 +29,6 @@ module(
};
const urls = {
globalScope: null,
addPrincipals: null,
};
@@ -56,8 +55,7 @@ module(
scopeId: 'global',
});
urls.globalScope = `/scopes/global`;
urls.addPrincipals = `${urls.globalScope}/roles/${instances.role.id}/add-principals`;
urls.addPrincipals = `/scopes/global/roles/${instances.role.id}/add-principals`;
});
test('it exists', function (assert) {
@@ -24,7 +24,6 @@ module('Unit | Controller | scopes/scope/roles/role/grants', function (hooks) {
};
const urls = {
globalScope: null,
grants: null,
};
@@ -35,15 +34,15 @@ module('Unit | Controller | scopes/scope/roles/role/grants', function (hooks) {
instances.scopes.global = this.server.create('scope', { id: 'global' });
instances.role = this.server.create('role', {
scopeId: 'global',
scope: instances.scopes.global,
});
urls.globalScope = `/scopes/global`;
urls.grants = `${urls.globalScope}/roles/${instances.role.id}/grants`;
urls.grants = `/scopes/global/roles/${instances.role.id}/grants`;
});
test('it exists', function (assert) {
assert.ok(controller);
assert.ok(controller.roles);
});
test('cancel action rolls-back changes on the specified model', async function (assert) {
@@ -14,5 +14,6 @@ module('Unit | Controller | scopes/scope/roles/role/index', function (hooks) {
'controller:scopes/scope/roles/role/index',
);
assert.ok(controller);
assert.ok(controller.roles);
});
});
@@ -58,6 +58,7 @@ module(
test('it exists', function (assert) {
assert.ok(controller);
assert.ok(controller.manageScopes);
});
test('handleSearchInput action sets expected values correctly', async function (assert) {
@@ -66,6 +66,7 @@ module(
test('it exists', function (assert) {
assert.ok(controller);
assert.ok(controller.manageScopes);
});
test('handleSearchInput action sets expected values correctly', async function (assert) {
@@ -16,6 +16,7 @@ module(
'controller:scopes/scope/roles/role/principals',
);
assert.ok(controller);
assert.ok(controller.roles);
});
},
);
@@ -33,7 +33,6 @@ module('Unit | Controller | scopes/scope/roles/role/scopes', function (hooks) {
};
const urls = {
globalScope: null,
scopes: null,
};
@@ -46,8 +45,7 @@ module('Unit | Controller | scopes/scope/roles/role/scopes', function (hooks) {
scopeId: 'global',
});
urls.globalScope = `/scopes/global`;
urls.scopes = `${urls.globalScope}/roles/${instances.role.id}/scopes`;
urls.scopes = `/scopes/global/roles/${instances.role.id}/scopes`;
});
test('it exists', function (assert) {