{"size": 1441, "ext": "js", "max_stars_repo_path": "test/api/core/$().js", "max_stars_repo_name": "gregorschatz/DataTablesSrc", "max_stars_repo_stars_event_min_datetime": "2015-02-17T10:40:21.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-28T12:13:37.000Z", "max_issues_repo_path": "test/api/core/$().js", "max_issues_repo_name": "gregorschatz/DataTablesSrc", "max_issues_repo_issues_event_min_datetime": "2015-01-12T00:21:33.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-14T09:58:51.000Z", "max_forks_repo_path": "test/api/core/$().js", "max_forks_repo_name": "gregorschatz/DataTablesSrc", "max_forks_repo_forks_event_min_datetime": "2015-01-17T03:59:33.000Z", "max_forks_repo_forks_event_max_datetime": "2022-03-31T18:27:01.000Z"}
{"max_stars_count": 338, "max_issues_count": 173, "max_forks_count": 439, "avg_line_length": 24.4237288136, "max_line_length": 75, "alphanum_fraction": 0.5378209577}
describe('core - $()', function() {
	dt.libs({
		js: ['jquery', 'datatables'],
		css: ['datatables']
	});

	var table;

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

		it('Returns a jQuery instance', function() {
			expect(table.$('tr') instanceof $).toBe(true);
		});
	});

	describe('Functional tests', function() {
		dt.html('basic');
		it('Selector - node', function() {
			table = $('#example').DataTable();
			expect(table.$(table.cell(2, 0).node()).text()).toBe('Ashton Cox');
		});
		it('Selector - jQuery', function() {
			expect(table.$($('tbody tr:eq(2) td:eq(0)')).text()).toBe('Ashton Cox');
		});
		it('Selector - string', function() {
			expect(table.$('td:contains("Cox")').text()).toBe('Ashton Cox');
		});
		it('Modifer - none', function() {
			expect(table.$('tr').length).toBe(57);
		});
		it('Modifer - page', function() {
			expect(table.$('tr', { page: 'current' }).length).toBe(10);
		});
		it('Modifer - order - original', function() {
			expect(
				table
					.$('tr:eq(0)', { order: 'original' })
					.text()
					.trim()
					.split(' ')[0]
			).toBe('Tiger');
		});
		it('Modifer - order - current', function() {
			expect(
				table
					.$('tr:eq(0)', { order: 'current' })
					.text()
					.trim()
					.split(' ')[0]
			).toBe('Airi');
		});
	});
});
