feat: 🎸 create manage custom scopes route and view (#2359)
* feat: 🎸 create manage custom scopes route and view ✅ Closes: https://hashicorp.atlassian.net/browse/ICU-13881 --------- Co-authored-by: Zhihe Li <zhihe.li@hashicorp.com>
This commit is contained in:
1 parent
89e072401c
commit
27abf9e2d9
24 files changed
+879
-68
No files matched your search
@@ -4,13 +4,24 @@
|
||||
*/
|
||||
|
||||
import { module, test } from 'qunit';
|
||||
import { visit, currentURL, click, findAll } from '@ember/test-helpers';
|
||||
import {
|
||||
visit,
|
||||
currentURL,
|
||||
click,
|
||||
findAll,
|
||||
fillIn,
|
||||
waitUntil,
|
||||
} from '@ember/test-helpers';
|
||||
import { setupApplicationTest } from 'ember-qunit';
|
||||
import setupMirage from 'ember-cli-mirage/test-support/setup-mirage';
|
||||
import { setupIndexedDb } from 'api/test-support/helpers/indexed-db';
|
||||
import a11yAudit from 'ember-a11y-testing/test-support/audit';
|
||||
import { authenticateSession } from 'ember-simple-auth/test-support';
|
||||
import { GRANT_SCOPE_THIS } from 'api/models/role';
|
||||
import {
|
||||
GRANT_SCOPE_THIS,
|
||||
GRANT_SCOPE_CHILDREN,
|
||||
GRANT_SCOPE_DESCENDANTS,
|
||||
} from 'api/models/role';
|
||||
|
||||
module('Acceptance | roles | scopes', function (hooks) {
|
||||
setupApplicationTest(hooks);
|
||||
@@ -19,25 +30,35 @@ module('Acceptance | roles | scopes', function (hooks) {
|
||||
|
||||
const SCOPE_TOGGLE_SELECTOR = (name) =>
|
||||
`.hds-form-toggle input[name="${name}"]`;
|
||||
const SCOPE_CHECKBOX_SELECTOR = (id) =>
|
||||
`tbody [data-test-org-scopes-table-row="${id}"] input`;
|
||||
const TABLE_ROW_SELECTOR = 'tbody tr';
|
||||
const SAVE_BTN_SELECTOR = 'form [type="submit"]';
|
||||
const CANCEL_BTN_SELECTOR = '.rose-form-actions [type="button"]';
|
||||
const MANAGE_SCOPES_SELECTOR = '[data-test-manage-dropdown-scopes]';
|
||||
const TOAST_SELECTOR = '[role="alert"]';
|
||||
const SEARCH_INPUT_SELECTOR = '.search-filtering [type="search"]';
|
||||
const NO_RESULTS_MSG_SELECTOR = '[data-test-no-scope-results]';
|
||||
|
||||
const instances = {
|
||||
scopes: {
|
||||
global: null,
|
||||
org: null,
|
||||
},
|
||||
role: null,
|
||||
globalRole: null,
|
||||
orgRole: null,
|
||||
};
|
||||
const urls = {
|
||||
orgScope: null,
|
||||
roles: null,
|
||||
role: null,
|
||||
roleScopes: null,
|
||||
manageScopes: null,
|
||||
globalRoles: null,
|
||||
globalRole: null,
|
||||
globalRoleScopes: null,
|
||||
globalManageScopes: null,
|
||||
orgRoles: null,
|
||||
orgRole: null,
|
||||
orgRoleScopes: null,
|
||||
orgManageScopes: null,
|
||||
manageCustomScopes: null,
|
||||
};
|
||||
|
||||
hooks.beforeEach(function () {
|
||||
@@ -47,30 +68,43 @@ module('Acceptance | roles | scopes', function (hooks) {
|
||||
type: 'org',
|
||||
scope: { id: 'global', type: 'global' },
|
||||
});
|
||||
instances.role = this.server.create(
|
||||
instances.globalRole = this.server.create(
|
||||
'role',
|
||||
{
|
||||
scope: instances.scopes.global,
|
||||
},
|
||||
'withScopes',
|
||||
);
|
||||
instances.orgRole = this.server.create(
|
||||
'role',
|
||||
{
|
||||
scope: instances.scopes.org,
|
||||
},
|
||||
'withScopes',
|
||||
);
|
||||
urls.roles = `/scopes/${instances.scopes.org.id}/roles`;
|
||||
urls.role = `${urls.roles}/${instances.role.id}`;
|
||||
urls.roleScopes = `${urls.role}/scopes`;
|
||||
urls.manageScopes = `${urls.role}/manage-scopes`;
|
||||
|
||||
urls.globalRoles = `/scopes/global/roles`;
|
||||
urls.globalRole = `${urls.globalRoles}/${instances.globalRole.id}`;
|
||||
urls.globalRoleScopes = `${urls.globalRole}/scopes`;
|
||||
urls.globalManageScopes = `${urls.globalRole}/manage-scopes`;
|
||||
urls.manageCustomScopes = `${urls.globalManageScopes}/manage-custom-scopes`;
|
||||
urls.orgRoles = `/scopes/${instances.scopes.org.id}/roles`;
|
||||
urls.orgRole = `${urls.orgRoles}/${instances.orgRole.id}`;
|
||||
urls.orgRoleScopes = `${urls.orgRole}/scopes`;
|
||||
urls.orgManageScopes = `${urls.orgRole}/manage-scopes`;
|
||||
});
|
||||
|
||||
test('visiting role scopes', async function (assert) {
|
||||
await visit(urls.roleScopes);
|
||||
await visit(urls.orgRoleScopes);
|
||||
await a11yAudit();
|
||||
assert.strictEqual(currentURL(), urls.roleScopes);
|
||||
assert.strictEqual(currentURL(), urls.orgRoleScopes);
|
||||
assert
|
||||
.dom(TABLE_ROW_SELECTOR)
|
||||
.exists({ count: instances.role.grant_scope_ids.length });
|
||||
.exists({ count: instances.orgRole.grant_scope_ids.length });
|
||||
});
|
||||
|
||||
test('user can naviage to scope from role grant scopes', async function (assert) {
|
||||
await visit(urls.roleScopes);
|
||||
await visit(urls.orgRoleScopes);
|
||||
await click('tbody tr:nth-child(2) a');
|
||||
assert.strictEqual(
|
||||
currentURL(),
|
||||
@@ -79,7 +113,7 @@ module('Acceptance | roles | scopes', function (hooks) {
|
||||
});
|
||||
|
||||
test('user can naviage to parent scope from role grant scopes', async function (assert) {
|
||||
await visit(urls.roleScopes);
|
||||
await visit(urls.orgRoleScopes);
|
||||
await click('tbody tr:nth-child(2) td:nth-child(3) a');
|
||||
assert.strictEqual(
|
||||
currentURL(),
|
||||
@@ -88,34 +122,34 @@ module('Acceptance | roles | scopes', function (hooks) {
|
||||
});
|
||||
|
||||
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);
|
||||
instances.orgRole.update({ grant_scope_ids: [] });
|
||||
await visit(urls.orgRoleScopes);
|
||||
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({
|
||||
instances.orgRole.update({
|
||||
grant_scope_ids: [],
|
||||
authorized_actions: instances.role.authorized_actions.filter(
|
||||
authorized_actions: instances.orgRole.authorized_actions.filter(
|
||||
(action) => action !== 'set-grant-scopes',
|
||||
),
|
||||
});
|
||||
await visit(urls.roleScopes);
|
||||
await visit(urls.orgRoleScopes);
|
||||
assert.dom('.role-grant-scopes div div:nth-child(3) a').doesNotExist();
|
||||
});
|
||||
|
||||
test('toggle and save scope keywords to add', async function (assert) {
|
||||
instances.role.update({ grant_scope_ids: [] });
|
||||
await visit(urls.role);
|
||||
test('user can toggle and save scope keywords to add on manage scopes page', async function (assert) {
|
||||
instances.orgRole.update({ grant_scope_ids: [] });
|
||||
await visit(urls.orgRole);
|
||||
|
||||
await click(`[href="${urls.roleScopes}"]`);
|
||||
await click(`[href="${urls.orgRoleScopes}"]`);
|
||||
|
||||
assert.strictEqual(findAll(TABLE_ROW_SELECTOR).length, 0);
|
||||
|
||||
await click(MANAGE_SCOPES_SELECTOR);
|
||||
|
||||
assert.strictEqual(currentURL(), urls.manageScopes);
|
||||
assert.strictEqual(currentURL(), urls.orgManageScopes);
|
||||
|
||||
// Click three times to select, unselect, then reselect (for coverage)
|
||||
await click(SCOPE_TOGGLE_SELECTOR(GRANT_SCOPE_THIS));
|
||||
@@ -123,21 +157,43 @@ module('Acceptance | roles | scopes', function (hooks) {
|
||||
await click(SCOPE_TOGGLE_SELECTOR(GRANT_SCOPE_THIS));
|
||||
await click(SAVE_BTN_SELECTOR);
|
||||
|
||||
assert.strictEqual(currentURL(), urls.roleScopes);
|
||||
assert.strictEqual(currentURL(), urls.orgRoleScopes);
|
||||
assert.strictEqual(findAll(TABLE_ROW_SELECTOR).length, 1);
|
||||
});
|
||||
|
||||
test('toggle and cancel scope keywords to add', async function (assert) {
|
||||
instances.role.update({ grant_scope_ids: [] });
|
||||
await visit(urls.role);
|
||||
test('correct toggles are visible for global level role on manage scopes page', async function (assert) {
|
||||
await visit(urls.globalRole);
|
||||
|
||||
await click(`[href="${urls.roleScopes}"]`);
|
||||
await click(MANAGE_SCOPES_SELECTOR);
|
||||
|
||||
assert.strictEqual(currentURL(), urls.globalManageScopes);
|
||||
assert.dom(SCOPE_TOGGLE_SELECTOR(GRANT_SCOPE_THIS)).isVisible();
|
||||
assert.dom(SCOPE_TOGGLE_SELECTOR(GRANT_SCOPE_CHILDREN)).isVisible();
|
||||
assert.dom(SCOPE_TOGGLE_SELECTOR(GRANT_SCOPE_DESCENDANTS)).isVisible();
|
||||
});
|
||||
|
||||
test('correct toggles are visible for org level role on manage scopes page', async function (assert) {
|
||||
await visit(urls.orgRole);
|
||||
|
||||
await click(MANAGE_SCOPES_SELECTOR);
|
||||
|
||||
assert.strictEqual(currentURL(), urls.orgManageScopes);
|
||||
assert.dom(SCOPE_TOGGLE_SELECTOR(GRANT_SCOPE_THIS)).isVisible();
|
||||
assert.dom(SCOPE_TOGGLE_SELECTOR(GRANT_SCOPE_CHILDREN)).isVisible();
|
||||
assert.dom(SCOPE_TOGGLE_SELECTOR(GRANT_SCOPE_DESCENDANTS)).doesNotExist();
|
||||
});
|
||||
|
||||
test('user can toggle and cancel scope keywords to add on manage scopes page', async function (assert) {
|
||||
instances.orgRole.update({ grant_scope_ids: [] });
|
||||
await visit(urls.orgRole);
|
||||
|
||||
await click(`[href="${urls.orgRoleScopes}"]`);
|
||||
|
||||
assert.strictEqual(findAll(TABLE_ROW_SELECTOR).length, 0);
|
||||
|
||||
await click(MANAGE_SCOPES_SELECTOR);
|
||||
|
||||
assert.strictEqual(currentURL(), urls.manageScopes);
|
||||
assert.strictEqual(currentURL(), urls.orgManageScopes);
|
||||
|
||||
// Click three times to select, unselect, then reselect (for coverage)
|
||||
await click(SCOPE_TOGGLE_SELECTOR(GRANT_SCOPE_THIS));
|
||||
@@ -145,11 +201,11 @@ module('Acceptance | roles | scopes', function (hooks) {
|
||||
await click(SCOPE_TOGGLE_SELECTOR(GRANT_SCOPE_THIS));
|
||||
await click(CANCEL_BTN_SELECTOR);
|
||||
|
||||
assert.strictEqual(currentURL(), urls.roleScopes);
|
||||
assert.strictEqual(currentURL(), urls.orgRoleScopes);
|
||||
assert.strictEqual(findAll(TABLE_ROW_SELECTOR).length, 0);
|
||||
});
|
||||
|
||||
test('shows error message on scope save', async function (assert) {
|
||||
test('shows error message on scope save on manage scopes page', async function (assert) {
|
||||
this.server.post('/roles/:idMethod', () => {
|
||||
return new Response(
|
||||
400,
|
||||
@@ -162,8 +218,8 @@ module('Acceptance | roles | scopes', function (hooks) {
|
||||
},
|
||||
);
|
||||
});
|
||||
instances.role.update({ grant_scope_ids: [] });
|
||||
await visit(urls.role);
|
||||
instances.orgRole.update({ grant_scope_ids: [] });
|
||||
await visit(urls.orgRole);
|
||||
|
||||
await click(MANAGE_SCOPES_SELECTOR);
|
||||
await click(SCOPE_TOGGLE_SELECTOR(GRANT_SCOPE_THIS));
|
||||
@@ -171,4 +227,125 @@ module('Acceptance | roles | scopes', function (hooks) {
|
||||
|
||||
assert.dom(TOAST_SELECTOR).isVisible();
|
||||
});
|
||||
|
||||
test('user can select and save custom scopes to add on manage custom scopes page', async function (assert) {
|
||||
instances.globalRole.update({ grant_scope_ids: [] });
|
||||
await visit(urls.globalRole);
|
||||
|
||||
await click(`[href="${urls.globalRoleScopes}"]`);
|
||||
|
||||
assert.strictEqual(findAll(TABLE_ROW_SELECTOR).length, 0);
|
||||
|
||||
await click(MANAGE_SCOPES_SELECTOR);
|
||||
|
||||
assert.strictEqual(currentURL(), urls.globalManageScopes);
|
||||
|
||||
await click(`[href="${urls.manageCustomScopes}"]`);
|
||||
|
||||
// Click three times to select, unselect, then reselect (for coverage)
|
||||
await click(SCOPE_CHECKBOX_SELECTOR(instances.scopes.org.id));
|
||||
await click(SCOPE_CHECKBOX_SELECTOR(instances.scopes.org.id));
|
||||
await click(SCOPE_CHECKBOX_SELECTOR(instances.scopes.org.id));
|
||||
await click(SAVE_BTN_SELECTOR);
|
||||
|
||||
assert.strictEqual(currentURL(), urls.globalManageScopes);
|
||||
|
||||
await click(SAVE_BTN_SELECTOR);
|
||||
|
||||
assert.strictEqual(currentURL(), urls.globalRoleScopes);
|
||||
assert.strictEqual(findAll(TABLE_ROW_SELECTOR).length, 1);
|
||||
});
|
||||
|
||||
test('user can select and cancel custom scopes to add on manage custom scopes page', async function (assert) {
|
||||
instances.globalRole.update({ grant_scope_ids: [] });
|
||||
await visit(urls.globalRole);
|
||||
|
||||
await click(`[href="${urls.globalRoleScopes}"]`);
|
||||
|
||||
assert.strictEqual(findAll(TABLE_ROW_SELECTOR).length, 0);
|
||||
|
||||
await click(MANAGE_SCOPES_SELECTOR);
|
||||
|
||||
assert.strictEqual(currentURL(), urls.globalManageScopes);
|
||||
|
||||
await click(`[href="${urls.manageCustomScopes}"]`);
|
||||
|
||||
// Click three times to select, unselect, then reselect (for coverage)
|
||||
await click(SCOPE_CHECKBOX_SELECTOR(instances.scopes.org.id));
|
||||
await click(SCOPE_CHECKBOX_SELECTOR(instances.scopes.org.id));
|
||||
await click(SCOPE_CHECKBOX_SELECTOR(instances.scopes.org.id));
|
||||
await click(CANCEL_BTN_SELECTOR);
|
||||
|
||||
assert.strictEqual(currentURL(), urls.globalManageScopes);
|
||||
|
||||
await click(CANCEL_BTN_SELECTOR);
|
||||
|
||||
assert.strictEqual(currentURL(), urls.globalRoleScopes);
|
||||
assert.strictEqual(findAll(TABLE_ROW_SELECTOR).length, 0);
|
||||
});
|
||||
|
||||
test('shows error message on custom scope save on manage custom scopes page', async function (assert) {
|
||||
this.server.post('/roles/:idMethod', () => {
|
||||
return new Response(
|
||||
400,
|
||||
{},
|
||||
{
|
||||
status: 400,
|
||||
code: 'invalid_argument',
|
||||
message: 'The request was invalid.',
|
||||
details: {},
|
||||
},
|
||||
);
|
||||
});
|
||||
instances.globalRole.update({ grant_scope_ids: [] });
|
||||
await visit(urls.globalRole);
|
||||
|
||||
await click(MANAGE_SCOPES_SELECTOR);
|
||||
await click(`[href="${urls.manageCustomScopes}"]`);
|
||||
await click(SCOPE_CHECKBOX_SELECTOR(instances.scopes.org.id));
|
||||
await click(SAVE_BTN_SELECTOR);
|
||||
|
||||
assert.dom(TOAST_SELECTOR).isVisible();
|
||||
});
|
||||
|
||||
test('user can search for a specifc org scope by id on manage custom scopes page', async function (assert) {
|
||||
const anotherOrg = this.server.create('scope', {
|
||||
type: 'org',
|
||||
scope: { id: 'global', type: 'global' },
|
||||
});
|
||||
await visit(urls.globalManageScopes);
|
||||
|
||||
await click(`[href="${urls.manageCustomScopes}"]`);
|
||||
|
||||
assert.dom(SCOPE_CHECKBOX_SELECTOR(instances.scopes.org.id)).exists();
|
||||
assert.dom(SCOPE_CHECKBOX_SELECTOR(anotherOrg.id)).exists();
|
||||
|
||||
await fillIn(SEARCH_INPUT_SELECTOR, instances.scopes.org.id);
|
||||
await waitUntil(
|
||||
() => findAll(SCOPE_CHECKBOX_SELECTOR(anotherOrg.id)).length === 0,
|
||||
);
|
||||
|
||||
assert.dom(SCOPE_CHECKBOX_SELECTOR(instances.scopes.org.id)).exists();
|
||||
assert.dom(SCOPE_CHECKBOX_SELECTOR(anotherOrg.id)).doesNotExist();
|
||||
});
|
||||
|
||||
test('user can search for org scopes and get no results on manage custom scopes page', async function (assert) {
|
||||
const anotherOrg = this.server.create('scope', {
|
||||
type: 'org',
|
||||
scope: { id: 'global', type: 'global' },
|
||||
});
|
||||
await visit(urls.globalManageScopes);
|
||||
|
||||
await click(`[href="${urls.manageCustomScopes}"]`);
|
||||
|
||||
assert.dom(SCOPE_CHECKBOX_SELECTOR(instances.scopes.org.id)).exists();
|
||||
assert.dom(SCOPE_CHECKBOX_SELECTOR(anotherOrg.id)).exists();
|
||||
|
||||
await fillIn(SEARCH_INPUT_SELECTOR, 'fake scope that does not exist');
|
||||
await waitUntil(() => findAll(NO_RESULTS_MSG_SELECTOR).length === 1);
|
||||
|
||||
assert.dom(`[href="${urls.role1}"]`).doesNotExist();
|
||||
assert.dom(`[href="${urls.role2}"]`).doesNotExist();
|
||||
assert.dom(NO_RESULTS_MSG_SELECTOR).includesText('No results found');
|
||||
});
|
||||
});
|
||||
+7
-2
@@ -1,3 +1,8 @@
|
||||
/**
|
||||
* Copyright (c) HashiCorp, Inc.
|
||||
* SPDX-License-Identifier: BUSL-1.1
|
||||
*/
|
||||
|
||||
import { module, test } from 'qunit';
|
||||
import { setupTest } from 'ember-qunit';
|
||||
import { visit, currentURL } from '@ember/test-helpers';
|
||||
@@ -5,7 +10,7 @@ import setupMirage from 'ember-cli-mirage/test-support/setup-mirage';
|
||||
import { authenticateSession } from 'ember-simple-auth/test-support';
|
||||
|
||||
module(
|
||||
'Unit | Controller | scopes/scope/roles/role/manage-scopes',
|
||||
'Unit | Controller | scopes/scope/roles/role/manage-scopes/index',
|
||||
function (hooks) {
|
||||
setupTest(hooks);
|
||||
setupMirage(hooks);
|
||||
@@ -30,7 +35,7 @@ module(
|
||||
authenticateSession({});
|
||||
store = this.owner.lookup('service:store');
|
||||
controller = this.owner.lookup(
|
||||
'controller:scopes/scope/roles/role/manage-scopes',
|
||||
'controller:scopes/scope/roles/role/manage-scopes/index',
|
||||
);
|
||||
|
||||
instances.scopes.global = this.server.create('scope', { id: 'global' });
|
||||
+91
@@ -0,0 +1,91 @@
|
||||
/**
|
||||
* Copyright (c) HashiCorp, Inc.
|
||||
* SPDX-License-Identifier: BUSL-1.1
|
||||
*/
|
||||
|
||||
import { module, test } from 'qunit';
|
||||
import { setupTest } from 'ember-qunit';
|
||||
import { visit, currentURL, waitUntil } from '@ember/test-helpers';
|
||||
import setupMirage from 'ember-cli-mirage/test-support/setup-mirage';
|
||||
import { setupIndexedDb } from 'api/test-support/helpers/indexed-db';
|
||||
import { authenticateSession } from 'ember-simple-auth/test-support';
|
||||
|
||||
module(
|
||||
'Unit | Controller | scopes/scope/roles/role/manage-scopes/manage-custom-scopes',
|
||||
function (hooks) {
|
||||
setupTest(hooks);
|
||||
setupMirage(hooks);
|
||||
setupIndexedDb(hooks);
|
||||
|
||||
let store;
|
||||
let controller;
|
||||
|
||||
const instances = {
|
||||
scopes: {
|
||||
global: null,
|
||||
org: null,
|
||||
},
|
||||
role: null,
|
||||
};
|
||||
|
||||
const urls = {
|
||||
globalScope: null,
|
||||
manageScopes: null,
|
||||
manageCustomScopes: null,
|
||||
};
|
||||
|
||||
hooks.beforeEach(async function () {
|
||||
authenticateSession({});
|
||||
store = this.owner.lookup('service:store');
|
||||
controller = this.owner.lookup(
|
||||
'controller:scopes/scope/roles/role/manage-scopes/manage-custom-scopes',
|
||||
);
|
||||
|
||||
instances.scopes.global = this.server.create('scope', { id: 'global' });
|
||||
instances.scopes.org = this.server.create('scope', {
|
||||
type: 'org',
|
||||
scope: { id: 'global', type: 'global' },
|
||||
});
|
||||
instances.role = this.server.create('role', {
|
||||
scopeId: 'global',
|
||||
grant_scope_ids: [],
|
||||
});
|
||||
|
||||
urls.globalScope = `/scopes/global`;
|
||||
urls.manageScopes = `${urls.globalScope}/roles/${instances.role.id}/manage-scopes`;
|
||||
urls.manageCustomScopes = `${urls.manageScopes}/manage-custom-scopes`;
|
||||
});
|
||||
|
||||
test('it exists', function (assert) {
|
||||
assert.ok(controller);
|
||||
});
|
||||
|
||||
test('handleSearchInput action sets expected values correctly', async function (assert) {
|
||||
const searchValue = 'test';
|
||||
controller.handleSearchInput({ target: { value: searchValue } });
|
||||
await waitUntil(() => controller.search === searchValue);
|
||||
|
||||
assert.strictEqual(controller.page, 1);
|
||||
assert.strictEqual(controller.search, searchValue);
|
||||
});
|
||||
|
||||
test('setGrantScopes action adds scopes to specified model', async function (assert) {
|
||||
await visit(urls.manageCustomScopes);
|
||||
const role = await store.findRecord('role', instances.role.id);
|
||||
|
||||
assert.deepEqual(role.grant_scope_ids, []);
|
||||
|
||||
await controller.setGrantScopes(role, [instances.scopes.org.id]);
|
||||
|
||||
assert.deepEqual(role.grant_scope_ids, [instances.scopes.org.id]);
|
||||
});
|
||||
|
||||
test('cancel action causes transition to expected route', async function (assert) {
|
||||
await visit(urls.manageCustomScopes);
|
||||
|
||||
await controller.cancel();
|
||||
|
||||
assert.strictEqual(currentURL(), urls.manageScopes);
|
||||
});
|
||||
},
|
||||
);
|
||||
@@ -1,3 +1,8 @@
|
||||
/**
|
||||
* Copyright (c) HashiCorp, Inc.
|
||||
* SPDX-License-Identifier: BUSL-1.1
|
||||
*/
|
||||
|
||||
import { module, test } from 'qunit';
|
||||
import { setupTest } from 'ember-qunit';
|
||||
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
/**
|
||||
* Copyright (c) HashiCorp, Inc.
|
||||
* SPDX-License-Identifier: BUSL-1.1
|
||||
*/
|
||||
|
||||
import { module, test } from 'qunit';
|
||||
import { setupTest } from 'ember-qunit';
|
||||
|
||||
module(
|
||||
'Unit | Route | scopes/scope/roles/role/manage-scopes/index',
|
||||
function (hooks) {
|
||||
setupTest(hooks);
|
||||
|
||||
test('it exists', function (assert) {
|
||||
let route = this.owner.lookup(
|
||||
'route:scopes/scope/roles/role/manage-scopes/index',
|
||||
);
|
||||
assert.ok(route);
|
||||
});
|
||||
},
|
||||
);
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
/**
|
||||
* Copyright (c) HashiCorp, Inc.
|
||||
* SPDX-License-Identifier: BUSL-1.1
|
||||
*/
|
||||
|
||||
import { module, test } from 'qunit';
|
||||
import { setupTest } from 'ember-qunit';
|
||||
|
||||
module(
|
||||
'Unit | Route | scopes/scope/roles/role/manage-scopes/manage-custom-scopes',
|
||||
function (hooks) {
|
||||
setupTest(hooks);
|
||||
|
||||
test('it exists', function (assert) {
|
||||
let route = this.owner.lookup(
|
||||
'route:scopes/scope/roles/role/manage-scopes/manage-custom-scopes',
|
||||
);
|
||||
assert.ok(route);
|
||||
});
|
||||
},
|
||||
);
|
||||
Reference in new issue
Block a user