session: unwrap root widget; parser: don't parse arrays

This commit is contained in:
bordun 2018-10-31 11:51:07 +01:00
parent 6ae3ce7f10
commit 7ff0c8a0ce
5 changed files with 51 additions and 59 deletions

View file

@ -3,14 +3,14 @@ var fs = require('fs')
// create tmp session file
var session = [{tabs:[{widgets:[]}]}],
var session = {type: 'root', tabs:[{widgets:[]}]},
sessionPath = 'test-session.json'
require('../scripts/client-shim')
var {widgets} = require('../src/client/app/widgets')
for (let type in widgets) {
session[0].tabs[0].widgets.push({type: type})
session.tabs[0].widgets.push({type: type})
}
fs.writeFileSync(sessionPath, JSON.stringify(session))