Commit d462c73f by Andy Armstrong

Use the UI Toolkit's spec helpers.

parent cae69f96
require ["jquery", "backbone", "coffee/src/main", "common/js/spec_helpers/ajax_helpers", "jquery.cookie"],
require ["jquery", "backbone", "coffee/src/main", "edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers", "jquery.cookie"],
($, Backbone, main, AjaxHelpers) ->
describe "CMS", ->
it "should initialize URL", ->
......
define ["js/models/section", "common/js/spec_helpers/ajax_helpers", "js/utils/module"], (Section, AjaxHelpers, ModuleUtils) ->
define ["js/models/section", "edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers", "js/utils/module"], (Section, AjaxHelpers, ModuleUtils) ->
describe "Section", ->
describe "basic", ->
beforeEach ->
......
define ["jquery", "common/js/spec_helpers/ajax_helpers", "squire"],
define ["jquery", "edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers", "squire"],
($, AjaxHelpers, Squire) ->
assetLibraryTpl = readFixtures('asset-library.underscore')
......
define ["js/views/course_info_handout", "js/views/course_info_update", "js/models/module_info", "js/collections/course_update", "common/js/spec_helpers/ajax_helpers"],
define ["js/views/course_info_handout", "js/views/course_info_update", "js/models/module_info",
"js/collections/course_update", "edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers"],
(CourseInfoHandoutsView, CourseInfoUpdateView, ModuleInfo, CourseUpdateCollection, AjaxHelpers) ->
describe "Course Updates and Handouts", ->
......
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", "common/js/components/views/feedback_prompt",
"common/js/components/views/feedback_notification", "common/js/components/utils/view_utils","common/js/spec_helpers/ajax_helpers",
"common/js/components/views/feedback_notification", "common/js/components/utils/view_utils",
"edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers",
"js/spec_helpers/modal_helpers"],
(Textbook, Chapter, ChapterSet, Course, TextbookSet, ShowTextbook, EditTextbook, ListTextbooks, EditChapter, Prompt, Notification, ViewUtils, AjaxHelpers, modal_helpers) ->
(Textbook, Chapter, ChapterSet, Course, TextbookSet, ShowTextbook, EditTextbook, ListTextbooks, EditChapter,
Prompt, Notification, ViewUtils, AjaxHelpers, modal_helpers) ->
describe "ShowTextbook", ->
tpl = readFixtures('show-textbook.underscore')
......@@ -215,80 +217,80 @@ define ["js/models/textbook", "js/models/chapter", "js/collections/chapter", "js
# testing for element focused seems to be tricky
# (see http://stackoverflow.com/questions/967096)
# and the following doesn't seem to work
# expect($inputEl).toBeFocused()
# expect($inputEl.find(':focus').length).toEqual(1)
# expect($inputEl).toBeFocused()
# expect($inputEl.find(':focus').length).toEqual(1)
expect(jQuery.fn.focus).toHaveBeenCalledOnJQueryObject($inputEl)
# describe "ListTextbooks", ->
# noTextbooksTpl = readFixtures("no-textbooks.underscore")
#
# beforeEach ->
# setFixtures($("<script>", {id: "no-textbooks-tpl", type: "text/template"}).text(noTextbooksTpl))
# @showSpies = spyOnConstructor("ShowTextbook", ["render"])
# @showSpies.render.and.returnValue(@showSpies) # equivalent of `return this`
# showEl = $("<li>")
# @showSpies.$el = showEl
# @showSpies.el = showEl.get(0)
# @editSpies = spyOnConstructor("EditTextbook", ["render"])
# editEl = $("<li>")
# @editSpies.render.and.returnValue(@editSpies)
# @editSpies.$el = editEl
# @editSpies.el= editEl.get(0)
#
# @collection = new TextbookSet
# @view = new ListTextbooks({collection: @collection})
# @view.render()
#
# it "should render the empty template if there are no textbooks", ->
# expect(@view.$el).toContainText("You haven't added any textbooks to this course yet")
# expect(@view.$el).toContain(".new-button")
# expect(@showSpies.constructor).not.toHaveBeenCalled()
# expect(@editSpies.constructor).not.toHaveBeenCalled()
#
# it "should render ShowTextbook views by default if no textbook is being edited", ->
# # add three empty textbooks to the collection
# @collection.add([{}, {}, {}])
# # reset spies due to re-rendering on collection modification
# @showSpies.constructor.reset()
# @editSpies.constructor.reset()
# # render once and test
# @view.render()
#
# expect(@view.$el).not.toContainText(
# "You haven't added any textbooks to this course yet")
# expect(@showSpies.constructor).toHaveBeenCalled()
# expect(@showSpies.constructor.calls.length).toEqual(3);
# expect(@editSpies.constructor).not.toHaveBeenCalled()
#
# it "should render an EditTextbook view for a textbook being edited", ->
# # add three empty textbooks to the collection: the first and third
# # should be shown, and the second should be edited
# @collection.add([{editing: false}, {editing: true}, {editing: false}])
# editing = @collection.at(1)
# expect(editing.get("editing")).toBeTruthy()
# # reset spies
# @showSpies.constructor.reset()
# @editSpies.constructor.reset()
# # render once and test
# @view.render()
#
# expect(@showSpies.constructor).toHaveBeenCalled()
# expect(@showSpies.constructor.calls.length).toEqual(2)
# expect(@showSpies.constructor).not.toHaveBeenCalledWith({model: editing})
# expect(@editSpies.constructor).toHaveBeenCalled()
# expect(@editSpies.constructor.calls.length).toEqual(1)
# expect(@editSpies.constructor).toHaveBeenCalledWith({model: editing})
#
# it "should add a new textbook when the new-button is clicked", ->
# # reset spies
# @showSpies.constructor.reset()
# @editSpies.constructor.reset()
# # test
# @view.$(".new-button").click()
#
# expect(@collection.length).toEqual(1)
# expect(@view.$el).toContain(@editSpies.$el)
# expect(@view.$el).not.toContain(@showSpies.$el)
# describe "ListTextbooks", ->
# noTextbooksTpl = readFixtures("no-textbooks.underscore")
#
# beforeEach ->
# setFixtures($("<script>", {id: "no-textbooks-tpl", type: "text/template"}).text(noTextbooksTpl))
# @showSpies = spyOnConstructor("ShowTextbook", ["render"])
# @showSpies.render.and.returnValue(@showSpies) # equivalent of `return this`
# showEl = $("<li>")
# @showSpies.$el = showEl
# @showSpies.el = showEl.get(0)
# @editSpies = spyOnConstructor("EditTextbook", ["render"])
# editEl = $("<li>")
# @editSpies.render.and.returnValue(@editSpies)
# @editSpies.$el = editEl
# @editSpies.el= editEl.get(0)
#
# @collection = new TextbookSet
# @view = new ListTextbooks({collection: @collection})
# @view.render()
#
# it "should render the empty template if there are no textbooks", ->
# expect(@view.$el).toContainText("You haven't added any textbooks to this course yet")
# expect(@view.$el).toContain(".new-button")
# expect(@showSpies.constructor).not.toHaveBeenCalled()
# expect(@editSpies.constructor).not.toHaveBeenCalled()
#
# it "should render ShowTextbook views by default if no textbook is being edited", ->
# # add three empty textbooks to the collection
# @collection.add([{}, {}, {}])
# # reset spies due to re-rendering on collection modification
# @showSpies.constructor.reset()
# @editSpies.constructor.reset()
# # render once and test
# @view.render()
#
# expect(@view.$el).not.toContainText(
# "You haven't added any textbooks to this course yet")
# expect(@showSpies.constructor).toHaveBeenCalled()
# expect(@showSpies.constructor.calls.length).toEqual(3);
# expect(@editSpies.constructor).not.toHaveBeenCalled()
#
# it "should render an EditTextbook view for a textbook being edited", ->
# # add three empty textbooks to the collection: the first and third
# # should be shown, and the second should be edited
# @collection.add([{editing: false}, {editing: true}, {editing: false}])
# editing = @collection.at(1)
# expect(editing.get("editing")).toBeTruthy()
# # reset spies
# @showSpies.constructor.reset()
# @editSpies.constructor.reset()
# # render once and test
# @view.render()
#
# expect(@showSpies.constructor).toHaveBeenCalled()
# expect(@showSpies.constructor.calls.length).toEqual(2)
# expect(@showSpies.constructor).not.toHaveBeenCalledWith({model: editing})
# expect(@editSpies.constructor).toHaveBeenCalled()
# expect(@editSpies.constructor.calls.length).toEqual(1)
# expect(@editSpies.constructor).toHaveBeenCalledWith({model: editing})
#
# it "should add a new textbook when the new-button is clicked", ->
# # reset spies
# @showSpies.constructor.reset()
# @editSpies.constructor.reset()
# # test
# @view.$(".new-button").click()
#
# expect(@collection.length).toEqual(1)
# expect(@view.$el).toContain(@editSpies.$el)
# expect(@view.$el).not.toContain(@showSpies.$el)
describe "EditChapter", ->
......@@ -318,15 +320,15 @@ define ["js/models/textbook", "js/models/chapter", "js/collections/chapter", "js
expect(@collection.length).toEqual(0)
expect(@view.remove).toHaveBeenCalled()
# it "can open an upload dialog", ->
# uploadSpies = spyOnConstructor("UploadDialog", ["show", "el"])
# uploadSpies.show.and.returnValue(uploadSpies)
#
# @view.render().$(".action-upload").click()
# ctorOptions = uploadSpies.constructor.calls.mostRecent().args[0]
# expect(ctorOptions.model.get('title')).toMatch(/abcde/)
# expect(typeof ctorOptions.onSuccess).toBe('function')
# expect(uploadSpies.show).toHaveBeenCalled()
# it "can open an upload dialog", ->
# uploadSpies = spyOnConstructor("UploadDialog", ["show", "el"])
# uploadSpies.show.and.returnValue(uploadSpies)
#
# @view.render().$(".action-upload").click()
# ctorOptions = uploadSpies.constructor.calls.mostRecent().args[0]
# expect(ctorOptions.model.get('title')).toMatch(/abcde/)
# expect(typeof ctorOptions.onSuccess).toBe('function')
# expect(uploadSpies.show).toHaveBeenCalled()
# Disabling because this test does not close the modal dialog. This can cause
# tests that run after it to fail (see STUD-1963).
......
define ["js/models/uploads", "js/views/uploads", "js/models/chapter", "common/js/spec_helpers/ajax_helpers", "js/spec_helpers/modal_helpers"], (FileUpload, UploadDialog, Chapter, AjaxHelpers, modal_helpers) ->
define ["js/models/uploads", "js/views/uploads", "js/models/chapter",
"edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers", "js/spec_helpers/modal_helpers"],
(FileUpload, UploadDialog, Chapter, AjaxHelpers, modal_helpers) ->
describe "UploadDialog", ->
tpl = readFixtures("upload-dialog.underscore")
......
......@@ -8,7 +8,7 @@ define([ // jshint ignore:line
'js/certificates/views/certificate_details',
'js/certificates/views/certificate_preview',
'common/js/components/views/feedback_notification',
'common/js/spec_helpers/ajax_helpers',
'edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers',
'common/js/spec_helpers/template_helpers',
'common/js/spec_helpers/view_helpers',
'js/spec_helpers/validation_helpers',
......
......@@ -8,7 +8,7 @@ define([ // jshint ignore:line
'js/certificates/collections/certificates',
'js/certificates/views/certificate_editor',
'common/js/components/views/feedback_notification',
'common/js/spec_helpers/ajax_helpers',
'edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers',
'common/js/spec_helpers/template_helpers',
'common/js/spec_helpers/view_helpers',
'js/spec_helpers/validation_helpers',
......
......@@ -7,7 +7,7 @@ define([ // jshint ignore:line
'js/certificates/views/certificate_preview',
'common/js/spec_helpers/template_helpers',
'common/js/spec_helpers/view_helpers',
'common/js/spec_helpers/ajax_helpers'
'edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers'
],
function(_, $, Course, CertificatePreview, TemplateHelpers, ViewHelpers, AjaxHelpers) {
'use strict';
......
......@@ -11,7 +11,7 @@ define([ // jshint ignore:line
'js/certificates/views/certificates_list',
'js/certificates/views/certificate_preview',
'common/js/components/views/feedback_notification',
'common/js/spec_helpers/ajax_helpers',
'edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers',
'common/js/spec_helpers/template_helpers',
'js/certificates/spec/custom_matchers'
],
......
define(["js/utils/drag_and_drop", "common/js/components/views/feedback_notification", "common/js/spec_helpers/ajax_helpers", "jquery", "underscore"],
define(["js/utils/drag_and_drop", "common/js/components/views/feedback_notification",
"edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers", "jquery", "underscore"],
function (ContentDragger, Notification, AjaxHelpers, $, _) {
describe("Overview drag and drop functionality", function () {
beforeEach(function () {
......
define(
[
'jquery', 'underscore',
'edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers',
'js/views/video/transcripts/utils',
'js/views/video/transcripts/metadata_videolist', 'js/models/metadata',
'js/views/abstract_editor',
'common/js/spec_helpers/ajax_helpers',
'xmodule'
],
function ($, _, Utils, VideoList, MetadataModel, AbstractEditor, AjaxHelpers) {
function ($, _, AjaxHelpers, Utils, VideoList, MetadataModel, AbstractEditor) {
'use strict';
describe('CMS.Views.Metadata.VideoList', function () {
var videoListEntryTemplate = readFixtures(
......
define([ "jquery", "common/js/spec_helpers/ajax_helpers", "URI", "js/views/assets",
define([ "jquery", "edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers", "URI", "js/views/assets",
"js/collections/asset", "common/js/spec_helpers/view_helpers"],
function ($, AjaxHelpers, URI, AssetsView, AssetCollection, ViewHelpers) {
......
define([ "jquery", "common/js/spec_helpers/ajax_helpers", "js/spec_helpers/edit_helpers",
define([ "jquery", "edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers", "js/spec_helpers/edit_helpers",
"js/views/container", "js/models/xblock_info", "jquery.simulate",
"xmodule", "coffee/src/main", "xblock/cms.runtime.v1"],
function ($, AjaxHelpers, EditHelpers, ContainerView, XBlockInfo) {
......
define([
'underscore', 'js/models/course', 'js/models/group_configuration', 'js/models/group',
'js/collections/group_configuration', 'js/collections/group',
'js/views/group_configuration_details', 'js/views/group_configurations_list', 'js/views/group_configuration_editor',
'js/views/group_configuration_item', 'js/views/experiment_group_edit', 'js/views/content_group_list',
'js/views/content_group_details', 'js/views/content_group_editor', 'js/views/content_group_item',
'common/js/components/views/feedback_notification', 'common/js/spec_helpers/ajax_helpers', 'common/js/spec_helpers/template_helpers',
'common/js/spec_helpers/view_helpers'
'underscore', 'edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers', 'common/js/spec_helpers/template_helpers',
'common/js/spec_helpers/view_helpers', 'js/models/course', 'js/models/group_configuration', 'js/models/group',
'js/collections/group_configuration', 'js/collections/group', 'js/views/group_configuration_details',
'js/views/group_configurations_list', 'js/views/group_configuration_editor', 'js/views/group_configuration_item',
'js/views/experiment_group_edit', 'js/views/content_group_list', 'js/views/content_group_details',
'js/views/content_group_editor', 'js/views/content_group_item'
], function(
_, Course, GroupConfigurationModel, GroupModel, GroupConfigurationCollection, GroupCollection,
GroupConfigurationDetailsView, GroupConfigurationsListView, GroupConfigurationEditorView,
GroupConfigurationItemView, ExperimentGroupEditView, GroupList, ContentGroupDetailsView,
ContentGroupEditorView, ContentGroupItemView, Notification, AjaxHelpers, TemplateHelpers, ViewHelpers
_, AjaxHelpers, TemplateHelpers, ViewHelpers, Course, GroupConfigurationModel, GroupModel,
GroupConfigurationCollection, GroupCollection, GroupConfigurationDetailsView, GroupConfigurationsListView,
GroupConfigurationEditorView, GroupConfigurationItemView, ExperimentGroupEditView, GroupList,
ContentGroupDetailsView, ContentGroupEditorView, ContentGroupItemView
) {
'use strict';
var SELECTORS = {
......@@ -286,7 +285,7 @@ define([
it('should hide empty usage appropriately', function() {
this.model.set('showGroups', true);
this.view.$('.hide-groups').click();
assertHideEmptyUsages(this.view)
assertHideEmptyUsages(this.view);
});
it('should show non-empty usage appropriately', function() {
......@@ -298,7 +297,7 @@ define([
this.view,
'This Group Configuration is used in:',
'Cannot delete when in use by an experiment'
)
);
});
it('should hide non-empty usage appropriately', function() {
......@@ -922,7 +921,7 @@ define([
this.view,
'This content group is used in:',
'Cannot delete when in use by a unit'
)
);
});
it('should hide non-empty usage appropriately', function() {
......@@ -988,7 +987,7 @@ define([
notificationSpy = ViewHelpers.createNotificationSpy();
this.view.$(SELECTORS.inputName).val('New Content Group');
ViewHelpers.submitAndVerifyFormError(this.view, requests, notificationSpy)
ViewHelpers.submitAndVerifyFormError(this.view, requests, notificationSpy);
});
it('does not save on cancel', function() {
......
define(['jquery', 'js/factories/login', 'common/js/spec_helpers/ajax_helpers', 'common/js/components/utils/view_utils'],
define(['jquery', 'js/factories/login', 'edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers',
'common/js/components/utils/view_utils'],
function($, LoginFactory, AjaxHelpers, ViewUtils) {
'use strict';
describe("Studio Login Page", function() {
......
define(["jquery", "underscore", "common/js/spec_helpers/ajax_helpers", "js/spec_helpers/edit_helpers",
define(["jquery", "underscore", "edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers", "js/spec_helpers/edit_helpers",
"js/views/modals/edit_xblock", "js/models/xblock_info"],
function ($, _, AjaxHelpers, EditHelpers, EditXBlockModal, XBlockInfo) {
......
define(["jquery", "underscore", "common/js/spec_helpers/ajax_helpers", "URI", "js/models/xblock_info",
define(["jquery", "underscore", "edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers", "URI", "js/models/xblock_info",
"js/views/paged_container", "js/views/paging_header",
"common/js/components/views/paging_footer", "js/views/xblock"],
function ($, _, AjaxHelpers, URI, XBlockInfo, PagedContainer, PagingHeader, PagingFooter, XBlockView) {
......
define(["jquery", "underscore", "underscore.string", "common/js/spec_helpers/ajax_helpers",
define(["jquery", "underscore", "underscore.string", "edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers",
"common/js/spec_helpers/template_helpers", "js/spec_helpers/edit_helpers",
"js/views/pages/container", "js/views/pages/paged_container", "js/models/xblock_info", "jquery.simulate"],
function ($, _, str, AjaxHelpers, TemplateHelpers, EditHelpers, ContainerPage, PagedContainerPage, XBlockInfo) {
......
define(["jquery", "underscore", "underscore.string", "common/js/spec_helpers/ajax_helpers",
define(["jquery", "underscore", "underscore.string", "edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers",
"common/js/spec_helpers/template_helpers", "js/spec_helpers/edit_helpers",
"common/js/components/views/feedback_prompt", "js/views/pages/container",
"js/views/pages/container_subviews", "js/models/xblock_info", "js/views/utils/xblock_utils",
......
define(["jquery", "common/js/spec_helpers/ajax_helpers", "common/js/components/utils/view_utils", "js/views/pages/course_outline",
"js/models/xblock_outline_info", "js/utils/date_utils", "js/spec_helpers/edit_helpers",
"common/js/spec_helpers/template_helpers", 'js/models/course',],
define(["jquery", "edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers", "common/js/components/utils/view_utils",
"js/views/pages/course_outline", "js/models/xblock_outline_info", "js/utils/date_utils",
"js/spec_helpers/edit_helpers", "common/js/spec_helpers/template_helpers", 'js/models/course'],
function($, AjaxHelpers, ViewUtils, CourseOutlinePage, XBlockOutlineInfo, DateUtils,
EditHelpers, TemplateHelpers, Course) {
......
define(["jquery", "common/js/spec_helpers/ajax_helpers", "common/js/spec_helpers/view_helpers", "js/views/course_rerun",
"js/views/utils/create_course_utils", "common/js/components/utils/view_utils", "jquery.simulate"],
define(["jquery", "edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers", "common/js/spec_helpers/view_helpers",
"js/views/course_rerun", "js/views/utils/create_course_utils", "common/js/components/utils/view_utils",
"jquery.simulate"],
function ($, AjaxHelpers, ViewHelpers, CourseRerunUtils, CreateCourseUtilsFactory, ViewUtils) {
describe("Create course rerun page", function () {
var selectors = {
......
define(["jquery", "common/js/spec_helpers/ajax_helpers", "common/js/spec_helpers/view_helpers", "js/index",
define(["jquery",
"edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers",
"common/js/spec_helpers/view_helpers", "js/index",
"common/js/components/utils/view_utils"],
function ($, AjaxHelpers, ViewHelpers, IndexUtils, ViewUtils) {
describe("Course listing page", function () {
......
define([
"jquery", "common/js/spec_helpers/ajax_helpers", "common/js/spec_helpers/view_helpers",
"jquery", "edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers", "common/js/spec_helpers/view_helpers",
"js/factories/manage_users_lib", "common/js/components/utils/view_utils"
],
function ($, AjaxHelpers, ViewHelpers, ManageUsersFactory, ViewUtils) {
......
define([
"jquery",
"URI",
"common/js/spec_helpers/ajax_helpers",
"edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers",
"edx-ui-toolkit/js/pagination/paging-collection",
"js/views/paging",
"js/views/paging_header"
], function ($, URI, AjaxHelpers, PagingCollection, PagingView, PagingHeader) {
],
function ($, URI, AjaxHelpers, PagingCollection, PagingView, PagingHeader) {
'use strict';
var createPageableItem = function(index) {
var id = 'item_' + index;
......
define([
'jquery', 'js/models/settings/course_details', 'js/views/settings/main',
'common/js/spec_helpers/ajax_helpers', 'common/js/spec_helpers/template_helpers',
'edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers', 'common/js/spec_helpers/template_helpers',
], function($, CourseDetailsModel, MainView, AjaxHelpers, TemplateHelpers) {
'use strict';
......@@ -125,10 +125,9 @@ define([
//input some invalid values.
expect(entrance_exam_min_score.val('101').trigger('input')).toHaveClass("error");
expect(entrance_exam_min_score.val('invalidVal').trigger('input')).toHaveClass("error");
});
it('should provide a default value for the minimum score percentage', function(){
it('should provide a default value for the minimum score percentage', function() {
var entrance_exam_min_score = this.view.$(SELECTORS.entrance_exam_min_score);
......@@ -138,7 +137,7 @@ define([
.toEqual(this.model.defaults.entrance_exam_minimum_score_pct);
});
it('show and hide the grade requirement section when the check box is selected and deselected respectively', function(){
it('shows and hide the grade requirement section appropriately', function() {
var entrance_exam_enabled_field = this.view.$(SELECTORS.entrance_exam_enabled_field);
......
define(["jquery", "common/js/spec_helpers/ajax_helpers", "common/js/spec_helpers/template_helpers",
define(["jquery", "edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers", "common/js/spec_helpers/template_helpers",
"common/js/spec_helpers/view_helpers", "common/js/components/utils/view_utils", "js/models/course",
"js/views/unit_outline", "js/models/xblock_info"],
function ($, AjaxHelpers, TemplateHelpers, ViewHelpers, ViewUtils,
function($, AjaxHelpers, TemplateHelpers, ViewHelpers, ViewUtils,
Course, UnitOutlineView, XBlockInfo) {
'use strict';
describe("UnitOutlineView", function() {
var createUnitOutlineView, createMockXBlockInfo,
......
define([ "jquery", "underscore", "common/js/spec_helpers/ajax_helpers", "js/spec_helpers/edit_helpers",
define([ "jquery", "underscore", "edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers", "js/spec_helpers/edit_helpers",
"js/views/xblock_editor", "js/models/xblock_info"],
function ($, _, AjaxHelpers, EditHelpers, XBlockEditorView, XBlockInfo) {
......
define(["jquery", "URI", "common/js/spec_helpers/ajax_helpers", "common/js/components/utils/view_utils",
define(["jquery", "URI", "edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers", "common/js/components/utils/view_utils",
"js/views/xblock", "js/models/xblock_info", "xmodule", "coffee/src/main", "xblock/cms.runtime.v1"],
function ($, URI, AjaxHelpers, ViewUtils, XBlockView, XBlockInfo) {
"use strict";
......
define(["jquery", "common/js/spec_helpers/ajax_helpers", "common/js/spec_helpers/template_helpers",
define(["jquery", "edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers", "common/js/spec_helpers/template_helpers",
"js/spec_helpers/edit_helpers", "js/models/xblock_info", "js/views/xblock_string_field_editor"],
function ($, AjaxHelpers, TemplateHelpers, EditHelpers, XBlockInfo, XBlockStringFieldEditor) {
describe("XBlockStringFieldEditorView", function () {
......
/**
* Provides helper methods for invoking Studio editors in Jasmine tests.
*/
define(["jquery", "underscore", "common/js/spec_helpers/ajax_helpers", "common/js/spec_helpers/template_helpers",
"js/spec_helpers/modal_helpers", "js/views/modals/edit_xblock", "js/collections/component_template",
"xmodule", "coffee/src/main", "xblock/cms.runtime.v1"],
define(["jquery", "underscore", "edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers",
"common/js/spec_helpers/template_helpers", "js/spec_helpers/modal_helpers", "js/views/modals/edit_xblock",
"js/collections/component_template", "xmodule", "coffee/src/main", "xblock/cms.runtime.v1"],
function($, _, AjaxHelpers, TemplateHelpers, modal_helpers, EditXBlockModal, ComponentTemplates) {
var installMockXBlock, uninstallMockXBlock, installMockXModule, uninstallMockXModule,
......
......@@ -3,7 +3,7 @@ define([
'backbone',
'underscore',
'edx-ui-toolkit/js/pagination/paging-collection',
'common/js/spec_helpers/ajax_helpers',
'edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers',
'common/js/components/views/paginated_view'
], function ($, Backbone, _, PagingCollection, AjaxHelpers, PaginatedView) {
'use strict';
......
......@@ -3,7 +3,7 @@ define([
'URI',
'underscore',
'edx-ui-toolkit/js/pagination/paging-collection',
'common/js/spec_helpers/ajax_helpers',
'edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers',
'common/js/components/views/paging_footer'
], function ($, URI, _, PagingCollection, AjaxHelpers, PagingFooter) {
'use strict';
......
define([
'underscore',
'URI',
'edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers',
'edx-ui-toolkit/js/pagination/paging-collection',
'common/js/components/views/search_field',
'common/js/spec_helpers/ajax_helpers'
], function (_, URI, PagingCollection, SearchFieldView, AjaxHelpers) {
'common/js/components/views/search_field'
], function(_, URI, AjaxHelpers, PagingCollection, SearchFieldView) {
'use strict';
describe('SearchFieldView', function () {
describe('SearchFieldView', function() {
var searchFieldView,
mockUrl = '/api/mock_collection';
var newCollection = function (size, perPage) {
var results = _.map(_.range(size), function (i) { return {foo: i}; });
var newCollection = function(size, perPage) {
var results = _.map(_.range(size), function(i) { return {foo: i}; });
var TestPagingCollection = PagingCollection.extend({
state: {
pageSize: 5
......@@ -29,7 +29,7 @@ define([
return collection;
};
var createSearchFieldView = function (options) {
var createSearchFieldView = function(options) {
options = _.extend(
{
type: 'test',
......@@ -41,14 +41,14 @@ define([
return new SearchFieldView(options);
};
var assertQueryParams = function (request, expectedParameters) {
var assertQueryParams = function(request, expectedParameters) {
var urlParams = new URI(request.url).query(true);
_.each(expectedParameters, function (value, key) {
_.each(expectedParameters, function(value, key) {
expect(urlParams[key]).toBe(value);
});
};
var assertNotInQueryParams = function (request, param) {
var assertNotInQueryParams = function(request, param) {
var urlParams = new URI(request.url).query(true);
return !urlParams.hasOwnProperty(param);
};
......@@ -57,20 +57,20 @@ define([
setFixtures('<section class="test-search"></section>');
});
it('correctly displays itself', function () {
it('correctly displays itself', function() {
searchFieldView = createSearchFieldView().render();
expect(searchFieldView.$('.search-field').val(), '');
expect(searchFieldView.$('.action-clear')).toHaveClass('is-hidden');
});
it('can display with an initial search string', function () {
it('can display with an initial search string', function() {
searchFieldView = createSearchFieldView({
searchString: 'foo'
}).render();
expect(searchFieldView.$('.search-field').val(), 'foo');
});
it('refreshes the collection when performing a search', function () {
it('refreshes the collection when performing a search', function() {
var requests = AjaxHelpers.requests(this);
searchFieldView = createSearchFieldView().render();
searchFieldView.$('.search-field').val('foo');
......@@ -90,7 +90,7 @@ define([
expect(searchFieldView.$('.search-field').val(), 'foo');
});
it('can clear the search', function () {
it('can clear the search', function() {
var requests = AjaxHelpers.requests(this);
searchFieldView = createSearchFieldView({
searchString: 'foo'
......
define(['sinon', 'underscore', 'URI'], function(sinon, _, URI) {
'use strict';
var XML_HTTP_READY_STATES, fakeServer, fakeRequests, currentRequest, expectRequest, expectNoRequests,
expectJsonRequest, expectPostRequest, expectRequestURL, skipResetRequest,
respondWithJson, respondWithError, respondWithTextError, respondWithNoContent;
XML_HTTP_READY_STATES = {
UNSENT: 0,
OPENED: 1,
LOADING: 3,
DONE: 4
};
/* These utility methods are used by Jasmine tests to create a mock server or
* get reference to mock requests. In either case, the cleanup (restore) is done with
* an after function.
*
* This pattern is being used instead of the more common beforeEach/afterEach pattern
* because we were seeing sporadic failures in the afterEach restore call. The cause of the
* errors were that one test suite was incorrectly being linked as the parent of an unrelated
* test suite (causing both suites' afterEach methods to be called). No solution for the root
* cause has been found, but initializing sinon and cleaning it up on a method-by-method
* basis seems to work. For more details, see STUD-1264.
*/
/**
* Get a reference to the mocked server, and respond
* to all requests with the specified statusCode.
*/
fakeServer = function (response) {
var server = sinon.fakeServer.create();
afterEach(function() {
if (server) {
server.restore();
}
});
server.respondWith(response);
return server;
};
/**
* Keep track of all requests to a fake server, and
* return a reference to the Array. This allows tests
* to respond for individual requests.
*/
fakeRequests = function () {
var requests = [],
xhr = sinon.useFakeXMLHttpRequest();
requests.currentIndex = 0;
xhr.onCreate = function(request) {
requests.push(request);
};
afterEach(function() {
if (xhr && xhr.hasOwnProperty('restore')) {
xhr.restore();
}
});
return requests;
};
/**
* Returns the request that has not yet been responded to. If no such request
* is available then the current test will fail.
* @param requests The Sinon requests list.
* @returns {*} The current request.
*/
currentRequest = function(requests) {
expect(requests.length).toBeGreaterThan(requests.currentIndex);
return requests[requests.currentIndex];
};
expectRequest = function(requests, method, url, body) {
var request = currentRequest(requests);
expect(request.readyState).toEqual(XML_HTTP_READY_STATES.OPENED);
expect(request.url).toEqual(url);
expect(request.method).toEqual(method);
if (typeof body === 'undefined') {
// The body of the request may not be germane to the current test-- like some call by a library,
// so allow it to be ignored.
return;
}
expect(request.requestBody).toEqual(body);
};
/**
* Verifies the there are no unconsumed requests.
*/
expectNoRequests = function(requests) {
expect(requests.length).toEqual(requests.currentIndex);
};
expectJsonRequest = function(requests, method, url, jsonRequest) {
jsonRequest = jsonRequest || null;
var request = currentRequest(requests);
expect(request.readyState).toEqual(XML_HTTP_READY_STATES.OPENED);
expect(request.url).toEqual(url);
expect(request.method).toEqual(method);
expect(JSON.parse(request.requestBody)).toEqual(jsonRequest === undefined ? null : jsonRequest);
};
/**
* Expect that a JSON request be made with the given URL and parameters.
* @param requests The collected requests
* @param expectedUrl The expected URL excluding the parameters
* @param expectedParameters An object representing the URL parameters
*/
expectRequestURL = function(requests, expectedUrl, expectedParameters) {
var request = currentRequest(requests),
parameters;
expect(new URI(request.url).path()).toEqual(expectedUrl);
parameters = new URI(request.url).query(true);
delete parameters._; // Ignore the cache-busting argument
expect(parameters).toEqual(expectedParameters);
};
/**
* Intended for use with POST requests using application/x-www-form-urlencoded.
*/
expectPostRequest = function(requests, url, body) {
var request = currentRequest(requests);
expect(request.readyState).toEqual(XML_HTTP_READY_STATES.OPENED);
expect(request.url).toEqual(url);
expect(request.method).toEqual("POST");
expect(_.difference(request.requestBody.split('&'), body.split('&'))).toEqual([]);
};
/**
* Verify that the HTTP request was marked as reset, and then skip it.
*
* Note: this is typically used when code has explicitly canceled a request
* after it has been sent. A good example is when a user chooses to cancel
* a slow running search.
*/
skipResetRequest = function(requests) {
var request = currentRequest(requests);
expect(request.readyState).toEqual(XML_HTTP_READY_STATES.UNSENT);
requests.currentIndex++;
};
respondWithJson = function(requests, jsonResponse) {
var request = currentRequest(requests);
request.respond(200,
{ 'Content-Type': 'application/json' },
JSON.stringify(jsonResponse));
requests.currentIndex++;
};
respondWithError = function(requests, statusCode, jsonResponse) {
var request = currentRequest(requests);
if (_.isUndefined(statusCode)) {
statusCode = 500;
}
if (_.isUndefined(jsonResponse)) {
jsonResponse = {};
}
request.respond(
statusCode,
{ 'Content-Type': 'application/json' },
JSON.stringify(jsonResponse)
);
requests.currentIndex++;
};
respondWithTextError = function(requests, statusCode, textResponse) {
var request = currentRequest(requests);
if (_.isUndefined(statusCode)) {
statusCode = 500;
}
if (_.isUndefined(textResponse)) {
textResponse = "";
}
request.respond(
statusCode,
{ 'Content-Type': 'text/plain' },
textResponse
);
requests.currentIndex++;
};
respondWithNoContent = function(requests) {
var request = currentRequest(requests);
request.respond(
204,
{ 'Content-Type': 'application/json' }
);
requests.currentIndex++;
};
return {
server: fakeServer,
requests: fakeRequests,
currentRequest: currentRequest,
expectRequest: expectRequest,
expectNoRequests: expectNoRequests,
expectJsonRequest: expectJsonRequest,
expectPostRequest: expectPostRequest,
expectRequestURL: expectRequestURL,
skipResetRequest: skipResetRequest,
respondWithJson: respondWithJson,
respondWithError: respondWithError,
respondWithTextError: respondWithTextError,
respondWithNoContent: respondWithNoContent
};
});
/**
* Generally useful helper functions for writing Jasmine unit tests.
*/
define([], function () {
'use strict';
/**
* Runs func as a test case multiple times, using entries from data as arguments. Like Python's DDT.
* @param data An object mapping test names to arrays of function parameters. The name is passed to it() as the name
* of the test case, and the list of arguments is applied as arguments to func.
* @param func The function that actually expresses the logic of the test.
*/
var withData = function (data, func) {
for (var name in data) {
if (data.hasOwnProperty(name)) {
(function (name) {
it(name, function () {
func.apply(this, data[name]);
});
})(name);
}
}
};
/**
* Runs test multiple times, wrapping each call in a describe with beforeEach specified by setup and arguments and
* name coming from entries in config.
* @param config An object mapping configuration names to arrays of setup function parameters. The name is passed
* to describe as the name of the group of tests, and the list of arguments is applied as arguments to setup.
* @param setup The function to setup the given configuration before each test case. Runs in beforeEach.
* @param test The function that actually express the logic of the test. May include it() or more describe().
*/
var withConfiguration = function (config, setup, test) {
for (var name in config) {
if (config.hasOwnProperty(name)) {
(function (name) {
describe(name, function () {
beforeEach(function () {
setup.apply(this, config[name]);
});
test();
});
})(name);
}
}
};
return {
withData: withData,
withConfiguration: withConfiguration
};
});
......@@ -4,7 +4,7 @@
;(function (define) {
'use strict';
define(["jquery", "common/js/components/views/feedback_notification", "common/js/components/views/feedback_prompt",
'common/js/spec_helpers/ajax_helpers'],
'edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers'],
function($, NotificationView, Prompt, AjaxHelpers) {
var installViewTemplates, createFeedbackSpy, verifyFeedbackShowing,
verifyFeedbackHidden, createNotificationSpy, verifyNotificationShowing,
......
define([
'common/js/spec_helpers/ajax_helpers',
'edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers',
'support/js/spec_helpers/enrollment_helpers',
'support/js/collections/enrollment',
], function (AjaxHelpers, EnrollmentHelpers, EnrollmentCollection) {
......
define([
'common/js/spec_helpers/ajax_helpers',
'edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers',
'support/js/spec_helpers/enrollment_helpers',
'support/js/models/enrollment'
], function (AjaxHelpers, EnrollmentHelpers, EnrollmentModel) {
......
define([
'jquery',
'common/js/spec_helpers/ajax_helpers',
'edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers',
'support/js/views/certificates'
], function($, AjaxHelpers, CertificatesView) {
'use strict';
......
define([
'underscore',
'common/js/spec_helpers/ajax_helpers',
'edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers',
'support/js/spec_helpers/enrollment_helpers',
'support/js/models/enrollment',
'support/js/views/enrollment_modal'
......
define([
'underscore',
'common/js/spec_helpers/ajax_helpers',
'edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers',
'support/js/spec_helpers/enrollment_helpers',
'support/js/views/enrollment'
], function (_, AjaxHelpers, EnrollmentHelpers, EnrollmentView) {
......
define(['backbone', 'URI', 'underscore', 'common/js/spec_helpers/ajax_helpers',
define(['backbone', 'URI', 'underscore', 'edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers',
'teams/js/spec_helpers/team_spec_helpers'],
function (Backbone, URI, _, AjaxHelpers, TeamSpecHelpers) {
'use strict';
......
......@@ -2,7 +2,7 @@ define([
'jquery',
'underscore',
'backbone',
'common/js/spec_helpers/ajax_helpers',
'edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers',
'teams/js/views/edit_team_members',
'teams/js/models/team',
'teams/js/views/team_utils',
......
......@@ -2,7 +2,7 @@ define([
'jquery',
'underscore',
'backbone',
'common/js/spec_helpers/ajax_helpers',
'edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers',
'common/js/spec_helpers/page_helpers',
'teams/js/views/edit_team',
'teams/js/models/team',
......
......@@ -6,7 +6,7 @@ define([
'teams/js/views/instructor_tools',
'teams/js/views/team_utils',
'teams/js/spec_helpers/team_spec_helpers',
'common/js/spec_helpers/ajax_helpers',
'edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers',
'common/js/spec_helpers/page_helpers'
], function ($, Backbone, _, Team, InstructorToolsView, TeamUtils, TeamSpecHelpers, AjaxHelpers, PageHelpers) {
'use strict';
......
......@@ -3,7 +3,7 @@ define([
'teams/js/collections/my_teams',
'teams/js/views/my_teams',
'teams/js/spec_helpers/team_spec_helpers',
'common/js/spec_helpers/ajax_helpers'
'edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers'
], function (Backbone, MyTeamsCollection, MyTeamsView, TeamSpecHelpers, AjaxHelpers) {
'use strict';
describe('My Teams View', function () {
......
define([
'underscore', 'common/js/spec_helpers/ajax_helpers', 'teams/js/views/team_discussion',
'underscore', 'edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers', 'teams/js/views/team_discussion',
'teams/js/spec_helpers/team_spec_helpers',
'xmodule_js/common_static/coffee/spec/discussion/discussion_spec_helper'
], function (_, AjaxHelpers, TeamDiscussionView, TeamSpecHelpers, DiscussionSpecHelper) {
......
define([
'backbone', 'underscore', 'common/js/spec_helpers/ajax_helpers', 'teams/js/models/team',
'backbone', 'underscore', 'edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers', 'teams/js/models/team',
'teams/js/views/team_profile_header_actions', 'teams/js/spec_helpers/team_spec_helpers'
], function (Backbone, _, AjaxHelpers, TeamModel, TeamProfileHeaderActionsView, TeamSpecHelpers) {
'use strict';
......
define([
'underscore', 'common/js/spec_helpers/ajax_helpers', 'teams/js/models/team',
'underscore', 'edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers', 'teams/js/models/team',
'teams/js/views/team_profile', 'teams/js/spec_helpers/team_spec_helpers',
'xmodule_js/common_static/coffee/spec/discussion/discussion_spec_helper'
], function (_, AjaxHelpers, TeamModel, TeamProfileView, TeamSpecHelpers, DiscussionSpecHelper) {
......
......@@ -2,22 +2,22 @@ define([
'jquery',
'backbone',
'logger',
'common/js/spec_helpers/ajax_helpers',
'edx-ui-toolkit/js/utils/spec-helpers/spec-helpers',
'edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers',
'common/js/spec_helpers/page_helpers',
'common/js/spec_helpers/spec_helpers',
'teams/js/views/teams_tab',
'teams/js/spec_helpers/team_spec_helpers'
], function ($, Backbone, Logger, AjaxHelpers, PageHelpers, SpecHelpers, TeamsTabView, TeamSpecHelpers) {
], function($, Backbone, Logger, SpecHelpers, AjaxHelpers, PageHelpers, TeamsTabView, TeamSpecHelpers) {
'use strict';
describe('TeamsTab', function() {
var requests;
var expectError = function (teamsTabView, text) {
var expectError = function(teamsTabView, text) {
expect(teamsTabView.$('.warning').text()).toContain(text);
};
var expectFocus = function (element) {
var expectFocus = function(element) {
expect(element.focus).toHaveBeenCalled();
};
......@@ -50,7 +50,7 @@ define([
return teamsTabView;
};
beforeEach(function () {
beforeEach(function() {
setFixtures('<div class="teams-content"></div>');
spyOn($.fn, 'focus');
spyOn(Logger, 'log');
......@@ -62,7 +62,7 @@ define([
}
);
describe('Navigation', function () {
describe('Navigation', function() {
it('does not render breadcrumbs for the top level tabs', function() {
var teamsTabView = createTeamsTabView(this);
teamsTabView.router.navigate('#my-teams', {trigger: true});
......@@ -71,20 +71,20 @@ define([
expect(teamsTabView.$('.breadcrumbs').length).toBe(0);
});
it('does not interfere with anchor links to #content', function () {
it('does not interfere with anchor links to #content', function() {
var teamsTabView = createTeamsTabView(this);
teamsTabView.router.navigate('#content', {trigger: true});
expect(teamsTabView.$('.wrapper-msg')).toHaveClass('is-hidden');
});
it('displays and focuses an error message when trying to navigate to a nonexistent page', function () {
it('displays and focuses an error message when trying to navigate to a nonexistent page', function() {
var teamsTabView = createTeamsTabView(this);
teamsTabView.router.navigate('no_such_page', {trigger: true});
expectError(teamsTabView, 'The page "no_such_page" could not be found.');
expectFocus(teamsTabView.$('.warning'));
});
it('displays and focuses an error message when trying to navigate to a nonexistent topic', function () {
it('displays and focuses an error message when trying to navigate to a nonexistent topic', function() {
var teamsTabView = createTeamsTabView(this);
teamsTabView.router.navigate('topics/no_such_topic', {trigger: true});
AjaxHelpers.expectRequest(requests, 'GET', '/api/team/v0/topics/no_such_topic,course/1', null);
......@@ -93,7 +93,7 @@ define([
expectFocus(teamsTabView.$('.warning'));
});
it('displays and focuses an error message when trying to navigate to a nonexistent team', function () {
it('displays and focuses an error message when trying to navigate to a nonexistent team', function() {
var teamsTabView = createTeamsTabView(this);
teamsTabView.router.navigate('teams/' + TeamSpecHelpers.testTopicID + '/no_such_team', {trigger: true});
AjaxHelpers.expectRequest(requests, 'GET', '/api/team/v0/teams/no_such_team?expand=user', null);
......@@ -102,23 +102,27 @@ define([
expectFocus(teamsTabView.$('.warning'));
});
it('displays and focuses an error message when it receives a 401 AJAX response', function () {
it('displays and focuses an error message when it receives a 401 AJAX response', function() {
var teamsTabView = createTeamsTabView(this).render();
teamsTabView.router.navigate('topics/' + TeamSpecHelpers.testTopicID, {trigger: true});
AjaxHelpers.respondWithError(requests, 401);
expectError(teamsTabView, "Your request could not be completed. Reload the page and try again.");
expectError(teamsTabView, 'Your request could not be completed. Reload the page and try again.');
expectFocus(teamsTabView.$('.warning'));
});
it('displays and focuses an error message when it receives a 500 AJAX response', function () {
it('displays and focuses an error message when it receives a 500 AJAX response', function() {
var teamsTabView = createTeamsTabView(this).render();
teamsTabView.router.navigate('topics/' + TeamSpecHelpers.testTopicID, {trigger: true});
AjaxHelpers.respondWithError(requests, 500);
expectError(teamsTabView, "Your request could not be completed due to a server problem. Reload the page and try again. If the issue persists, click the Help tab to report the problem.");
expectError(
teamsTabView,
'Your request could not be completed due to a server problem. Reload the page and try again. ' +
'If the issue persists, click the Help tab to report the problem.'
);
expectFocus(teamsTabView.$('.warning'));
});
it('does not navigate to the topics page when syncing its collection if not on the search page', function () {
it('does not navigate to the topics page when syncing its collection if not on search page', function() {
var teamsTabView = createTeamsTabView(this),
collection = TeamSpecHelpers.createMockTeams();
teamsTabView.createTeamsListView({
......@@ -131,7 +135,7 @@ define([
});
});
describe('Analytics Events', function () {
describe('Analytics Events', function() {
SpecHelpers.withData({
'fires a page view event for the topic page': [
'topics/' + TeamSpecHelpers.testTopicID,
......@@ -173,7 +177,7 @@ define([
team_id: 'test_team_id'
}
]
}, function (url, expectedEvent) {
}, function(url, expectedEvent) {
var teamsTabView = createTeamsTabView(this, {
userInfo: TeamSpecHelpers.createMockUserInfo({staff: true})
});
......@@ -186,8 +190,8 @@ define([
});
});
describe('Discussion privileges', function () {
it('allows privileged access to any team', function () {
describe('Discussion privileges', function() {
it('allows privileged access to any team', function() {
var teamsTabView = createTeamsTabView(this, {
userInfo: TeamSpecHelpers.createMockUserInfo({privileged: true})
});
......@@ -197,7 +201,7 @@ define([
expect(teamsTabView.readOnlyDiscussion(undefined)).toBe(false);
});
it('allows access to a team which an unprivileged user is a member of', function () {
it('allows access to a team which an unprivileged user is a member of', function() {
var teamsTabView = createTeamsTabView(this, {
userInfo: TeamSpecHelpers.createMockUserInfo({
username: TeamSpecHelpers.testUser,
......@@ -215,7 +219,7 @@ define([
})).toBe(false);
});
it('does not allow access if the user is neither privileged nor a team member', function () {
it('does not allow access if the user is neither privileged nor a team member', function() {
var teamsTabView = createTeamsTabView(this, {
userInfo: TeamSpecHelpers.createMockUserInfo({privileged: false, staff: true})
});
......@@ -225,7 +229,7 @@ define([
});
});
describe('Search', function () {
describe('Search', function() {
var performSearch = function(requests, teamsTabView) {
teamsTabView.$('.search-field').val('foo');
teamsTabView.$('.action-search').click();
......@@ -239,7 +243,7 @@ define([
AjaxHelpers.expectNoRequests(requests);
};
it('can search teams', function () {
it('can search teams', function() {
var teamsTabView = createTeamsTabView(this);
teamsTabView.browseTopic(TeamSpecHelpers.testTopicID);
verifyTeamsRequest({
......@@ -252,7 +256,7 @@ define([
expect(teamsTabView.$('.page-description').text()).toBe('Showing results for "foo"');
});
it('can clear a search', function () {
it('can clear a search', function() {
var teamsTabView = createTeamsTabView(this);
teamsTabView.browseTopic(TeamSpecHelpers.testTopicID);
AjaxHelpers.respondWithJson(requests, {});
......@@ -272,7 +276,7 @@ define([
expect(teamsTabView.$('.page-description').text()).toBe('Test description 1');
});
it('can navigate back to all teams from a search', function () {
it('can navigate back to all teams from a search', function() {
var teamsTabView = createTeamsTabView(this);
teamsTabView.browseTopic(TeamSpecHelpers.testTopicID);
AjaxHelpers.respondWithJson(requests, {});
......@@ -292,7 +296,7 @@ define([
expect(teamsTabView.$('.page-description').text()).toBe('Test description 1');
});
it('does not switch to showing results when the search returns an error', function () {
it('does not switch to showing results when the search returns an error', function() {
var teamsTabView = createTeamsTabView(this);
teamsTabView.browseTopic(TeamSpecHelpers.testTopicID);
AjaxHelpers.respondWithJson(requests, {});
......
define([
'backbone', 'underscore', 'teams/js/collections/topic', 'teams/js/views/topics',
'teams/js/spec_helpers/team_spec_helpers', 'common/js/spec_helpers/ajax_helpers'
'teams/js/spec_helpers/team_spec_helpers', 'edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers'
], function (Backbone, _, TopicCollection, TopicsView, TeamSpecHelpers, AjaxHelpers) {
'use strict';
describe('TopicsView', function () {
......
define([
'js/api_admin/views/catalog_preview',
'common/js/spec_helpers/ajax_helpers',
'edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers'
], function (
CatalogPreviewView, AjaxHelpers
) {
......
define(['common/js/spec_helpers/ajax_helpers', 'js/ccx/schedule'],
define(['edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers', 'js/ccx/schedule'],
function(AjaxHelpers) {
describe("edx.ccx.schedule.ScheduleView", function() {
var view = null;
......
......@@ -2,9 +2,9 @@ define([
'jquery',
'jquery.ajax-retry',
'js/commerce/views/receipt_view',
'common/js/spec_helpers/ajax_helpers'
'edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers'
],
function ($, AjaxRetry, ReceiptView, AjaxHelpers){
function ($, AjaxRetry, ReceiptView, AjaxHelpers) {
'use strict';
describe('edx.commerce.ReceiptView', function() {
var data, courseResponseData, providerResponseData, mockRequests, mockRender, createReceiptView,
......
define(['backbone', 'jquery', 'underscore', 'common/js/spec_helpers/ajax_helpers',
define(['backbone', 'jquery', 'underscore', 'edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers',
'common/js/spec_helpers/template_helpers', 'js/bookmarks/views/bookmark_button'
],
function (Backbone, $, _, AjaxHelpers, TemplateHelpers, BookmarkButtonView) {
......
......@@ -3,7 +3,7 @@ define(['backbone',
'underscore',
'logger',
'URI',
'common/js/spec_helpers/ajax_helpers',
'edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers',
'common/js/spec_helpers/template_helpers',
'js/bookmarks/views/bookmarks_list_button',
'js/bookmarks/views/bookmarks_list',
......
define(['common/js/spec_helpers/template_helpers', 'common/js/spec_helpers/ajax_helpers', 'js/dashboard/donation'],
define(['common/js/spec_helpers/template_helpers',
'edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers',
'js/dashboard/donation'],
function(TemplateHelpers, AjaxHelpers) {
'use strict';
......
define([
'jquery', 'common/js/spec_helpers/ajax_helpers','common/js/spec_helpers/template_helpers',
'jquery', 'edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers','common/js/spec_helpers/template_helpers',
'js/discovery/discovery_factory'
], function($, AjaxHelpers, TemplateHelpers, DiscoveryFactory) {
'use strict';
......
define([
'common/js/spec_helpers/ajax_helpers', 'js/discovery/models/course_discovery'
'edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers', 'js/discovery/models/course_discovery'
], function(AjaxHelpers, CourseDiscovery) {
'use strict';
......
define([
'common/js/spec_helpers/ajax_helpers', 'js/discovery/models/search_state'
'edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers', 'js/discovery/models/search_state'
], function(AjaxHelpers, SearchState) {
'use strict';
......
define(['underscore', 'URI', 'common/js/spec_helpers/ajax_helpers'], function(_, URI, AjaxHelpers) {
define(['underscore', 'URI', 'edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers'], function(_, URI, AjaxHelpers) {
'use strict';
var B64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
LONG_TEXT, PRUNED_TEXT, TRUNCATED_TEXT, SHORT_TEXT,
......
define([
'jquery', 'underscore', 'common/js/spec_helpers/ajax_helpers', 'js/spec/edxnotes/helpers',
'jquery', 'underscore', 'edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers', 'js/spec/edxnotes/helpers',
'annotator_1.2.9', 'logger', 'js/edxnotes/views/notes_factory'
], function($, _, AjaxHelpers, Helpers, Annotator, Logger, NotesFactory) {
'use strict';
......
define([
'jquery', 'underscore', 'annotator_1.2.9',
'common/js/spec_helpers/ajax_helpers',
'edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers',
'js/spec/edxnotes/helpers',
'js/edxnotes/views/notes_factory'
], function ($, _, Annotator, AjaxHelpers, Helpers, NotesFactory) {
......
define([
'jquery', 'underscore', 'common/js/spec_helpers/ajax_helpers',
'jquery', 'underscore', 'edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers',
'common/js/spec_helpers/template_helpers', 'js/spec/edxnotes/helpers', 'logger',
'js/edxnotes/models/note', 'js/edxnotes/views/note_item',
], function(
......
define([
'annotator_1.2.9', 'js/edxnotes/views/notes_factory', 'common/js/spec_helpers/ajax_helpers',
'annotator_1.2.9', 'js/edxnotes/views/notes_factory', 'edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers',
'js/spec/edxnotes/helpers'
], function(Annotator, NotesFactory, AjaxHelpers, Helpers) {
'use strict';
......
define([
'jquery', 'underscore', 'common/js/spec_helpers/template_helpers',
'common/js/spec_helpers/ajax_helpers', 'js/spec/edxnotes/helpers',
'edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers', 'js/spec/edxnotes/helpers',
'js/edxnotes/views/page_factory'
], function($, _, TemplateHelpers, AjaxHelpers, Helpers, NotesFactory) {
'use strict';
......@@ -15,7 +15,6 @@ define([
this.view = new NotesFactory({notes: notes, pageSize: 10});
});
it('should be displayed properly', function() {
var requests = AjaxHelpers.requests(this),
tab;
......
define([
'jquery', 'underscore', 'annotator_1.2.9', 'common/js/spec_helpers/ajax_helpers',
'jquery', 'underscore', 'annotator_1.2.9', 'edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers',
'js/edxnotes/views/notes_visibility_factory', 'js/spec/edxnotes/helpers'
], function(
$, _, Annotator, AjaxHelpers, NotesVisibilityFactory, Helpers
......@@ -9,7 +9,7 @@ define([
var params = {
endpoint: '/test_endpoint',
user: 'a user',
usageId : 'an usage',
usageId: 'an usage',
courseId: 'a course',
token: Helpers.makeToken(),
tokenUrl: '/test_token_url'
......@@ -88,16 +88,17 @@ define([
it('can handle errors', function() {
var requests = AjaxHelpers.requests(this),
errorContainer = $('.annotator-notice');
$errorContainer = $('.annotator-notice');
this.button.click();
AjaxHelpers.respondWithError(requests);
expect(errorContainer).toContainText(
"An error has occurred. Make sure that you are connected to the Internet, and then try refreshing the page."
expect($errorContainer).toContainText(
'An error has occurred. Make sure that you are connected to the Internet, ' +
'and then try refreshing the page.'
);
expect(errorContainer).toBeVisible();
expect(errorContainer).toHaveClass('annotator-notice-show');
expect(errorContainer).toHaveClass('annotator-notice-error');
expect($errorContainer).toBeVisible();
expect($errorContainer).toHaveClass('annotator-notice-show');
expect($errorContainer).toHaveClass('annotator-notice-error');
this.button.click();
......@@ -112,10 +113,10 @@ define([
AjaxHelpers.respondWithJson(requests, {});
AjaxHelpers.respondWithJson(requests, {});
expect(errorContainer).not.toHaveClass('annotator-notice-show');
expect($errorContainer).not.toHaveClass('annotator-notice-show');
});
it('toggles notes when CTRL + SHIFT + [ keydown on document', function () {
it('toggles notes when CTRL + SHIFT + [ keydown on document', function() {
// Character '[' has keyCode 219
$(document).trigger($.Event('keydown', {keyCode: 219, ctrlKey: true, shiftKey: true}));
expect(this.toggleNotes.toggleHandler).toHaveBeenCalled();
......
define([
'jquery',
'underscore',
'common/js/spec_helpers/ajax_helpers',
'edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers',
'edx-ui-toolkit/js/utils/html-utils',
'js/edxnotes/views/search_box',
'js/edxnotes/collections/notes',
......
define([
'jquery', 'common/js/spec_helpers/template_helpers', 'common/js/spec_helpers/ajax_helpers',
'jquery', 'common/js/spec_helpers/template_helpers', 'edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers',
'js/edxnotes/collections/notes', 'js/edxnotes/collections/tabs', 'js/edxnotes/views/tabs/recent_activity',
'js/spec/edxnotes/helpers'
], function(
......
define([
'jquery', 'underscore', 'common/js/spec_helpers/template_helpers', 'common/js/spec_helpers/ajax_helpers',
'jquery', 'underscore', 'common/js/spec_helpers/template_helpers',
'edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers',
'logger', 'js/edxnotes/collections/tabs', 'js/edxnotes/views/tabs/search_results',
'js/spec/edxnotes/helpers'
], function(
......
define(['backbone', 'jquery', 'common/js/spec_helpers/ajax_helpers', 'common/js/spec_helpers/template_helpers',
define(['backbone', 'jquery', 'edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers',
'common/js/spec_helpers/template_helpers',
'js/groups/views/cohorts', 'js/groups/collections/cohort', 'js/groups/models/content_group',
'js/groups/models/course_cohort_settings', 'js/utils/animation', 'js/vendor/jquery.qubit',
'js/groups/views/course_cohort_settings_notification', 'js/groups/models/cohort_discussions',
......
/*global define, sinon */
define([
'jquery',
'common/js/spec_helpers/ajax_helpers',
'edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers',
'js/certificates/models/certificate_exception',
'js/certificates/views/certificate_whitelist',
'js/certificates/views/certificate_whitelist_editor',
......
/*global define */
define([
'jquery',
'common/js/spec_helpers/ajax_helpers',
'edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers',
'js/certificates/models/certificate_invalidation',
'js/certificates/views/certificate_invalidation_view',
'js/certificates/collections/certificate_invalidation_collection'
......
/*global define, onCertificatesReady */
define([
'jquery',
'common/js/spec_helpers/ajax_helpers',
'edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers',
'js/instructor_dashboard/certificates'
],
function($, AjaxHelpers) {
......
/*global define */
define(['jquery', 'coffee/src/instructor_dashboard/data_download', 'common/js/spec_helpers/ajax_helpers', 'slick.grid'],
define(['jquery',
'coffee/src/instructor_dashboard/data_download',
'edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers',
'slick.grid'],
function ($, DataDownload, AjaxHelpers) {
'use strict';
describe("edx.instructor_dashboard.data_download.DataDownload_Certificate", function() {
......
define(['jquery', 'coffee/src/instructor_dashboard/student_admin', 'common/js/spec_helpers/ajax_helpers'],
define(['jquery', 'coffee/src/instructor_dashboard/student_admin', 'edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers'],
function ($, StudentAdmin, AjaxHelpers) {
//'coffee/src/instructor_dashboard/student_admin'
'use strict';
......
......@@ -2,7 +2,7 @@ define([
'jquery',
'backbone',
'logger',
'common/js/spec_helpers/ajax_helpers',
'edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers',
'common/js/spec_helpers/page_helpers',
'common/js/spec_helpers/template_helpers',
'js/search/base/models/search_result',
......
define(['common/js/spec_helpers/ajax_helpers', 'js/shoppingcart/shoppingcart'],
define(['edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers', 'js/shoppingcart/shoppingcart'],
function(AjaxHelpers) {
'use strict';
......
......@@ -2,7 +2,7 @@ define([
'backbone',
'jquery',
'js/staff_debug_actions',
'common/js/spec_helpers/ajax_helpers'
'edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers'
],
function (Backbone, $, tmp, AjaxHelpers) {
'use strict';
......
......@@ -5,7 +5,7 @@
'underscore',
'backbone',
'common/js/spec_helpers/template_helpers',
'common/js/spec_helpers/ajax_helpers',
'edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers',
'js/student_account/views/AccessView',
'js/student_account/views/FormView',
'js/student_account/enrollment',
......
define(['backbone', 'jquery', 'underscore', 'common/js/spec_helpers/ajax_helpers', 'common/js/spec_helpers/template_helpers',
define(['backbone',
'jquery',
'underscore',
'edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers',
'common/js/spec_helpers/template_helpers',
'js/spec/views/fields_helpers',
'js/spec/student_account/helpers',
'js/spec/student_account/account_settings_fields_helpers',
......
define(['backbone', 'jquery', 'underscore', 'common/js/spec_helpers/ajax_helpers', 'common/js/spec_helpers/template_helpers',
define(['backbone',
'jquery',
'underscore',
'edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers',
'common/js/spec_helpers/template_helpers',
'js/spec/views/fields_helpers',
'string_utils'],
function (Backbone, $, _, AjaxHelpers, TemplateHelpers, FieldViewsSpecHelpers) {
......
define(['backbone', 'jquery', 'underscore', 'common/js/spec_helpers/ajax_helpers', 'common/js/spec_helpers/template_helpers',
define(['backbone',
'jquery',
'underscore',
'edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers',
'common/js/spec_helpers/template_helpers',
'js/views/fields',
'js/spec/views/fields_helpers',
'js/spec/student_account/account_settings_fields_helpers',
......
define(['backbone', 'jquery', 'underscore', 'common/js/spec_helpers/ajax_helpers', 'common/js/spec_helpers/template_helpers',
define(['backbone',
'jquery',
'underscore',
'edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers',
'common/js/spec_helpers/template_helpers',
'js/spec/student_account/helpers',
'js/views/fields',
'js/student_account/models/user_account_model',
......
define(['common/js/spec_helpers/ajax_helpers', 'js/student_account/emailoptin'],
define(['edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers', 'js/student_account/emailoptin'],
function( AjaxHelpers, EmailOptInInterface ) {
'use strict';
......
define(['common/js/spec_helpers/ajax_helpers', 'js/student_account/enrollment'],
define(['edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers', 'js/student_account/enrollment'],
function( AjaxHelpers, EnrollmentInterface ) {
'use strict';
......
......@@ -4,7 +4,7 @@
'jquery',
'jquery.url',
'utility',
'common/js/spec_helpers/ajax_helpers',
'edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers',
'js/student_account/views/FinishAuthView',
'js/student_account/enrollment',
'js/student_account/shoppingcart',
......
......@@ -4,7 +4,7 @@
'jquery',
'underscore',
'common/js/spec_helpers/template_helpers',
'common/js/spec_helpers/ajax_helpers',
'edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers',
'js/student_account/views/HintedLoginView'
],
function($, _, TemplateHelpers, AjaxHelpers, HintedLoginView) {
......
......@@ -5,7 +5,7 @@
'underscore',
'sinon',
'common/js/spec_helpers/template_helpers',
'common/js/spec_helpers/ajax_helpers',
'edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers',
'js/student_account/models/LoginModel',
'js/student_account/views/LoginView',
'js/student_account/models/PasswordResetModel'
......
......@@ -5,7 +5,7 @@
'underscore',
'backbone',
'common/js/spec_helpers/template_helpers',
'common/js/spec_helpers/ajax_helpers',
'edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers',
'js/student_account/logistration_factory'
],
function($, _, Backbone, TemplateHelpers, AjaxHelpers, LogistrationFactory) {
......
......@@ -4,7 +4,7 @@
'jquery',
'underscore',
'common/js/spec_helpers/template_helpers',
'common/js/spec_helpers/ajax_helpers',
'edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers',
'js/student_account/models/PasswordResetModel',
'js/student_account/views/PasswordResetView'
],
......
......@@ -4,7 +4,7 @@
'jquery',
'underscore',
'common/js/spec_helpers/template_helpers',
'common/js/spec_helpers/ajax_helpers',
'edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers',
'js/student_account/models/RegisterModel',
'js/student_account/views/RegisterView'
],
......
define(['common/js/spec_helpers/ajax_helpers', 'js/student_account/shoppingcart'],
define(['edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers', 'js/student_account/shoppingcart'],
function(AjaxHelpers, ShoppingCartInterface) {
'use strict';
......
......@@ -3,18 +3,18 @@ define([
'jquery',
'underscore',
'URI',
'edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers',
'edx-ui-toolkit/js/pagination/paging-collection',
'common/js/spec_helpers/ajax_helpers',
'js/spec/student_profile/helpers',
'js/student_profile/views/badge_list_container'
],
function (Backbone, $, _, URI, PagingCollection, AjaxHelpers, LearnerProfileHelpers, BadgeListContainer) {
function(Backbone, $, _, URI, AjaxHelpers, PagingCollection, LearnerProfileHelpers, BadgeListContainer) {
'use strict';
describe('edx.user.BadgeListContainer', function () {
var view, requests;
var createView = function (requests, pageNum, badge_list_object) {
var createView = function(requests, pageNum, badgeListObject) {
var BadgeCollection = PagingCollection.extend({
queryParams: {
currentPage: 'current_page'
......@@ -23,15 +23,15 @@ define([
var badgeCollection = new BadgeCollection();
badgeCollection.url = '/api/badges/v1/assertions/user/staff/';
var models = [];
_.each(_.range(badge_list_object.count), function (idx) {
_.each(_.range(badgeListObject.count), function (idx) {
models.push(LearnerProfileHelpers.makeBadge(idx));
});
badge_list_object.results = models;
badgeListObject.results = models;
badgeCollection.setPage(pageNum);
var request = AjaxHelpers.currentRequest(requests);
var path = new URI(request.url).path();
expect(path).toBe('/api/badges/v1/assertions/user/staff/');
AjaxHelpers.respondWithJson(requests, badge_list_object);
AjaxHelpers.respondWithJson(requests, badgeListObject);
var badgeListContainer = new BadgeListContainer({
'collection': badgeCollection
......@@ -92,4 +92,3 @@ define([
});
}
);
define(['underscore', 'URI', 'common/js/spec_helpers/ajax_helpers'], function(_, URI, AjaxHelpers) {
define(['underscore', 'URI', 'edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers'], function(_, URI, AjaxHelpers) {
'use strict';
var expectProfileElementContainsField = function(element, view) {
......
define(['backbone', 'jquery', 'underscore', 'common/js/spec_helpers/ajax_helpers',
define(['backbone', 'jquery', 'underscore', 'edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers',
'common/js/spec_helpers/template_helpers',
'js/spec/student_account/helpers',
'js/spec/student_profile/helpers',
......
define(['backbone', 'jquery', 'underscore', 'common/js/spec_helpers/ajax_helpers', 'common/js/spec_helpers/template_helpers',
define(['backbone',
'jquery',
'underscore',
'edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers',
'common/js/spec_helpers/template_helpers',
'js/spec/student_account/helpers',
'js/student_account/models/user_account_model',
'js/student_profile/views/learner_profile_fields',
......
......@@ -2,7 +2,7 @@ define(['backbone',
'jquery',
'underscore',
'edx-ui-toolkit/js/pagination/paging-collection',
'common/js/spec_helpers/ajax_helpers',
'edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers',
'common/js/spec_helpers/template_helpers',
'js/spec/student_account/helpers',
'js/spec/student_profile/helpers',
......
......@@ -2,7 +2,7 @@ define([
'jquery',
'backbone',
'common/js/spec_helpers/template_helpers',
'common/js/spec_helpers/ajax_helpers',
'edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers',
'js/verify_student/views/image_input_view',
'js/verify_student/models/verification_model'
], function( $, Backbone, TemplateHelpers, AjaxHelpers, ImageInputView, VerificationModel ) {
......
......@@ -2,7 +2,7 @@ define([
'jquery',
'underscore',
'backbone',
'common/js/spec_helpers/ajax_helpers',
'edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers',
'common/js/spec_helpers/template_helpers',
'js/verify_student/views/make_payment_step_view'
],
......
......@@ -2,7 +2,7 @@ define([
'jquery',
'underscore',
'backbone',
'common/js/spec_helpers/ajax_helpers',
'edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers',
'common/js/spec_helpers/template_helpers',
'js/verify_student/views/make_payment_step_view'
],
......
......@@ -2,7 +2,7 @@ define([
'jquery',
'underscore',
'backbone',
'common/js/spec_helpers/ajax_helpers',
'edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers',
'common/js/spec_helpers/template_helpers',
'js/verify_student/views/review_photos_step_view',
'js/verify_student/models/verification_model'
......
......@@ -2,7 +2,7 @@ define([
'jquery',
'backbone',
'common/js/spec_helpers/template_helpers',
'common/js/spec_helpers/ajax_helpers',
'edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers',
'js/verify_student/views/webcam_photo_view',
'js/verify_student/models/verification_model'
],
......
define(['backbone', 'jquery', 'underscore', 'common/js/spec_helpers/ajax_helpers', 'common/js/spec_helpers/template_helpers',
define(['backbone',
'jquery',
'underscore',
'edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers',
'common/js/spec_helpers/template_helpers',
'js/views/fields',
'string_utils'],
function (Backbone, $, _, AjaxHelpers, TemplateHelpers, FieldViews) {
......
define(['backbone', 'jquery', 'underscore', 'common/js/spec_helpers/ajax_helpers',
define(['backbone', 'jquery', 'underscore', 'edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers',
'common/js/spec_helpers/template_helpers', 'js/views/fields', 'js/spec/views/fields_helpers',
'string_utils'],
function (Backbone, $, _, AjaxHelpers, TemplateHelpers, FieldViews, FieldViewsSpecHelpers) {
......
define(['backbone', 'jquery', 'js/views/file_uploader', 'common/js/spec_helpers/template_helpers',
'common/js/spec_helpers/ajax_helpers', 'js/models/notification', 'string_utils'],
'edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers', 'js/models/notification', 'string_utils'],
function (Backbone, $, FileUploaderView, TemplateHelpers, AjaxHelpers, NotificationModel) {
describe("FileUploaderView", function () {
var verifyTitle, verifyInputLabel, verifyInputTip, verifySubmitButton, verifyExtensions, verifyText,
......
define(
[
'common/js/spec_helpers/ajax_helpers',
'edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers',
'common/js/components/utils/view_utils',
'lms/js/preview/preview_factory'
],
......
......@@ -5,7 +5,7 @@
"backbone": "~1.3.2",
"coffee-script": "1.6.1",
"edx-pattern-library": "0.13.0",
"edx-ui-toolkit": "~1.1.0",
"edx-ui-toolkit": "1.3.0",
"jquery": "~2.2.0",
"jquery-migrate": "^1.4.1",
"jquery.scrollto": "~2.1.2",
......
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