Skip to content
This repository has been archived by the owner on Feb 28, 2019. It is now read-only.

Commit

Permalink
Add failing tests for custom jquery events.
Browse files Browse the repository at this point in the history
  • Loading branch information
nathggns committed Apr 6, 2013
1 parent f157b6c commit 6901615
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion test/jq-list_test.js
Expand Up @@ -164,6 +164,29 @@
equal($element.find('> li:first-child > input').val(), fourth, 'Fourth val');
equal($element.find('> li:first-child [data-sublist]').children().length, 1, 'child length after delete');
equal($element.find('> li:first-child [data-sublist]').children().eq(0).find('input').val(), fifth, 'Fifth val after delete');
},

'events are triggered': {
test: function($element) {


var timer = setTimeout(function() {
start();
ok(false, 'It failed');
}, 1000);

$element.on('list-add', function() {
clearTimeout(timer);
ok(true, 'Event triggered');
equal(arguments.length, 2, 'Argument length is correct');
equal(arguments[1], 0, 'Index is correct');

start();
});

$element.find('> li > .buttons [data-role=add]').click();
},
func: asyncTest
}
};

Expand Down Expand Up @@ -197,7 +220,7 @@
test_obj.func(name, function() {
runList();
Array.prototype.unshift.call(arguments, $element);
test_func.apply(this, arguments);
test_obj.test.apply(this, arguments);

$element.list('reset');
});
Expand Down

0 comments on commit 6901615

Please sign in to comment.