[#88,refactor/state,api-change][s]: convert state on DataExplorer to proper ObjectState model and rename config to state in DataExplorer initialization arguments.

* Also add more tests (#45).
This commit is contained in:
Rufus Pollock
2012-04-15 13:44:01 +01:00
parent 6a352f9c44
commit 8f33235933
2 changed files with 58 additions and 33 deletions

View File

@@ -24,11 +24,24 @@ test('getState', function () {
el: $el
});
var state = explorer.getState();
ok(state.query);
equal(state.query.size, 100);
deepEqual(state['view-grid'].hiddenFields, []);
ok(state.get('query'));
equal(state.get('readOnly'), false);
equal(state.get('query').size, 100);
deepEqual(state.get('view-grid').hiddenFields, []);
$el.remove();
});
test('initialize state', function () {
var dataset = Fixture.getDataset();
var explorer = new recline.View.DataExplorer({
model: dataset,
state: {
readOnly: true
}
});
var state = explorer.getState();
ok(state.get('readOnly'));
});
})(this.jQuery);