Skip to content

Commit

Permalink
fix(3086): job template info now shows up on build-banner (#1036)
Browse files Browse the repository at this point in the history
1) Rename route "templates.detail.version" to "templates.job.detail.version"
2) Add test to check hyper link
  • Loading branch information
adong authored Apr 4, 2024
1 parent dedaaa7 commit 6161a6a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/components/build-banner/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@
{{#if this.template}}
<li class="template-info">
<LinkTo
@route="templates.detail.version"
@route="templates.job.detail.version"
@models={{array this.template.namespace this.template.name this.template.version}}
>
<span class="banner-value">
Expand Down
2 changes: 1 addition & 1 deletion app/templates/job/detail/index/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ import AuthenticatedRouteMixin from 'ember-simple-auth/mixins/authenticated-rout
export default Route.extend(AuthenticatedRouteMixin, {
router: service(),
model() {
return this.modelFor('templates.detail');
return this.modelFor('templates.job.detail');
}
});
5 changes: 4 additions & 1 deletion tests/integration/components/build-banner/component-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -766,7 +766,7 @@ module('Integration | Component | build banner', function (hooks) {
});

test('it renders template info if user is using template', async function (assert) {
assert.expect(15);
assert.expect(16);
this.owner.setupRouter();

this.set('reloadCb', () => {
Expand Down Expand Up @@ -846,6 +846,9 @@ module('Integration | Component | build banner', function (hooks) {
assert.dom('.user .banner-value').hasText('Bruce W');
assert.dom('.docker-container .banner-value').hasText('node:6');
assert.dom('.template-info .banner-value').hasText('test:2.0');
assert
.dom('.template-info > a')
.hasAttribute('href', '/templates/job/nodejs/test/2.0');
assert.dom('button').doesNotExist();
});

Expand Down

0 comments on commit 6161a6a

Please sign in to comment.