2012-07-04 09:56:26 +00:00
|
|
|
$(document).ready(function () {
|
|
|
|
var $fix = $('#qunit-fixture');
|
|
|
|
|
|
|
|
var instance;
|
|
|
|
var baseSetup = function () {
|
2012-07-04 11:24:06 +00:00
|
|
|
instance = openerp.testing.instanceFor('list_editable');
|
2012-07-04 09:56:26 +00:00
|
|
|
|
2012-07-04 11:24:06 +00:00
|
|
|
openerp.testing.loadTemplate(instance);
|
2012-07-04 09:56:26 +00:00
|
|
|
|
2012-07-04 11:24:06 +00:00
|
|
|
openerp.testing.mockifyRPC(instance);
|
2012-07-04 09:56:26 +00:00
|
|
|
};
|
|
|
|
module('editor', {
|
|
|
|
setup: baseSetup
|
|
|
|
});
|
|
|
|
asyncTest('base-state', 2, function () {
|
|
|
|
var e = new instance.web.list.Editor({
|
|
|
|
dataset: {},
|
|
|
|
editionView: function () {
|
|
|
|
return {
|
|
|
|
arch: {
|
|
|
|
tag: 'form',
|
|
|
|
attrs: {
|
|
|
|
version: '7.0',
|
|
|
|
'class': 'oe_form_container'
|
|
|
|
},
|
|
|
|
children: []
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
});
|
|
|
|
e.appendTo($fix)
|
|
|
|
.always(start)
|
|
|
|
.fail(function (error) { ok(false, error && error.message); })
|
|
|
|
.done(function () {
|
|
|
|
ok(!e.isEditing(), "should not be editing");
|
|
|
|
ok(e.form instanceof instance.web.FormView,
|
|
|
|
"should use default form type");
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|