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
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export default class ProgramYearCollapsedObjectivesComponent extends Component {
>
{{t "general.objectives"}}
({{get this.objectives "length"}})
<FaIcon @icon="caret-right" />
<FaIcon @icon="caret-right" data-test-expand />
</button>
</div>
<div class="content">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ export default class ProgramYearObjectivesComponent extends Component {
@tracked newObjectiveTitle;

get showCollapsible() {
return this.hasObjectives && !this.isManaging;
return this.hasObjectives;
}

get hasObjectives() {
return this.objectiveCount > 0;
return this.objectiveIdsCount > 0;
}

get objectiveIds() {
Expand Down Expand Up @@ -93,7 +93,7 @@ export default class ProgramYearObjectivesComponent extends Component {
>
{{t "general.objectives"}}
({{this.objectiveIdsCount}})
<FaIcon @icon="caret-down" />
<FaIcon @icon="caret-down" data-test-collapse />
</button>
</div>
{{else}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ module('Integration | Component | program-year/collapsed-objectives', function (
);

assert.strictEqual(component.title, 'Objectives (4)');
assert.ok(component.hasExpandIcon);
assert.strictEqual(component.objectiveCount, 'There are 4 objectives');
assert.strictEqual(component.parentCount, '1 has a linked competency');
assert.strictEqual(component.meshCount, '1 has MeSH');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ module('Integration | Component | program-year/objectives', function (hooks) {
</template>,
);

assert.ok(component.hasCollapseIcon);
assert.strictEqual(component.objectiveList.objectives.length, 2);
assert.strictEqual(
component.objectiveList.objectives[0].description.text,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ import { create, collection, clickable, hasClass, text } from 'ember-cli-page-ob
const definition = {
scope: '[data-test-program-year-collapsed-objectives]',
title: text('[data-test-title]'),
hasExpandIcon: {
scope: '[data-test-expand]',
},
expand: clickable('[data-test-title]'),
headers: collection('thead th'),
objectiveCount: text('[data-test-objective-count]'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ import objectiveList from './objective-list';
const definition = {
scope: '[data-test-program-year-objectives]',
title: text('[data-test-title]'),
hasCollapseIcon: {
scope: '[data-test-collapse]',
},
createNew: clickable('[data-test-actions] [data-test-expand-collapse-button] button'),
newObjective,
objectiveList,
Expand Down