[view,test][m]: (refs #10) introduce DataTablRow view for rendering DataTable row and test it (though have not yet integrated).
This commit is contained in:
25
test/view.test.js
Normal file
25
test/view.test.js
Normal file
@@ -0,0 +1,25 @@
|
||||
(function ($) {
|
||||
|
||||
module("View");
|
||||
|
||||
test('new DataTableRow View', function () {
|
||||
var $el = $('<tr />');
|
||||
$('.fixtures .test-datatable').append($el);
|
||||
var doc = new recline.Document({
|
||||
'id': 1,
|
||||
'b': '2',
|
||||
'a': '1'
|
||||
});
|
||||
var view = new recline.DataTableRow({
|
||||
model: doc
|
||||
, el: $el
|
||||
, headers: ['a', 'b']
|
||||
});
|
||||
view.render();
|
||||
ok($el.attr('data-id'), '1');
|
||||
var tds = $el.find('td');
|
||||
equal(tds.length, 3);
|
||||
equal($(tds[1]).attr('data-header'), 'a');
|
||||
});
|
||||
|
||||
})(this.jQuery);
|
||||
Reference in New Issue
Block a user