Commit 1de194aa by cahrens

Use RequireJS for test dependencies, and use domReady.

parent 32864045
......@@ -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"
}
......
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">
......
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:
......
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