Use RequireJS for test dependencies, and use domReady.
This commit is contained in:
@@ -33,6 +33,7 @@ requirejs.config({
|
||||
"jasmine-stealth": "xmodule_js/common_static/js/vendor/jasmine-stealth",
|
||||
"jasmine.async": "xmodule_js/common_static/js/vendor/jasmine.async",
|
||||
"draggabilly": "xmodule_js/common_static/js/vendor/draggabilly.pkgd",
|
||||
"domReady": "xmodule_js/common_static/js/vendor/domReady",
|
||||
|
||||
"coffee/src/ajax_prefix": "xmodule_js/common_static/coffee/src/ajax_prefix"
|
||||
}
|
||||
|
||||
@@ -1,13 +1,8 @@
|
||||
define ["js/views/overview", "js/views/feedback_notification", "sinon", "js/base"],
|
||||
define ["js/views/overview", "js/views/feedback_notification", "sinon", "js/base", "date", "jquery.timepicker"],
|
||||
(OverviewDragger, Notification, sinon) ->
|
||||
|
||||
describe "Course Overview", ->
|
||||
beforeEach ->
|
||||
_.each ["/static/js/vendor/date.js", "/static/js/vendor/timepicker/jquery.timepicker.js", "/jsi18n/", "/static/js/vendor/draggabilly.pkgd.js"], (path) ->
|
||||
appendSetFixtures """
|
||||
<script type="text/javascript" src="#{path}"></script>
|
||||
"""
|
||||
|
||||
appendSetFixtures """
|
||||
<div class="section-published-date">
|
||||
<span class="published-status">
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
define(["jquery", "jquery.ui", "gettext", "js/views/feedback_notification", "draggabilly"],
|
||||
function ($, ui, gettext, NotificationView, Draggabilly) {
|
||||
define(["domReady", "jquery", "jquery.ui", "gettext", "js/views/feedback_notification", "draggabilly"],
|
||||
function (domReady, $, ui, gettext, NotificationView, Draggabilly) {
|
||||
|
||||
var overviewDragger = {
|
||||
droppableClasses: 'drop-target drop-target-prepend drop-target-before drop-target-after',
|
||||
@@ -294,7 +294,7 @@ define(["jquery", "jquery.ui", "gettext", "js/views/feedback_notification", "dra
|
||||
}
|
||||
};
|
||||
|
||||
$(document).ready(function () {
|
||||
domReady(function() {
|
||||
// Section
|
||||
overviewDragger.makeDraggable(
|
||||
'.courseware-section',
|
||||
|
||||
@@ -52,6 +52,9 @@ lib_paths:
|
||||
- xmodule_js/src/xmodule.js
|
||||
- xmodule_js/common_static/js/test/i18n.js
|
||||
- xmodule_js/common_static/js/vendor/draggabilly.pkgd.js
|
||||
- xmodule_js/common_static/js/vendor/date.js
|
||||
- xmodule_js/common_static/js/vendor/domReady.js
|
||||
- xmodule_js/common_static/js/vendor/jquery.smooth-scroll.min.js
|
||||
|
||||
# Paths to source JavaScript files
|
||||
src_paths:
|
||||
|
||||
Reference in New Issue
Block a user