Skip to content

Instantly share code, notes, and snippets.

@deanapeterson
Created July 16, 2013 21:57
Show Gist options
  • Save deanapeterson/6015536 to your computer and use it in GitHub Desktop.
Save deanapeterson/6015536 to your computer and use it in GitHub Desktop.
Testing for scrollbar in Jasmine/Karma
//Pseudo Code
it(" should have a scrollbar", function(){
var tableWrap, table, tablePosTop, newTablePosTop;
tableWrap = $(".tableWrapper");
table = tableWrap.find("table");
tablePosTop = table.position().top;
tableWrap.animate({scrollTop:100},0);
newTablePosTop = table.position().top;
expect( tablePosTop ).toBeGreaterThan( newTablePosTop ); //true
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment