Use the UI Toolkit's spec helpers.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
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
|
||||
) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
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,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
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',
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
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';
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
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';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
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';
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
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';
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
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,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
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';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
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) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
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(
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
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';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
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;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
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();
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
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',
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
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(
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
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(
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
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',
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*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',
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*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'
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*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) {
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
/*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() {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
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',
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
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',
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
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',
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
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) {
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
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',
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
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',
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
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';
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
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'
|
||||
],
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
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([
|
||||
});
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
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) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
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',
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
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'
|
||||
],
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
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) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
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) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
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,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
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'
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user