From 6aa1a84921486209936fe78cb2ed0a4f0d80152d Mon Sep 17 00:00:00 2001 From: Thomas Young Date: Thu, 21 May 2015 17:54:55 +0200 Subject: [PATCH] added jasmine tests for focusing on and scrolling to newly added textbook --- .../coffee/spec/views/textbook_spec.coffee | 36 +++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) diff --git a/cms/static/coffee/spec/views/textbook_spec.coffee b/cms/static/coffee/spec/views/textbook_spec.coffee index 4bb5115fe8..7769eb7a05 100644 --- a/cms/static/coffee/spec/views/textbook_spec.coffee +++ b/cms/static/coffee/spec/views/textbook_spec.coffee @@ -1,8 +1,8 @@ define ["js/models/textbook", "js/models/chapter", "js/collections/chapter", "js/models/course", "js/collections/textbook", "js/views/show_textbook", "js/views/edit_textbook", "js/views/list_textbooks", - "js/views/edit_chapter", "js/views/feedback_prompt", "js/views/feedback_notification", + "js/views/edit_chapter", "js/views/feedback_prompt", "js/views/feedback_notification", "js/views/utils/view_utils", "js/common_helpers/ajax_helpers", "js/spec_helpers/modal_helpers", "jasmine-stealth"], -(Textbook, Chapter, ChapterSet, Course, TextbookSet, ShowTextbook, EditTextbook, ListTexbook, EditChapter, Prompt, Notification, AjaxHelpers, modal_helpers) -> +(Textbook, Chapter, ChapterSet, Course, TextbookSet, ShowTextbook, EditTextbook, ListTextbooks, EditChapter, Prompt, Notification, ViewUtils, AjaxHelpers, modal_helpers) -> feedbackTpl = readFixtures('system-feedback.underscore') beforeEach -> @@ -194,6 +194,38 @@ define ["js/models/textbook", "js/models/chapter", "js/collections/chapter", "js @view.$(".action-cancel").click() expect(chapters.length).toEqual(1) + describe "ListTextbooks", -> + noTextbooksTpl = readFixtures("no-textbooks.underscore") + editTextbooktpl = readFixtures('edit-textbook.underscore') + + beforeEach -> + appendSetFixtures($("