Skip to content

Commit

Permalink
DEV tweaks to tests
Browse files Browse the repository at this point in the history
  • Loading branch information
colin0117 committed Jul 12, 2019
1 parent 4d38fe3 commit 958f897
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
9 changes: 3 additions & 6 deletions test/api/row().scrollTo().js
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,21 @@ describe('Select - row().scrollTo()', function() {
css: ['datatables', 'scroller']
});

let table;

describe('Check the defaults', function() {
dt.html('basic');
let table;
it('Exists and is a function', function() {
table = $('#example').DataTable();
expect(typeof table.row().scrollTo).toBe('function');
});

it('Returns an API instance', function() {
expect(table.row(0).scrollTo() instanceof $.fn.dataTable.Api).toBe(true);
});
});

describe('Check the behaviour - small tables', function() {
dt.html('basic');
let table;
it('Can scroll to near the end', function() {
table = $('#example').DataTable({
deferRender: true,
Expand Down Expand Up @@ -83,7 +82,6 @@ describe('Select - row().scrollTo()', function() {

describe('Check the behaviour - linear scrolling', function() {
dt.html('empty');
let table;
it('Scroll to line 1000', function() {
let data = [];
for (var i = 0; i < 5000; i++) {
Expand Down Expand Up @@ -115,7 +113,6 @@ describe('Select - row().scrollTo()', function() {

describe('Check the behaviour - non-linear', function() {
dt.html('empty');
let table;
it('Scroll to line 1000', function() {
let data = [];
for (var i = 0; i < 50000; i++) {
Expand All @@ -138,7 +135,7 @@ describe('Select - row().scrollTo()', function() {
let visibleRows = 6;
let halfway = parseInt((rowCount - visibleRows) / 2);

expect($('#example tbody tr:eq('+halfway+') td:eq(0)').text()).toBe('1000');
expect($('#example tbody tr:eq(' + halfway + ') td:eq(0)').text()).toBe('1000');
done();
});
});
Expand Down
2 changes: 1 addition & 1 deletion test/api/scroller.page().js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
describe('Select - row().select()', function() {
describe('Select - scroller.page()', function() {
var table;

dt.libs({
Expand Down
4 changes: 2 additions & 2 deletions test/api/scroller.toPosition().js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
describe('Select - row().select()', function() {
describe('Select - scroller.toPosition()', function() {
var table;

dt.libs({
Expand Down Expand Up @@ -75,7 +75,7 @@ describe('Select - row().select()', function() {
let visibleRows = 6;
let halfway = parseInt((rowCount - visibleRows) / 2);

expect($('#example tbody tr:eq('+halfway+') td:eq(0)').text()).toBe('1000');
expect($('#example tbody tr:eq(' + halfway + ') td:eq(0)').text()).toBe('1000');
done();
});
});
Expand Down

0 comments on commit 958f897

Please sign in to comment.