Skip to content

Commit

Permalink
Avoid spec false negative on IE < 9 if jQuery isn't referenced
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveSanderson committed Apr 25, 2014
1 parent a2a3403 commit 82c9af9
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions spec/components/customElementBehaviors.js
Original file line number Diff line number Diff line change
Expand Up @@ -360,8 +360,20 @@ describe('Components: Custom elements', function() {
testNode.innerHTML = initialMarkup;

ko.applyBindings({ outerval: { innerval: 'my value' } }, testNode);
jasmine.Clock.tick(1);
expect(testNode).toContainText('hello [the outer component [the inner component with value [my value]] goodbye] world');
try {
jasmine.Clock.tick(1);
expect(testNode).toContainText('hello [the outer component [the inner component with value [my value]] goodbye] world');
} catch(ex) {
if (ex.message.indexOf('Unexpected call to method or property access.') >= 0) {
// On IE < 9, this scenario is only supported if you have referenced jQuery.
// So don't consider this to be a failure if jQuery isn't referenced.
if (!window.jQuery) {
return;
}
}

throw ex;
}
});

it('Gives a useful exception message if you try to use a custom element that has not been preregistered on IE < 9', function() {
Expand Down

0 comments on commit 82c9af9

Please sign in to comment.