If $sticky is FALSE, no tableheader.js should be included.
function testThemeTableNoStickyHeaders() {
$header = array(
'one',
'two',
'three',
);
$rows = array(
array(
1,
2,
3,
),
array(
4,
5,
6,
),
array(
7,
8,
9,
),
);
$attributes = array();
$caption = NULL;
$colgroups = array();
$this->content = theme('table', array(
'header' => $header,
'rows' => $rows,
'attributes' => $attributes,
'caption' => $caption,
'colgroups' => $colgroups,
'sticky' => FALSE,
));
$js = drupal_add_js();
$this
->assertFalse(isset($js['core/misc/tableheader.js']), 'tableheader.js was not included because $sticky = FALSE.');
$this
->assertNoRaw('sticky-enabled', 'Table does not have a class of sticky-enabled because $sticky = FALSE.');
drupal_static_reset('drupal_add_js');
}