test: 💍 Fix breadcrumb tests after scopes refactor
Add scoping information to breadcrumbs acceptance and integration tests
This commit is contained in:
2 files changed
+11
-7
No files matched your search
@@ -45,6 +45,12 @@ module('Acceptance | breadcrumbs', function (hooks) {
|
||||
user = this.server.create('user');
|
||||
role = this.server.create('role');
|
||||
group = this.server.create('group');
|
||||
hostCatalog = this.server.create('host-catalog', {
|
||||
scope: {
|
||||
id: project.id,
|
||||
type: project.type
|
||||
}
|
||||
});
|
||||
|
||||
projectsURL = `/scopes/${orgScope.id}/projects`;
|
||||
newProjectURL = `${projectsURL}/new`;
|
||||
@@ -62,8 +68,6 @@ module('Acceptance | breadcrumbs', function (hooks) {
|
||||
newUserURL = `${usersURL}/${user.id}`;
|
||||
userURL = `${usersURL}/new`;
|
||||
|
||||
// TODO: Update hostcatalog to scopes
|
||||
hostCatalog = this.server.create('host-catalog');
|
||||
hostCatalogsURL = `${projectURL}/host-catalogs`;
|
||||
newHostCatalogURL = `${hostCatalogsURL}/new`;
|
||||
hostCatalogURL = `${hostCatalogsURL}/${hostCatalog.id}`;
|
||||
|
||||
@@ -17,18 +17,18 @@ module('Integration | Component | bread-crumbs', function (hooks) {
|
||||
|
||||
test('it renders with model', async function (assert) {
|
||||
let store = this.owner.lookup('service:store');
|
||||
let project = store.createRecord('project', { id: '1234' });
|
||||
let scope = store.createRecord('scope');
|
||||
|
||||
this.set('breadCrumbs', [
|
||||
{
|
||||
label: 'Level 2',
|
||||
path: 'scopes.scope.projects.project',
|
||||
model: project,
|
||||
label: 'Level 1',
|
||||
path: 'scopes.scope',
|
||||
model: scope,
|
||||
},
|
||||
]);
|
||||
|
||||
await render(hbs`<BreadCrumbs @breadCrumbs={{this.breadCrumbs}} />`);
|
||||
assert.equal(find('.rose-nav-breadcrumbs').textContent.trim(), 'Level 2');
|
||||
assert.equal(find('.rose-nav-breadcrumbs').textContent.trim(), 'Level 1');
|
||||
});
|
||||
|
||||
test('it renders multiple breadCrumbs', async function (assert) {
|
||||
|
||||
Reference in new issue
Block a user