-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtests.js
26 lines (23 loc) · 1.28 KB
/
tests.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
QUnit.test( "hello test", function( assert ) {
assert.ok( 1 == "1", "Passed!" );
});
QUnit.test("check renderQuestions function", function( assert ){
var resultsNode = document.getElementById("Results-Container");
assert.equal(resultsNode.innerHTML,"","check resultsNode initially empty")
RenderModule.renderQuestions(testResponse);
var resultlist = document.body.querySelectorAll("#links");
var link = "http://stackoverflow.com/questions/42627119/insert-a-row-in-a-table-jquery"
var title = "Insert a row in a table JQuery";
assert.equal(resultlist[0].href,link,"check first item has correct link")
assert.equal(resultlist[0].innerHTML,title,"check first item has correct title")
assert.equal(resultlist.length,30, "check list is correct length (30 objects)")
})
QUnit.test("check renderUsers function", function( assert ){
RenderModule.renderUsers(testUserResponse);
var resultlist = document.body.querySelectorAll("#links");
var link = "http://stackoverflow.com/users/19068/quentin"
var title = "Insert a row in a table JQuery";
assert.equal(resultlist[0].href,link,"check first item has correct link")
// assert.equal(resultlist[0].innerHTML,title,"check first item has correct title")
// assert.equal(resultlist.length,30, "check list is correct length (30 objects)")
})