Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: Additional columns specified in the init options weren't being d…
- Loading branch information
Showing
2 changed files
with
58 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
describe('Empty DataTable', function() { | ||
dt.libs({ | ||
js: ['jquery', 'datatables'], | ||
css: ['datatables'] | ||
}); | ||
|
||
dt.html('basic'); | ||
|
||
it('DataTables can be initialised with an extra column', function() { | ||
new DataTable('#example', { | ||
columns: [ | ||
null, | ||
null, | ||
null, | ||
null, | ||
null, | ||
null, | ||
{ title: 'Title', defaultContent: 'Content' } | ||
] | ||
}); | ||
|
||
// No JS errors occurred | ||
expect(true).toEqual(true); | ||
}); | ||
|
||
it('Last title contains set title', function() { | ||
expect($('thead tr:first-child th:last-child').text()).toBe('Title'); | ||
}); | ||
|
||
it('Last column contains default content', function() { | ||
expect($('tbody tr:first-child td:last-child').text()).toBe('Content'); | ||
}); | ||
|
||
it('And first column is as expected', function() { | ||
expect($('thead tr:first-child th:first-child').text()).toBe('Name'); | ||
expect($('tbody tr:first-child td:first-child').text()).toBe('Airi Satou'); | ||
}); | ||
}); |