From 59e2a6ddde74969f3c92243999c29dae48d28dd1 Mon Sep 17 00:00:00 2001 From: jsa Date: Tue, 1 Jul 2014 13:19:47 -0400 Subject: [PATCH] update NewPostViewSpec to correctly initialize NewPostView --- .../discussion/view/new_post_view_spec.coffee | 121 +++++++++++++++--- 1 file changed, 101 insertions(+), 20 deletions(-) diff --git a/common/static/coffee/spec/discussion/view/new_post_view_spec.coffee b/common/static/coffee/spec/discussion/view/new_post_view_spec.coffee index a7b20906e1..1f8b9ad627 100644 --- a/common/static/coffee/spec/discussion/view/new_post_view_spec.coffee +++ b/common/static/coffee/spec/discussion/view/new_post_view_spec.coffee @@ -7,28 +7,86 @@ describe "NewPostView", ->
+ + + + + + + + + + + + """ ) window.$$course_id = "edX/999/test" @@ -37,9 +95,32 @@ describe "NewPostView", -> @view = new NewPostView( el: $(".new-post-article"), collection: @discussion, + course_settings: new DiscussionCourseSettings({ + "category_map": { + "subcategories": { + "Basic Question Types": { + "subcategories": {}, + "children": ["Selection From Options"], + "entries": { + "Selection From Options": { + "sort_key": null, + "is_cohorted": true, + "id": "cba3e4cd91d0466b9ac50926e495b76f" + } + }, + }, + }, + "children": ["Basic Question Types"], + "entries": {} + }, + "allow_anonymous": true, + "allow_anonymous_to_peers": true + }), + mode: "tab" ) - @parent_category_text = @view.$el.find( "ul.topic_menu li[role='menuitem'] > a" )[0].text - @selected_option_text = @view.$el.find( "ul.topic_menu li[role='menuitem'] > a" )[1].text + @view.render() + @parent_category_text = "Basic Question Types" + @selected_option_text = "Selection From Options" describe "Drop down works correct", ->