67
67
test_dynamic_creation_html: function() {
68
68
var theTree = new this.YAHOO.widget.TreeView('theTree');
69
69
var root = theTree.getRoot();
70
var two = new this.YAHOO.widget.HTMLNode('<i>second</i>', root, false, true);
70
var two = new this.YAHOO.widget.HTMLNode('<i>second</i>', root,
71
72
Assert.areEqual(1, theTree.getNodeCount());
74
75
test_markup_creation: function() {
75
Y.get('#theTree').set('innerHTML', '<ul><li>One</li><li>Two</li></ul>');
76
Y.get('#theTree').set('innerHTML',
77
'<ul><li>One</li><li>Two</li></ul>');
76
78
theTree = new this.YAHOO.widget.TreeView('theTree');
77
79
Assert.areEqual(2, theTree.getNodeCount());
80
82
test_markup_creation_html: function() {
81
Y.get('#theTree').set('innerHTML', '<ul><li>One</li>' +
82
' <li><b>Two (html)</b></li>' +
83
Y.get('#theTree').set('innerHTML',
85
' <li><b>Two (html)</b></li>' +
84
87
theTree = new this.YAHOO.widget.TreeView('theTree');
85
88
Assert.areEqual(2, theTree.getNodeCount());
88
91
test_expand: function() {
89
Y.get('#theTree').set('innerHTML', '<ul><li>One<ul><li>One a</li><li>One b</li></ul></li><li>Two</li></ul>');
92
Y.get('#theTree').set('innerHTML',
94
' <ul><li>One a</li>' +
90
99
theTree = new this.YAHOO.widget.TreeView('theTree');
92
101
var cross = Y.get('.ygtvspacer');
93
102
simulate(cross, 'click');
94
Assert.areEqual('block', Y.all('.ygtvchildren').item(1).getStyle('display'));
103
var display = Y.all('.ygtvchildren').item(1).getStyle('display');
104
Assert.areEqual('block', display);
95
105
simulate(cross, 'click');
96
Assert.areEqual('none', Y.all('.ygtvchildren').item(1).getStyle('display'));
106
display = Y.all('.ygtvchildren').item(1).getStyle('display');
107
Assert.areEqual('none', display);
99
110
test_destroy: function() {