Fix unit and acceptance tests broken in upgrade (squashed)

Fix syntax error in selectors

.attr() now returns a string (though it can still be passed an integer)

Fixes checkbox test failures

Remove remaining references to jquery.min (in wrong folder)

$.ajax now returns 422 if type is json and body is not JSON, e.g. ''

Substitute prop for attr

Remove references to jquery.min, add jquery.migrate (again)

"Fix" jquery karma config

This wasn't suppoed to survive the merge

This throws an error when called with an 'undefined' error

Fix Karma warning about [re|un]loading the window

Fix path for jquery in cms-squire tests

Move jasmine.clock.uninstall() to afterEach so it runs even on failure

Fix test failing due to timezone issues

Do the timeout before the window scrolling (so handler will not be _.throttled)

Fix an alert() triggered by window.onBeforeUnload while testing in Chrome
This commit is contained in:
Brian Jacobel
2016-05-02 12:32:11 -04:00
parent a5ef614994
commit 4f0aee3f2d
20 changed files with 62 additions and 37 deletions

View File

@@ -28,7 +28,8 @@ var options = {
{pattern: 'common_static/edx-ui-toolkit/js/utils/global-loader.js', included: true},
{pattern: 'common_static/js/vendor/CodeMirror/codemirror.js', included: true},
{pattern: 'common_static/js/vendor/draggabilly.js'},
{pattern: 'common_static/js/vendor/jquery.min.js', included: true},
{pattern: 'common_static/common/js/vendor/jquery.js', included: true},
{pattern: 'common_static/common/js/vendor/jquery-migrate.js', included: true},
{pattern: 'common_static/js/vendor/jquery.cookie.js', included: true},
{pattern: 'common_static/js/vendor/jquery.leanModal.js', included: true},
{pattern: 'common_static/js/vendor/jquery.timeago.js', included: true},

View File

@@ -289,9 +289,9 @@ describe 'Problem', ->
$('#input_example_1').replaceWith(html)
@problem.checkAnswersAndCheckButton true
@checkDisabled true
$('#input_1_1_1').attr('checked', true).trigger('click')
$('#input_1_1_1').click()
@checkDisabled false
$('#input_1_1_1').attr('checked', false).trigger('click')
$('#input_1_1_1').click()
@checkDisabled true
it 'should become enabled after a radiobutton is checked', ->

View File

@@ -343,7 +343,7 @@
expect(parseIntAttribute(item, 'data-index')).toEqual(index);
expect(parseIntAttribute(item, 'data-start')).toEqual(captionsData.start[index]);
expect(item.attr('tabindex')).toEqual(0);
expect(item.attr('tabindex')).toEqual('0');
expect(item.text().trim()).toEqual(captionsData.text[index]);
});
});
@@ -432,7 +432,7 @@
expect(parseIntAttribute(item, 'data-index')).toEqual(index);
expect(parseIntAttribute(item, 'data-start')).toEqual(captionsData.start[index]);
expect(item.attr('tabindex')).toEqual(0);
expect(item.attr('tabindex')).toEqual('0');
expect(item.text().trim()).toEqual(text);
});
}).always(done);
@@ -842,7 +842,7 @@
function (index, item) {
expect(parseIntAttribute($(item), 'data-index')).toEqual(index);
expect(parseIntAttribute($(item), 'data-start')).toEqual(captionsData.start[index]);
expect($(item).attr('tabindex')).toEqual(0);
expect($(item).attr('tabindex')).toEqual('0');
expect($(item).text().trim()).toEqual(captionsData.text[index]);
});
});

View File

@@ -49,8 +49,8 @@
});
it('from the start, focus grabbers are disabled', function () {
expect(state.focusGrabber.elFirst.attr('tabindex')).toBe(-1);
expect(state.focusGrabber.elLast.attr('tabindex')).toBe(-1);
expect(state.focusGrabber.elFirst.attr('tabindex')).toBe('-1');
expect(state.focusGrabber.elLast.attr('tabindex')).toBe('-1');
});
it(

View File

@@ -55,7 +55,7 @@
expect(btnPlay).not.toHaveClass('is-hidden');
expect(btnPlay).toHaveAttrs({
'aria-hidden': 'false',
'tabindex': 0
'tabindex': '0'
});
state.videoPlayPlaceholder.hide();
@@ -63,7 +63,7 @@
expect(btnPlay).toHaveClass('is-hidden');
expect(btnPlay).toHaveAttrs({
'aria-hidden': 'true',
'tabindex': -1
'tabindex': '-1'
});
});