Skip to content

Commit

Permalink
tests(specs): simplify test setup
Browse files Browse the repository at this point in the history
  • Loading branch information
ccrowhurstram committed Sep 13, 2015
1 parent 380ba21 commit c075106
Showing 1 changed file with 6 additions and 26 deletions.
32 changes: 6 additions & 26 deletions test/tableSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,13 +172,9 @@ describe('ng-table', function() {
expect(rows.length).toBe(0);

var params = new NgTableParams({
page: 1, // show first page
count: 10 // count per page
}, {
total: dataset.length, // length of data
getData: function($defer, params) {
$defer.resolve(dataset.slice((params.page() - 1) * params.count(), params.page() * params.count()));
}
dataset: dataset
});

scope.tableParams = params;
Expand All @@ -203,14 +199,8 @@ describe('ng-table', function() {
it('should show data-title-text', function() {
var tbody = elm.find('tbody');

var params = new NgTableParams({
page: 1, // show first page
count: 10 // count per page
}, {
total: dataset.length, // length of data
getData: function($defer, params) {
$defer.resolve(dataset);
}
var params = new NgTableParams({}, {
dataset: dataset
});
scope.tableParams = params;
scope.$digest();
Expand All @@ -232,11 +222,7 @@ describe('ng-table', function() {
it('should show/hide columns', function() {
var tbody = elm.find('tbody');

scope.tableParams = new NgTableParams({
page: 1, // show first page
count: 10 // count per page
}, {
total: dataset.length,
scope.tableParams = new NgTableParams({}, {
dataset: dataset
});
scope.$digest();
Expand Down Expand Up @@ -278,14 +264,8 @@ describe('ng-table', function() {
$compile(elm)(scope);
scope.$digest();

var params = new NgTableParams({
page: 1, // show first page
count: 10 // count per page
}, {
total: dataset.length, // length of data
getData: function($defer, params) {
$defer.resolve(dataset);
}
var params = new NgTableParams({}, {
dataset: dataset
});
scope.tableParams = params;
scope.$digest();
Expand Down

0 comments on commit c075106

Please sign in to comment.