Skip to content

Commit

Permalink
Merge pull request #1855 from jrjohnson/1846-nocohorts
Browse files Browse the repository at this point in the history
Don't show new learner group form when there are no cohorts
  • Loading branch information
stopfstedt authored Jul 8, 2016
2 parents 3cf4227 + 849f17b commit 658f659
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/templates/learner-groups.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@
<h2>{{t 'general.learnerGroups'}}</h2>
</div>
<div class='actions'>
{{expand-collapse-button value=showNewLearnerGroupForm action="toggleNewLearnerGroupForm"}}
{{#if selectedProgramYear}}
{{expand-collapse-button value=showNewLearnerGroupForm action="toggleNewLearnerGroupForm"}}
{{/if}}
</div>
</div>

Expand Down
12 changes: 12 additions & 0 deletions tests/acceptance/learnergroups-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -681,3 +681,15 @@ test('add new learnergroup with full cohort', function(assert) {
assert.equal(getCellData(0, 1), 5, 'member count is correct');
});
});

test('no add button when there is no cohort', function(assert) {
server.create('user', {id: 4136});
server.create('school');
visit('/learnergroups');
const expandNewButton = '.actions .expand-button';

andThen(function() {
assert.equal(currentPath(), 'learnerGroups');
assert.equal(find(expandNewButton).length, 0);
});
});

0 comments on commit 658f659

Please sign in to comment.