0
|
1 import test from 'ava';
|
|
2 // import "console-advanced";
|
|
3 import Tablesaw from '../dist/tablesaw.js';
|
|
4
|
|
5 test('Tablesaw, DOM lib exists', t => {
|
|
6 t.is(typeof Tablesaw, "object");
|
|
7 t.is(typeof Tablesaw.$, "function");
|
|
8 t.not(typeof Tablesaw.Table, "undefined");
|
|
9 t.not(typeof Tablesaw.Stack, "undefined");
|
|
10 t.not(typeof Tablesaw.ColumnToggle, "undefined");
|
|
11 // t.not(typeof Tablesaw.Sortable, "undefined"); // TODO
|
|
12 // t.not(typeof Tablesaw.ModeSwitch, "undefined"); // TODO
|
|
13 t.not(typeof Tablesaw.MiniMap, "undefined");
|
|
14 // t.not(typeof Tablesaw.Btn, "undefined"); // TODO
|
|
15 t.not(typeof Tablesaw.CheckAll, "undefined");
|
|
16 });
|
|
17
|
|
18 test('MiniMap.show returns false when attribute is not set', t => {
|
|
19 var table = document.createElement( "table" );
|
|
20 t.is(Tablesaw.MiniMap.show(table), false);
|
|
21 });
|
|
22
|
|
23 test('MiniMap.show returns true when attribute is set (but value-less)', t => {
|
|
24 var table = document.createElement( "table" );
|
|
25 table.setAttribute( Tablesaw.MiniMap.attr.init, "" );
|
|
26 t.is(Tablesaw.MiniMap.show(table), true);
|
|
27 }); |