diff --git a/test/child-row.spec.js b/test/child-row.spec.js index a1f23e89..8b35ab27 100644 --- a/test/child-row.spec.js +++ b/test/child-row.spec.js @@ -7,7 +7,7 @@ describe(suite + ': Child row', () => { beforeEach(()=>{ setOptions({ - childRow + childRow, }); }); @@ -43,5 +43,42 @@ describe(suite + ': Child row', () => { },done); }); + it('can programmaticaly open a child row', (done)=>{ + + vm().toggleChildRow(245); + + run(function() { + count('.VueTables__child-row',1); + },done); + }); + + it('can programmaticaly close a child row', (done)=>{ + + click(firstRowToggler); + + count('.VueTables__child-row',1); + + vm().toggleChildRow(245); + + run(function() { + count('.VueTables__child-row',0); + },done); + }); + + it('can use a user-defined key as a unique id', (done)=>{ + + setOptions({ + childRow, + uniqueKey:'code' + }); + + vm().toggleChildRow('ZW'); + + run(function() { + count('.VueTables__child-row',1); + },done); + + }); + }); \ No newline at end of file diff --git a/test/setup/client-setup.js b/test/setup/client-setup.js index be8aa429..d5a72473 100644 --- a/test/setup/client-setup.js +++ b/test/setup/client-setup.js @@ -7,8 +7,10 @@ import data from './example-data' global.suite = 'Client'; global.run = function(cb, done) { - cb(); - done(); + setTimeout(()=>{ + cb(); + done(); + }, 0); } beforeEach(function() {