1
0
Fork 0
mirror of https://github.com/koalyptus/TableFilter.git synced 2026-03-16 15:45:45 +01:00

Expanded StatusBar tests

This commit is contained in:
Max Guglielmi 2017-04-11 02:33:27 +10:00
commit b03445ea46
15 changed files with 57 additions and 26 deletions

View file

@ -8,6 +8,7 @@
<script src="libs/polyfill.js"></script>
</head>
<body>
<div id="custom-container"></div>
<table id="demo" cellpadding="0" cellspacing="0">
<tbody>
<tr>

View file

@ -36,8 +36,25 @@ asyncTest('Can display message', function() {
start();
deepEqual(statusBar.msgContainer.innerHTML,
'hello world', 'Message displayed');
statusBar.msgContainer.innerHTML = '';
}, 2);
});
asyncTest('Should not display message if not enabled', function() {
// setup
statusBar.enabled = false;
// act
statusBar.message('hello world');
// assert
setTimeout(function(){
start();
deepEqual(statusBar.msgContainer.innerHTML,
'', 'Message not displayed');
}, 2);
statusBar.enabled = true;
});
module('Feature interface');
test('Properties', function() {
@ -100,7 +117,8 @@ test('Remove UI', function() {
deepEqual(label, null, 'Status bar button removed');
});
test('Re-set UI', function() {
module('Re-set UI');
test('Status text', function() {
statusBar.text = '→←';
statusBar.init();
@ -108,6 +126,18 @@ test('Re-set UI', function() {
notEqual(
label.innerHTML.indexOf('→←'), -1, 'Status bar text');
});
test('Custom container', function() {
// setup
statusBar.destroy();
statusBar.targetId = 'custom-container';
// act
statusBar.init();
// assert
deepEqual(statusBar.msgContainer.nodeName,
'SPAN', 'Custom container element');
});
module('Tear-down');
test('can destroy TableFilter DOM elements', function() {