From 4d3b09d4602f819b2dc636f032128b4d2712206d Mon Sep 17 00:00:00 2001 From: Susmitha Girumala Date: Thu, 30 Jul 2020 13:16:44 -0400 Subject: [PATCH] =?UTF-8?q?test:=20=F0=9F=92=8D=20Fix=20breadcrumb=20tests?= =?UTF-8?q?=20after=20scopes=20refactor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add scoping information to breadcrumbs acceptance and integration tests --- ui/core/tests/acceptance/bread-crumbs-test.js | 8 ++++++-- .../tests/integration/components/bread-crumbs-test.js | 10 +++++----- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/ui/core/tests/acceptance/bread-crumbs-test.js b/ui/core/tests/acceptance/bread-crumbs-test.js index 68946549a..879eb311b 100644 --- a/ui/core/tests/acceptance/bread-crumbs-test.js +++ b/ui/core/tests/acceptance/bread-crumbs-test.js @@ -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}`; diff --git a/ui/core/tests/integration/components/bread-crumbs-test.js b/ui/core/tests/integration/components/bread-crumbs-test.js index a84f99f55..601741311 100644 --- a/ui/core/tests/integration/components/bread-crumbs-test.js +++ b/ui/core/tests/integration/components/bread-crumbs-test.js @@ -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``); - 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) {