Commit cfc5857d by jsa Committed by Zia Fazal

allow TAs to select the cohort of new posts.

TNL-153
parent e4d464fc
......@@ -109,6 +109,7 @@ browser and pasting the output. When that file changes, this one should be rege
</div>
<input type="submit" id="edit-post-submit" class="post-update" value="Update post">
<a href="#" class="post-cancel">Cancel</a>
</div>
</script>
<script aria-hidden="true" type="text/template" id="thread-response-template">
......
......@@ -226,19 +226,26 @@ describe "NewPostView", ->
mode: "tab"
)
expectCohortSelectorVisible = (view, visible) ->
expect(view.$(".js-group-select").is(":visible")).toEqual(visible)
checkVisibility = (view, expectedVisible) =>
view.render()
expect(view.$(".js-group-select").is(":visible")).toEqual(expectedVisible)
if expectedVisible
expect(view.$(".js-group-select").prop("disabled")).toEqual(false)
it "is not visible to students", ->
@view.render()
expectCohortSelectorVisible(@view, false)
checkVisibility(@view, false)
it "allows TAs to see the cohort selector", ->
DiscussionSpecHelper.makeTA()
checkVisibility(@view, true)
it "allows moderators to select visibility", ->
it "allows moderators to see the cohort selector", ->
DiscussionSpecHelper.makeModerator()
@view.render()
expectCohortSelectorVisible(@view, true)
expect(@view.$(".js-group-select").prop("disabled")).toEqual(false)
checkVisibility(@view, true)
it "allows the user to make a cohort selection", ->
DiscussionSpecHelper.makeModerator()
@view.render()
expectedGroupId = null
DiscussionSpecHelper.makeAjaxSpy(
(params) -> expect(params.data.group_id).toEqual(expectedGroupId)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment