File: table%28%29.container%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-- 839 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().container()', 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().container).toBe('function');
		});
		it('Returns a node', function() {
			let node = table.table().container();
			expect(node instanceof HTMLElement).toBe(true);
			expect(node.nodeName.toUpperCase()).toBe('DIV');
		});
	});

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