|
|
|
@ -1,13 +1,22 @@ |
|
|
|
describe('debounced test', function(){ |
|
|
|
|
|
|
|
function displayPerson(p){ |
|
|
|
|
|
|
|
var p1 = p[0]; |
|
|
|
var p2 = p[1]; |
|
|
|
return p1.name + ',' + p1.dob + '||' + p2.name + ',' + p2.dob; |
|
|
|
//return '--Person name-- - ' + p.name + ',' + p.dob;
|
|
|
|
} |
|
|
|
|
|
|
|
beforeEach(function(){ |
|
|
|
jasmine.clock().install(); |
|
|
|
//jasmine.clock().install();
|
|
|
|
jasmine.addCustomObjectFormatter(displayPerson); |
|
|
|
}); |
|
|
|
|
|
|
|
afterEach(function(){ |
|
|
|
jasmine.clock().uninstall(); |
|
|
|
//jasmine.clock().uninstall();
|
|
|
|
}); |
|
|
|
|
|
|
|
/* |
|
|
|
it('should call the method only after the 500ms debounce', function(){ |
|
|
|
function debouncedMethod() { |
|
|
|
// do something async;
|
|
|
|
@ -24,4 +33,17 @@ describe('debounced test', function(){ |
|
|
|
|
|
|
|
//assertions follow
|
|
|
|
}); |
|
|
|
*/ |
|
|
|
it('compares some lists', function() { |
|
|
|
const expectedListOfPersons = [ |
|
|
|
{name: 'Tom', age:20, dob: '20/10/2000'}, |
|
|
|
{name: 'John', age:30, dob: '20/10/1990'} |
|
|
|
]; |
|
|
|
const actualListOfPersons = [ |
|
|
|
{name: 'Thomas', age:20, dob: '20/10/2000'}, |
|
|
|
{name: 'Johnny', age:30, dob: '20/10/1990'} |
|
|
|
]; |
|
|
|
|
|
|
|
expect(actualListOfPersons).toEqual(expectedListOfPersons); |
|
|
|
}); |
|
|
|
}); |