]>
Commit | Line | Data |
---|---|---|
6527f429 DM |
1 | describe('Ext.layout.container.Form', function() {\r |
2 | \r | |
3 | // TODO: form layout specs\r | |
4 | xdescribe('child items manipulation', function() {\r | |
5 | \r | |
6 | it('should convert child items tables to tbody nodes', function() {\r | |
7 | var panel = Ext.create('Ext.form.Panel', {\r | |
8 | layout: 'form',\r | |
9 | renderTo: Ext.getBody(),\r | |
10 | items: [{\r | |
11 | id: 'textfield0',\r | |
12 | xtype: 'textfield'\r | |
13 | }, {\r | |
14 | id: 'textfield1',\r | |
15 | xtype: 'textfield'\r | |
16 | }]\r | |
17 | }),\r | |
18 | table = panel.el.down('table').dom;\r | |
19 | \r | |
20 | // both original and dynamically added children\r | |
21 | panel.add({\r | |
22 | id: 'textfield2',\r | |
23 | xtype: 'textfield'\r | |
24 | });\r | |
25 | \r | |
26 | expect(table.childNodes.length).toBe(3);\r | |
27 | expect(table.childNodes[0].tagName).toBe('TBODY');\r | |
28 | expect(table.childNodes[0]).toBe(Ext.getCmp('textfield0').el.dom);\r | |
29 | expect(table.childNodes[1].tagName).toBe('TBODY');\r | |
30 | expect(table.childNodes[1]).toBe(Ext.getCmp('textfield1').el.dom);\r | |
31 | expect(table.childNodes[2].tagName).toBe('TBODY');\r | |
32 | expect(table.childNodes[2]).toBe(Ext.getCmp('textfield2').el.dom);\r | |
33 | \r | |
34 | panel.destroy();\r | |
35 | });\r | |
36 | \r | |
37 | });\r | |
38 | \r | |
39 | it("should shrinkwrap auto-width items", function() {\r | |
40 | var panel = Ext.widget({\r | |
41 | xtype: 'panel',\r | |
42 | renderTo: document.body,\r | |
43 | shrinkWrap: true,\r | |
44 | layout: {\r | |
45 | type: 'form',\r | |
46 | labelWidth: 100\r | |
47 | },\r | |
48 | items: [{\r | |
49 | fieldLabel: 'Label',\r | |
50 | xtype: 'textfield'\r | |
51 | }]\r | |
52 | });\r | |
53 | \r | |
54 | expect(panel.getWidth()).toBe(267);\r | |
55 | panel.destroy();\r | |
56 | });\r | |
57 | \r | |
58 | }); |