diff --git a/lms/static/js/spec/learner_dashboard/program_card_view_spec.js b/lms/static/js/spec/learner_dashboard/program_card_view_spec.js index f0151c8ba8..43eac9542f 100644 --- a/lms/static/js/spec/learner_dashboard/program_card_view_spec.js +++ b/lms/static/js/spec/learner_dashboard/program_card_view_spec.js @@ -67,7 +67,7 @@ define([ }); it('should handle exceptions from reEvaluatePicture', function(){ - spyOn(view, 'reEvaluatePicture').andCallFake(function(){ + spyOn(view, 'reEvaluatePicture').and.callFake(function(){ throw {name:'Picturefill had exceptions'}; }); view.reLoadBannerImage(); diff --git a/lms/static/js/spec/main.js b/lms/static/js/spec/main.js index f77aeca6bd..b8942877cd 100644 --- a/lms/static/js/spec/main.js +++ b/lms/static/js/spec/main.js @@ -31,8 +31,8 @@ 'moment': 'xmodule_js/common_static/js/vendor/moment.min', 'moment-with-locales': 'xmodule_js/common_static/js/vendor/moment-with-locales.min', 'text': 'xmodule_js/common_static/js/vendor/requirejs/text', - 'underscore': 'xmodule_js/common_static/common/js/vendor/underscore', - 'underscore.string': 'xmodule_js/common_static/common/js/vendor/underscore.string', + 'underscore': 'common/js/vendor/underscore', + 'underscore.string': 'common/js/vendor/underscore.string', 'backbone': 'xmodule_js/common_static/js/vendor/backbone-min', 'backbone.associations': 'xmodule_js/common_static/js/vendor/backbone-associations-min', 'backbone.paginator': 'xmodule_js/common_static/js/vendor/backbone.paginator.min', @@ -49,7 +49,6 @@ 'jasmine-stealth': 'xmodule_js/common_static/js/vendor/jasmine-stealth', 'jasmine-waituntil': 'xmodule_js/common_static/js/libs/jasmine-waituntil', 'jasmine-extensions': 'xmodule_js/common_static/js/libs/jasmine-extensions', - 'draggabilly': 'xmodule_js/common_static/js/vendor/draggabilly.pkgd', 'domReady': 'xmodule_js/common_static/js/vendor/domReady', 'mathjax': '//cdn.mathjax.org/mathjax/2.6-latest/MathJax.js?config=TeX-MML-AM_SVG&delayStartupUntil=configured', // jshint ignore:line 'youtube': '//www.youtube.com/player_api?noext', diff --git a/lms/static/js/spec/main_requirejs_coffee.js b/lms/static/js/spec/main_requirejs_coffee.js new file mode 100644 index 0000000000..0597f1e952 --- /dev/null +++ b/lms/static/js/spec/main_requirejs_coffee.js @@ -0,0 +1,23 @@ +(function(requirejs) { + 'use strict'; + requirejs.config({ + baseUrl: '/base/', + paths: { + "moment": "xmodule_js/common_static/js/vendor/moment.min", + "modernizr": "xmodule_js/common_static/edx-pattern-library/js/modernizr-custom", + "afontgarde": "xmodule_js/common_static/edx-pattern-library/js/afontgarde", + "edxicons": "xmodule_js/common_static/edx-pattern-library/js/edx-icons", + "draggabilly": "xmodule_js/common_static/js/vendor/draggabilly" + }, + "moment": { + exports: "moment" + }, + "modernizr": { + exports: "Modernizr" + }, + "afontgarde": { + exports: "AFontGarde" + } + }); + +}).call(this, requirejs, define); // jshint ignore:line diff --git a/lms/static/js/spec/student_profile/badge_view_spec.js b/lms/static/js/spec/student_profile/badge_view_spec.js index 41159423d8..d40258fcd7 100644 --- a/lms/static/js/spec/student_profile/badge_view_spec.js +++ b/lms/static/js/spec/student_profile/badge_view_spec.js @@ -52,7 +52,7 @@ define(['backbone', 'jquery', 'underscore', expect(view.createModal).toHaveBeenCalled(); }); - it("click on share button calls shows the dialog", function () { + it("click on share button calls shows the dialog", function (done) { view = createView(true); expect(view.context.ownProfile).toBeTruthy(); var shareButton = view.$el.find('button.share-button'); @@ -63,9 +63,9 @@ define(['backbone', 'jquery', 'underscore', shareButton.click(); // Note: this element should have appeared in the dom during: shareButton.click(); modalElement = $('.badges-modal'); - waitsFor(function () { + jasmine.waitUntil(function () { return modalElement.is(":visible"); - }, '', 1000); + }).always(done); }); var testBadgeNameIsDisplayed = function (ownProfile) { diff --git a/lms/static/js/spec/student_profile/section_two_tab_spec.js b/lms/static/js/spec/student_profile/section_two_tab_spec.js index b553a0735f..a0236b885a 100644 --- a/lms/static/js/spec/student_profile/section_two_tab_spec.js +++ b/lms/static/js/spec/student_profile/section_two_tab_spec.js @@ -50,7 +50,7 @@ define(['backbone', 'jquery', 'underscore', it("profile field parts are actually rendered for public profile", function () { var view = createSectionTwoView(false, true); _.each(view.options.viewList, function (fieldView) { - spyOn(fieldView, "render").andCallThrough(); + spyOn(fieldView, "render").and.callThrough(); }); view.render(); _.each(view.options.viewList, function (fieldView) { diff --git a/lms/static/karma_lms_coffee.conf.js b/lms/static/karma_lms_coffee.conf.js index 9b60807b75..dcf4529f8f 100644 --- a/lms/static/karma_lms_coffee.conf.js +++ b/lms/static/karma_lms_coffee.conf.js @@ -40,6 +40,7 @@ var files = [ {pattern: 'xmodule_js/common_static/js/vendor/jasmine-imagediff.js', included: true}, {pattern: 'xmodule_js/common_static/js/libs/jasmine-extensions.js', included: true}, {pattern: 'xmodule_js/common_static/js/vendor/requirejs/require.js', included: true}, + {pattern: 'js/spec/main_requirejs_coffee.js', included: true}, {pattern: 'js/RequireJS-namespace-undefine.js', included: true}, {pattern: 'xmodule_js/common_static/js/vendor/jquery-ui.min.js', included: true}, {pattern: 'xmodule_js/common_static/js/vendor/jquery.cookie.js', included: true}, @@ -55,6 +56,12 @@ var files = [ {pattern: 'xmodule_js/src/capa/*.js', included: true}, {pattern: 'xmodule_js/src/video/*.js', included: true}, {pattern: 'xmodule_js/src/xmodule.js', included: true}, + {pattern: 'xmodule_js/common_static/js/vendor/draggabilly.js', included: false}, + + {pattern: 'xmodule_js/common_static/edx-ui-toolkit/js/utils/global-loader.js', included: true}, + {pattern: 'xmodule_js/common_static/edx-pattern-library/js/modernizr-custom.js', included: false}, + {pattern: 'xmodule_js/common_static/edx-pattern-library/js/afontgarde.js', included: false}, + {pattern: 'xmodule_js/common_static/edx-pattern-library/js/edx-icons.js', included: false}, // source files {pattern: 'coffee/src/**/*.js', included: true, nocache: true},