7 Answers, 1 is accepted
We don't currently have documentation for unit testing the Kendo UI widgets. It should be very simple to make assertions though. Here is a sample QUnit test which checks if the grid is bound to a data source:
http://jsbin.com/oholod/1/edit
Atanas Korchev
the Telerik team

You can move the QUnit test from my example in a separate file and it should still work.
If you want to use an existing grid (one rendered by MVC) simply get its instance in the unit test and make the assertions:
test("the grid creates a row for every item in the data source", function() {
var dom = $("#grid"); // get reference to the grid output by the mvc wrapper
// assert the number of table rows
equal(dom.find("tbody > tr").length, 1);
});
Atanas Korchev
the Telerik team

@(Html.Kendo().Grid(Model.SomeModel)
.Name("NewGrid")
.DataSource(dataSource => dataSource
.Ajax()
.ServerOperation(false)
)
in a seperate grid_tests.js file
test("rows are available", function () {
var dom = $("#NewGrid");
equal(dom.find("tbody > tr").length, 1);
});
If I were to load grid.cshtml directly I'd see like 20 rows
Qunit comes back as 0
Grid ajax binding happens asynchronously and the qunit test is executed before the grid finishes binding. You can use an asynchronous QUnit tests: http://jsbin.com/oholod/3/edit
Regards,Atanas Korchev
the Telerik team

Could you also provide a Jasmine example of the same thing?
Unfortunately I am not familiar with Jasmine and I cannot provide an example for this. Perhaps you can use the same approach with Jasmine provided that it supports asynchronous tests.
Regards,Atanas Korchev
the Telerik team