[#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:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user