3 * Copyright(c) 2006-2010 Ext JS, Inc.
5 * http://www.extjs.com/license
8 * Tests Ext.data.Store functionality
12 var suite = Ext.test.session.getSuite('Ext.form.FormPanel'),
15 function buildForm(config) {
16 return new Ext.form.FormPanel(config);
19 suite.add(new Y.Test.Case({
20 name: 'initialization',
22 testCreatesForm: function() {
23 var form = buildForm();
25 assert.isTrue(form.form instanceof Ext.form.BasicForm);
28 testInitsItems: function() {
29 var FormPanel = Ext.form.FormPanel,
30 proto = FormPanel.prototype,
31 oldInit = proto.initItems,
34 proto.initItems = function() {
38 var form = buildForm();
39 assert.isTrue(wasCalled);
41 proto.initItems = oldInit;
44 testStartsMonitoring: function() {
45 var FormPanel = Ext.form.FormPanel,
46 proto = FormPanel.prototype,
47 oldFunc = proto.startMonitoring,
50 proto.startMonitoring = function() {
54 var form = buildForm({
56 renderTo : Ext.getBody()
60 assert.isTrue(wasCalled);
62 proto.startMonitoring = oldFunc;
67 suite.add(new Y.Test.Case({
70 testStopMonitoring: function() {
71 var FormPanel = Ext.form.FormPanel,
72 proto = FormPanel.prototype,
73 oldFunc = proto.stopMonitoring,
76 proto.stopMonitoring = function() {
80 var form = buildForm({
82 renderTo : Ext.getBody()
87 assert.isTrue(wasCalled);
89 proto.stopMonitoring = oldFunc;
93 suite.add(new Y.Test.Case({
96 testIsField: function() {
98 setValue : Ext.emptyFn,
99 getValue : Ext.emptyFn,
100 markInvalid : Ext.emptyFn,
101 clearInvalid: Ext.emptyFn
104 var form = buildForm();
106 assert.isTrue(form.isField(mockField));