File: table%28%29.body%28%29.js

package info (click to toggle)
datatables.js 1.10.21%2Bdfsg-2%2Bdeb11u1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 22,604 kB
  • sloc: javascript: 64,254; xml: 10,441; php: 4,623; sh: 523; makefile: 21
file content (29 lines) | stat: -rw-r--r-- 819 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
describe('tables - table().body()', function() {
	dt.libs({
		js: ['jquery', 'datatables'],
		css: ['datatables']
	});

	describe('Check the defaults', function() {
		dt.html('basic');
		let table;
		it('Exists and is a function', function() {
			table = $('#example').DataTable();
			expect(typeof table.table().body).toBe('function');
		});
		it('Returns a body node', function() {
			let body = table.table().body();
			expect(body instanceof HTMLElement).toBe(true);
			expect(body.nodeName.toUpperCase()).toBe('TBODY');
		});
	});

	describe('Functional tests', function() {
		dt.html('basic');
		it('Returns the correct element', function() {
			let table = $('#example').DataTable();
			$(table.table().body()).addClass('unitTest');
			expect($('#example tbody').hasClass('unitTest')).toBe(true);
		});
	});
});