Commit 1aa181c9 by Jesse Zoldak Committed by Andy Armstrong

Update sinon to version 1.17.0

parent 45176c72
......@@ -40,7 +40,7 @@ requirejs.config({
"xblock": "xmodule_js/common_static/coffee/src/xblock",
"utility": "xmodule_js/common_static/js/src/utility",
"accessibility": "xmodule_js/common_static/js/src/accessibility_tools",
"sinon": "xmodule_js/common_static/js/vendor/sinon-1.7.1",
"sinon": "xmodule_js/common_static/js/vendor/sinon-1.17.0",
"squire": "xmodule_js/common_static/js/vendor/Squire",
"jasmine-jquery": "xmodule_js/common_static/js/vendor/jasmine-jquery",
"jasmine-imagediff": "xmodule_js/common_static/js/vendor/jasmine-imagediff",
......
......@@ -34,7 +34,7 @@ requirejs.config({
"xblock/core": "xmodule_js/common_static/js/xblock/core",
"xblock": "xmodule_js/common_static/coffee/src/xblock",
"utility": "xmodule_js/common_static/js/src/utility",
"sinon": "xmodule_js/common_static/js/vendor/sinon-1.7.1",
"sinon": "xmodule_js/common_static/js/vendor/sinon-1.17.0",
"squire": "xmodule_js/common_static/js/vendor/Squire",
"jasmine-stealth": "xmodule_js/common_static/js/vendor/jasmine-stealth",
"jasmine.async": "xmodule_js/common_static/js/vendor/jasmine.async",
......
......@@ -295,7 +295,7 @@ define ["jquery", "jasmine", "common/js/spec_helpers/ajax_helpers", "squire"],
# Delete the 2nd asset with success from server.
@view.$(".remove-asset-button")[1].click()
@promptSpies.constructor.mostRecentCall.args[0].actions.primary.click(@promptSpies)
req.respond(200) for req in requests.slice(1)
AjaxHelpers.respondWithNoContent(requests)
expect(@view.$el).toContainText("test asset 1")
expect(@view.$el).not.toContainText("test asset 2")
......@@ -305,7 +305,7 @@ define ["jquery", "jasmine", "common/js/spec_helpers/ajax_helpers", "squire"],
# Delete the 2nd asset, but mimic a failure from the server.
@view.$(".remove-asset-button")[1].click()
@promptSpies.constructor.mostRecentCall.args[0].actions.primary.click(@promptSpies)
req.respond(404) for req in requests
AjaxHelpers.respondWithError(requests)
expect(@view.$el).toContainText("test asset 1")
expect(@view.$el).toContainText("test asset 2")
......
......@@ -46,7 +46,7 @@ lib_paths:
- xmodule_js/common_static/js/vendor/jquery.ajaxQueue.js
- xmodule_js/common_static/js/vendor/jquery.form.js
- xmodule_js/common_static/js/vendor/html5-input-polyfills/number-polyfill.js
- xmodule_js/common_static/js/vendor/sinon-1.7.1.js
- xmodule_js/common_static/js/vendor/sinon-1.17.0.js
- xmodule_js/common_static/js/vendor/Squire.js
- xmodule_js/common_static/js/vendor/jasmine-jquery.js
- xmodule_js/common_static/js/vendor/jasmine-stealth.js
......
......@@ -43,7 +43,7 @@ lib_paths:
- xmodule_js/common_static/js/vendor/jquery.leanModal.min.js
- xmodule_js/common_static/js/vendor/jquery.form.js
- xmodule_js/common_static/js/vendor/html5-input-polyfills/number-polyfill.js
- xmodule_js/common_static/js/vendor/sinon-1.7.1.js
- xmodule_js/common_static/js/vendor/sinon-1.17.0.js
- xmodule_js/common_static/js/vendor/Squire.js
- xmodule_js/common_static/js/vendor/jasmine-jquery.js
- xmodule_js/common_static/js/vendor/jasmine-stealth.js
......
......@@ -53,7 +53,7 @@ lib_paths:
- common_static/js/vendor/tinymce/js/tinymce/tinymce.full.min.js
- common_static/js/vendor/mathjax-MathJax-c9db6ac/MathJax.js
- common_static/js/vendor/jquery.timeago.js
- common_static/js/vendor/sinon-1.7.1.js
- common_static/js/vendor/sinon-1.17.0.js
- common_static/js/vendor/analytics.js
- common_static/js/test/add_ajax_prefix.js
- common_static/js/src/utility.js
......
......@@ -117,7 +117,11 @@ define(['sinon', 'underscore', 'URI'], function(sinon, _, URI) {
};
/**
* Verify that the request was reset, and then skip it.
* 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);
......
......@@ -20,7 +20,7 @@
'jquery.immediateDescendents': 'coffee/src/jquery.immediateDescendents',
'jquery.simulate': 'js/vendor/jquery.simulate',
'jquery.url': 'js/vendor/url.min',
'sinon': 'js/vendor/sinon-1.7.1',
'sinon': 'js/vendor/sinon-1.17.0',
'text': 'js/vendor/requirejs/text',
'underscore': 'js/vendor/underscore-min',
'underscore.string': 'js/vendor/underscore.string.min',
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -43,7 +43,7 @@ lib_paths:
- js/test/i18n.js
- coffee/src/jquery.immediateDescendents.js
- js/vendor/requirejs/text.js
- js/vendor/sinon-1.7.1.js
- js/vendor/sinon-1.17.0.js
- js/vendor/jasmine-stealth.js
# Paths to source JavaScript files
......
......@@ -4,7 +4,7 @@ define(['jquery',
'teams/js/models/topic'],
function ($, _, TopicCardView, Topic) {
describe('topic card view', function () {
describe('Topic card view', function () {
var createTopicCardView = function() {
return new TopicCardView({
model: new Topic({
......
......@@ -359,9 +359,6 @@ define(['backbone', 'jquery', 'common/js/spec_helpers/ajax_helpers', 'common/js/
cohortsView.$(fileUploadForm).fileupload('add', {files: [{name: 'upload_file.txt'}]});
cohortsView.$('.submit-file-button').click();
// Respond to the event request
AjaxHelpers.respondWithNoContent(requests);
// No file will actually be uploaded because "uploaded_file.txt" doesn't actually exist.
AjaxHelpers.expectRequest(requests, 'POST', MOCK_UPLOAD_COHORTS_CSV_URL, new FormData());
AjaxHelpers.respondWithJson(requests, {});
......
......@@ -40,7 +40,7 @@
'xmodule': 'xmodule_js/src/xmodule',
'utility': 'xmodule_js/common_static/js/src/utility',
'accessibility': 'xmodule_js/common_static/js/src/accessibility_tools',
'sinon': 'xmodule_js/common_static/js/vendor/sinon-1.7.1',
'sinon': 'xmodule_js/common_static/js/vendor/sinon-1.17.0',
'squire': 'xmodule_js/common_static/js/vendor/Squire',
'jasmine-jquery': 'xmodule_js/common_static/js/vendor/jasmine-jquery',
'jasmine-imagediff': 'xmodule_js/common_static/js/vendor/jasmine-imagediff',
......
......@@ -609,21 +609,9 @@ define([
// send search request to server
$('.search-field').val('search string');
$('.search-button').trigger('click');
// cancel search
// cancel the search and then skip the request that was marked as reset
$('.cancel-button').trigger('click');
AjaxHelpers.respondWithJson(requests, {
total: 1337,
access_denied_count: 12,
results: [{
data: {
location: ['section', 'subsection', 'unit'],
url: '/some/url/to/content',
content_type: 'text',
excerpt: 'this is a short excerpt',
course_name: ''
}
}]
});
AjaxHelpers.skipResetRequest(requests);
// there should be no results
expect(this.$contentElement).toBeVisible();
expect(this.$searchResults).toBeHidden();
......
......@@ -110,9 +110,6 @@ define(['backbone', 'jquery', 'underscore', 'common/js/spec_helpers/ajax_helpers
// Verify image upload progress message
verifyImageUploadButtonMessage(imageView, true);
// Respond to the analytics event
AjaxHelpers.respondWithJson(requests, {});
// Verify if POST request received for image upload
AjaxHelpers.expectRequest(requests, 'POST', Helpers.IMAGE_UPLOAD_API_URL, new FormData());
......@@ -281,9 +278,6 @@ define(['backbone', 'jquery', 'underscore', 'common/js/spec_helpers/ajax_helpers
// Verify image upload progress message
verifyImageUploadButtonMessage(imageView, true);
// Respond to the analytics event
AjaxHelpers.respondWithJson(requests, {});
// Verify if POST request received for image upload
AjaxHelpers.expectRequest(requests, 'POST', Helpers.IMAGE_UPLOAD_API_URL, new FormData());
......
......@@ -54,9 +54,6 @@ define(['backbone', 'jquery', 'js/views/file_uploader', 'common/js/spec_helpers/
verifySubmitButtonEnabled(true);
fileUploaderView.$('.submit-file-button').click();
// Respond to the analytics event first
AjaxHelpers.respondWithJson(requests, {});
// No file will actually be uploaded because "uploaded_file.txt" doesn't actually exist.
AjaxHelpers.expectRequest(requests, 'POST', url, new FormData());
return requests;
......
......@@ -50,7 +50,7 @@ lib_paths:
- xmodule_js/common_static/js/xblock
- xmodule_js/common_static/coffee/src/xblock
- coffee/src/instructor_dashboard
- xmodule_js/common_static/js/vendor/sinon-1.7.1.js
- xmodule_js/common_static/js/vendor/sinon-1.17.0.js
- xmodule_js/src/capa/
- xmodule_js/src/video/
- xmodule_js/src/xmodule.js
......
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