Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions app/components/class-field-description.gjs
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,18 @@ export default class ClassFieldDescription extends Component {
{{svgJar "link" width="20px" height="20px" aria-hidden="true"}}
</a>
</h3>
{{#if @model.module}}
{{#if @field.module}}
<div class="attributes">
<div class="attribute">
<span class="attribute-label">Module:</span>
<span class="attribute-value"><LinkTo
@route="project-version.modules.module"
@models={{array
@model.projectVersion.compactVersion
@model.module
@field.module
}}
>{{@model.module}}</LinkTo></span>
data-test-module
>{{@field.module}}</LinkTo></span>
</div>
</div>
{{/if}}
Expand Down
24 changes: 24 additions & 0 deletions tests/integration/components/class-field-description-test.gjs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,30 @@ module('Integration | Component | class field description', function (hooks) {
assert.dom(findAll('.args')[0]).hasText('param1, param2, param3');
});

test('shows module link from field.module', async function (assert) {
const type = 'method';
const field = {
name: 'myMethod',
module: '@ember/component',
};
const model = {
projectVersion: { compactVersion: '6.0' },
project: { id: 'ember' },
};

await render(
<template>
<ClassFieldDescription
@type={{type}}
@field={{field}}
@model={{model}}
/>
</template>,
);

assert.dom('[data-test-module]').hasText('@ember/component');
});

test('parameter props are displayed', async function (assert) {
const type = 'method';
const field = {
Expand Down
Loading