|
|
|
@@ -10,12 +10,12 @@ module('Acceptance | breadcrumbs', function (hooks) {
|
|
|
|
|
let org;
|
|
|
|
|
let project;
|
|
|
|
|
let hostCatalog;
|
|
|
|
|
let projectsURL;
|
|
|
|
|
let newProjectURL;
|
|
|
|
|
let projectURL;
|
|
|
|
|
let hostCatalogsURL;
|
|
|
|
|
let newHostCatalogURL;
|
|
|
|
|
let hostCatalogURL;
|
|
|
|
|
let role;
|
|
|
|
|
let group;
|
|
|
|
|
let projectsURL, projectURL, newProjectURL;
|
|
|
|
|
let hostCatalogsURL, hostCatalogURL, newHostCatalogURL;
|
|
|
|
|
let rolesURL, roleURL, newRoleURL;
|
|
|
|
|
let groupsURL, groupURL, newGroupURL;
|
|
|
|
|
|
|
|
|
|
let crumbPath;
|
|
|
|
|
|
|
|
|
@@ -23,18 +23,30 @@ module('Acceptance | breadcrumbs', function (hooks) {
|
|
|
|
|
org = this.server.create('org');
|
|
|
|
|
project = this.server.create('project');
|
|
|
|
|
hostCatalog = this.server.create('host-catalog');
|
|
|
|
|
role = this.server.create('role');
|
|
|
|
|
group = this.server.create('group');
|
|
|
|
|
|
|
|
|
|
projectsURL = `/orgs/${org.id}/projects`;
|
|
|
|
|
newProjectURL = `${projectsURL}/new`;
|
|
|
|
|
projectURL = `${projectsURL}/${project.id}`;
|
|
|
|
|
|
|
|
|
|
hostCatalogsURL = `${projectURL}/host-catalogs`;
|
|
|
|
|
newHostCatalogURL = `${hostCatalogsURL}/new`;
|
|
|
|
|
hostCatalogURL = `${hostCatalogsURL}/${hostCatalog.id}`;
|
|
|
|
|
|
|
|
|
|
rolesURL = `/orgs/${org.id}/roles`;
|
|
|
|
|
newRoleURL = `${rolesURL}/new`;
|
|
|
|
|
roleURL = `${rolesURL}/${role.id}`;
|
|
|
|
|
|
|
|
|
|
groupsURL = `/orgs/${org.id}/groups`;
|
|
|
|
|
newGroupURL = `${groupsURL}/new`;
|
|
|
|
|
groupURL = `${groupsURL}/${group.id}`;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
test('can navigate via breadcrumbs to projects from project', async function (assert) {
|
|
|
|
|
assert.expect(3);
|
|
|
|
|
await visit(projectURL);
|
|
|
|
|
assert.equal(currentURL(), projectURL, 'We begin on th expected page.');
|
|
|
|
|
assert.equal(currentURL(), projectURL, 'We begin on the expected page.');
|
|
|
|
|
crumbPath = new URL(find('.rose-nav-breadcrumbs-link:last-child').href).pathname;
|
|
|
|
|
assert.equal(crumbPath, projectURL, 'Last crumb has expected URL.');
|
|
|
|
|
await click(find('.rose-nav-breadcrumbs-link:first-child'));
|
|
|
|
@@ -44,7 +56,7 @@ module('Acceptance | breadcrumbs', function (hooks) {
|
|
|
|
|
test('can navigate via breadcrumbs to projects from new project', async function (assert) {
|
|
|
|
|
assert.expect(3);
|
|
|
|
|
await visit(newProjectURL);
|
|
|
|
|
assert.equal(currentURL(), newProjectURL, 'We begin on th expected page.');
|
|
|
|
|
assert.equal(currentURL(), newProjectURL, 'We begin on the expected page.');
|
|
|
|
|
crumbPath = new URL(find('.rose-nav-breadcrumbs-link:last-child').href).pathname;
|
|
|
|
|
assert.equal(crumbPath, newProjectURL, 'Last crumb has expected URL.');
|
|
|
|
|
await click(find('.rose-nav-breadcrumbs-link:first-child'));
|
|
|
|
@@ -54,7 +66,7 @@ module('Acceptance | breadcrumbs', function (hooks) {
|
|
|
|
|
test('can navigate via breadcrumbs to project from host catalogs', async function (assert) {
|
|
|
|
|
assert.expect(3);
|
|
|
|
|
await visit(hostCatalogsURL);
|
|
|
|
|
assert.equal(currentURL(), hostCatalogsURL, 'We begin on th expected page.');
|
|
|
|
|
assert.equal(currentURL(), hostCatalogsURL, 'We begin on the expected page.');
|
|
|
|
|
crumbPath = new URL(find('.rose-nav-breadcrumbs-link:last-child').href).pathname;
|
|
|
|
|
assert.equal(crumbPath, hostCatalogsURL, 'Last crumb has expected URL.');
|
|
|
|
|
await click(findAll('.rose-nav-breadcrumbs-link')[1]);
|
|
|
|
@@ -64,7 +76,7 @@ module('Acceptance | breadcrumbs', function (hooks) {
|
|
|
|
|
test('can navigate via breadcrumbs to host catalogs from host catalog', async function (assert) {
|
|
|
|
|
assert.expect(3);
|
|
|
|
|
await visit(hostCatalogURL);
|
|
|
|
|
assert.equal(currentURL(), hostCatalogURL, 'We begin on th expected page.');
|
|
|
|
|
assert.equal(currentURL(), hostCatalogURL, 'We begin on the expected page.');
|
|
|
|
|
crumbPath = new URL(find('.rose-nav-breadcrumbs-link:last-child').href).pathname;
|
|
|
|
|
assert.equal(crumbPath, hostCatalogURL, 'Last crumb has expected URL.');
|
|
|
|
|
await click(findAll('.rose-nav-breadcrumbs-link')[2]);
|
|
|
|
@@ -74,11 +86,50 @@ module('Acceptance | breadcrumbs', function (hooks) {
|
|
|
|
|
test('can navigate via breadcrumbs to host catalogs from new host catalog', async function (assert) {
|
|
|
|
|
assert.expect(3);
|
|
|
|
|
await visit(newHostCatalogURL);
|
|
|
|
|
assert.equal(currentURL(), newHostCatalogURL, 'We begin on th expected page.');
|
|
|
|
|
assert.equal(currentURL(), newHostCatalogURL, 'We begin on the expected page.');
|
|
|
|
|
crumbPath = new URL(find('.rose-nav-breadcrumbs-link:last-child').href).pathname;
|
|
|
|
|
assert.equal(crumbPath, newHostCatalogURL, 'Last crumb has expected URL.');
|
|
|
|
|
await click(findAll('.rose-nav-breadcrumbs-link')[2]);
|
|
|
|
|
assert.equal(currentURL(), hostCatalogsURL, 'After navigating via breadcrumbs, we are one level up.');
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
test('can navigate via breadcrumbs to roles from role', async function (assert) {
|
|
|
|
|
assert.expect(3);
|
|
|
|
|
await visit(roleURL);
|
|
|
|
|
assert.equal(currentURL(), roleURL, 'We begin on the expected page.');
|
|
|
|
|
crumbPath = new URL(find('.rose-nav-breadcrumbs-link:last-child').href).pathname;
|
|
|
|
|
assert.equal(crumbPath, roleURL, 'Last crumb has expected URL.');
|
|
|
|
|
await click(find('.rose-nav-breadcrumbs-link:first-child'));
|
|
|
|
|
assert.equal(currentURL(), rolesURL, 'After navigating via breadcrumbs, we are one level up.');
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
test('can navigate via breadcrumbs to roles from new role', async function (assert) {
|
|
|
|
|
assert.expect(3);
|
|
|
|
|
await visit(newRoleURL);
|
|
|
|
|
assert.equal(currentURL(), newRoleURL, 'We begin on the expected page.');
|
|
|
|
|
crumbPath = new URL(find('.rose-nav-breadcrumbs-link:last-child').href).pathname;
|
|
|
|
|
assert.equal(crumbPath, newRoleURL, 'Last crumb has expected URL.');
|
|
|
|
|
await click(find('.rose-nav-breadcrumbs-link:first-child'));
|
|
|
|
|
assert.equal(currentURL(), rolesURL, 'After navigating via breadcrumbs, we are one level up.');
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
test('can navigate via breadcrumbs to groups from group', async function (assert) {
|
|
|
|
|
assert.expect(3);
|
|
|
|
|
await visit(groupURL);
|
|
|
|
|
assert.equal(currentURL(), groupURL, 'We begin on the expected page.');
|
|
|
|
|
crumbPath = new URL(find('.rose-nav-breadcrumbs-link:last-child').href).pathname;
|
|
|
|
|
assert.equal(crumbPath, groupURL, 'Last crumb has expected URL.');
|
|
|
|
|
await click(find('.rose-nav-breadcrumbs-link:first-child'));
|
|
|
|
|
assert.equal(currentURL(), groupsURL, 'After navigating via breadcrumbs, we are one level up.');
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
test('can navigate via breadcrumbs to groups from new group', async function (assert) {
|
|
|
|
|
assert.expect(3);
|
|
|
|
|
await visit(newGroupURL);
|
|
|
|
|
assert.equal(currentURL(), newGroupURL, 'We begin on the expected page.');
|
|
|
|
|
crumbPath = new URL(find('.rose-nav-breadcrumbs-link:last-child').href).pathname;
|
|
|
|
|
assert.equal(crumbPath, newGroupURL, 'Last crumb has expected URL.');
|
|
|
|
|
await click(find('.rose-nav-breadcrumbs-link:first-child'));
|
|
|
|
|
assert.equal(currentURL(), groupsURL, 'After navigating via breadcrumbs, we are one level up.');
|
|
|
|
|
});
|
|
|
|
|
});
|