{"size": 2540, "ext": "js", "max_stars_repo_path": "src/datatable/docs/assets/datatable-basic-tests.js", "max_stars_repo_name": "maniekmankowski/yui3", "max_stars_repo_stars_event_min_datetime": "2015-01-01T02:46:43.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-26T20:25:44.000Z", "max_issues_repo_path": "src/datatable/docs/assets/datatable-basic-tests.js", "max_issues_repo_name": "Genhir/yui3", "max_issues_repo_issues_event_min_datetime": "2021-02-09T14:20:36.000Z", "max_issues_repo_issues_event_max_datetime": "2021-02-09T14:41:51.000Z", "max_forks_repo_path": "src/datatable/docs/assets/datatable-basic-tests.js", "max_forks_repo_name": "Genhir/yui3", "max_forks_repo_forks_event_min_datetime": "2015-01-01T02:49:26.000Z", "max_forks_repo_forks_event_max_datetime": "2022-03-04T10:23:18.000Z"}
{"max_stars_count": 1958, "max_issues_count": 58, "max_forks_count": 720, "avg_line_length": 51.8367346939, "max_line_length": 108, "alphanum_fraction": 0.5602362205}
YUI.add('datatable-basic-tests', function(Y) {

    var suite = new Y.Test.Suite('datatable-basic example test suite'),
        Assert = Y.Assert;

    suite.add(new Y.Test.Case({
        name: 'Example tests',
        'test first table elements': function() {
            var tableSelector = '#simple ',
                tableHeaderSelector = tableSelector + '.yui3-datatable-columns ',
                tableDataSelector = tableSelector + '.yui3-datatable-data ',
                th = Y.all(tableHeaderSelector + 'th'),
                td = Y.all(tableDataSelector + 'td'),
                tr = Y.all(tableHeaderSelector + 'tr, ' + tableDataSelector + 'tr'),
                cap = Y.one(tableSelector + 'caption');

            Assert.areEqual(3, th.size(), ' - Wrong number of th');
            Assert.areEqual(9, td.size(), ' - Wrong number of td');
            Assert.areEqual(4, tr.size(), ' - Wrong number of tr');
            Assert.isTrue((tr.item(2).hasClass('yui3-datatable-odd')), ' - Failed to assign odd row class');
            Assert.areEqual('Example table with simple columns', cap.getHTML(), ' - Wrong or no caption');
        },
        'test second table elements': function() {
            var tableSelector = '#labels ',
                tableHeaderSelector = tableSelector + '.yui3-datatable-columns ',
                tableDataSelector = tableSelector + '.yui3-datatable-data ',
                th = Y.all(tableHeaderSelector + 'th'),
                td = Y.all(tableDataSelector + 'td'),
                tr = Y.all(tableHeaderSelector + 'tr, ' + tableDataSelector + 'tr'),
                cap = Y.one(tableSelector + 'caption');

            Assert.areEqual(3, th.size(), ' - Wrong number of th');
            Assert.areEqual(9, td.size(), ' - Wrong number of td');
            Assert.areEqual(4, tr.size(), ' - Wrong number of tr');
            Assert.isTrue((tr.item(2).hasClass('yui3-datatable-odd')), ' - Failed to assign odd row class');
            Assert.areEqual('These columns have labels and abbrs', cap.getHTML(), ' - Wrong or no caption');
        },
        'test second table header contents': function() {
            var tableSelector = '#labels ',
                th = Y.all(tableSelector + 'th');
            Assert.areEqual('Wholesale Price', th.item(2).getHTML(), ' - Wrong or th contents');
            Assert.areEqual('Name', th.item(1).getAttribute('abbr'), ' - Wrong or th contents');
        }
    }));

    Y.Test.Runner.add(suite);

}, '', { requires: [ 'node', 'node-event-simulate' ] });
