dom-core-test.js revision 3489fc6bb1b5c6100aead509cd90048e4bb61617
ArrayAssert = Y.ArrayAssert;
name: 'Y.DOM.byId',
'should return element from string': function() {
},
'should return first match when dupe id exists': function() {
},
'should return null when no match': function() {
},
'should return null when input is null': function() {
},
'should return null when input is undefined': function() {
},
'should avoid mistaking name for id': function() {
.getElementsByTagName('input');
},
'should avoid mistaking form id for named input': function() {
},
'should search the given node': function() {
},
'should restrict search to the given node': function() {
},
'should search the given node (off document)': function() {
},
'should search the given document (frame)': function() {
},
'should search the given document (frame)': function() {
}
}));
name: 'Y.DOM.allById',
'should return all elements with the given id': function() {
.getElementsByTagName('span');
},
'should return all elements with the given id (root element)': function() {
},
'should return empty array when no match': function() {
}
}));
name: 'Y.DOM.children',
'should return empty array when no element childNodes': function() {
},
'should return empty array when input is null': function() {
},
'should return empty array when input is undefined': function() {
},
'should return elements only': function() {
}
}));
name: 'Y.DOM.firstByTag',
'should return the first match': function() {
},
'should return the first match (root element)': function() {
},
'should return null when no match': function() {
},
'should return null when tag is null': function() {
},
'should search given document': function() {
},
'should search given document (frame)': function() {
}
}));
name: 'Y.DOM.getText',
'should return the text content of the given node': function() {
text = '',
i = 0,
}
},
'should return the text content of the given text node': function() {
var text = 'foo bar',
},
'should return empty string when no text found' : function() {
},
'should return empty string when input is null' : function() {
},
'should return empty string when input is undefined' : function() {
}
}));
name: 'Y.DOM.setText',
'should set content with the given text': function() {
content = 'testing text content';
},
'should set html content as text': function() {
content = '<div>testing text content</div>';
},
'should preserve spaces': function() {
content = ' testing text content ';
},
'should replace existing content': function() {
content = 'testing text content';
},
'should set text for text node': function() {
content = 'testing text content';
}
}));
name: 'Y.DOM.elementByAxis',
'should return the next element': function() {
},
'should return the next node': function() {
},
'should return the next element that passes the test fn': function() {
};
},
'should return the next node that passes the test fn': function() {
};
},
'should return the previous element': function() {
},
'should return the previous node': function() {
},
'should return the previous element that passes the test fn': function() {
};
},
'should return the previous node that passes the test fn': function() {
};
},
'should return the parent element': function() {
},
'should return the ancestor element that passes the test fn': function() {
};
},
'should return null when not found': function() {
};
},
'should return null when input is null': function() {
},
'should return null when input is undefined': function() {
}
}));
name: 'Y.DOM.ancestor',
'should return the parent node': function() {
},
'should return the same node': function() {
},
'should return the matching ancestor': function() {
};
},
'should return the matching ancestor (test self match)': function() {
};
},
'should return the matching ancestor (test self not matched)': function() {
};
}
}));
name: 'Y.DOM.ancestors',
'should return an array of one (documentElement)': function() {
},
'should include the starting node': function() {
},
'should omit the starting node': function() {
},
'should return the matching ancestors': function() {
};
},
'should return the matching ancestors (test self match)': function() {
};
},
'should return the matching ancestors (test self not matched)': function() {
};
}
}));
name: 'Y.DOM.contains',
'html element should contain body element': function() {
},
'body element should not contain html element': function() {
},
'should be true for contained element': function() {
},
'should be false for uncontained element': function() {
},
'should be true when element is element': function() {
},
'should be true for contained text node': function() {
},
'should be false for uncontained text node': function() {
},
'should return false for null input': function() {
},
'should return false for undefined input': function() {
}
}));
name: 'Y.DOM._bruteContains',
'html element should contain body element': function() {
},
'body element should not contain html element': function() {
},
'should be true for contained element': function() {
},
'should be false for uncontained element': function() {
},
'should be true when element is element': function() {
},
'should be true for contained text node': function() {
},
'should be false for uncontained text node': function() {
},
'should return false for null input': function() {
},
'should return false for undefined input': function() {
}
}));
name: 'Y.DOM.inDoc',
'should return false for off document node': function() {
},
'should return true for in document node': function() {
},
'should return false for removed node': function() {
},
'should work with duplicate IDs in document': function() {
.getElementsByTagName('span');
},
'should work with duplicate IDs off document': function() {
},
'should work with form that has input name="id" and id="id"': function() {
},
'should return false when input is null': function() {
},
'should return false for cloned node off document': function() {
},
'should return true for cloned node in document (same id)': function() {
},
'should return true for cloned node in document (new id)': function() {
}
}));
name: 'Y.DOM.create',
'should create empty div': function() {
},
'should trim leading space': function() {
},
'should create empty div (self-closed input)': function() {
},
'should create div with text': function() {
},
'should create div with innerHTML': function() {
},
'should create input type submit': function() {
},
'should create input type radio': function() {
},
'should create form': function() {
},
'should create a form with content': function() {
'<label>foo:</label><input name="foo"><input type="submit"></form>'),
},
'should create legend': function() {
},
'should create fieldset': function() {
},
'should create label': function() {
},
'should create a list item': function() {
},
'should create a one item list': function() {
},
'should create a table': function() {
},
'should create a table with content': function() {
},
'should create a table head': function() {
},
'should create a table head with nested table': function() {
'<td>fresh</td></tr></tbody></table></td></tr></thead>');
},
'should create a table heading cell': function() {
},
'should create a caption': function() {
},
'should create a colgroup': function() {
},
'should create a col element': function() {
},
'should create a colgroup with col elements': function() {
i = 0,
cols = [],
// IE inserts a linefeed between cols
}
}
},
'should create a table row': function() {
},
'should create a table row with content': function() {
},
'should create a table cell': function() {
},
'should create a table cell with content': function() {
},
'should create a button element': function() {
},
'should create an optgroup element': function() {
},
'should create an optgroup with an option': function() {
},
'should create an optgroup with options': function() {
},
'should create a select element': function() {
},
'should create a select with an option': function() {
},
'should create a select with options': function() {
},
'should create a option element': function() {
},
'should create a option with content': function() {
},
'should create a selected option': function() {
},
'should create an iframe (self-closed)': function() {
},
'should create an iframe': function() {
},
'should create an iframe with attributes': function() {
var html = '<iframe border="0" frameBorder="0" marginWidth="0"' +
' marginHeight="0" leftMargin="0" topMargin="0"' +
' allowTransparency="true" width="100%" height="99%"></iframe>';
},
'should create a script': function() {
},
'should create a script with src': function() {
},
'should create a link element': function() {
},
'should create a link element with attrs': function() {
},
'should create a textNode': function() {
},
'should return a fragment when creating a collection': function() {
var html = '<div>foo</div><div id="tmp-bar">bar</div><div>baz</div>',
},
'should return a fragment containing options': function() {
var html = '<option>foo</option><option id="tmp-bar">bar</option><option>baz</option>',
},
'should return a fragment including text nodes': function() {
var html = 'foo <span>bar</span> baz',
},
'should return a fragment with the correct selected option': function() {
var html = '<option>foo</option><option selected>bar</option><option>baz</option>';
},
'should return a fragment containing table cells': function() {
var html = '<td>foo</td><td id="tmp-bar">bar</td><td>baz</td>',
},
'should return a fragment containing col elements': function() {
var html = '<col><col>',
},
'should return a fragment containing table bodies': function() {
var html = '<tbody>foo</tbody><tbody id="tmp-bar">bar</tbody><tbody>baz</tbody>',
},
'should return a fragment containing thead with nested table and tbody': function() {
var html = '<thead><tr><td><table><tbody><tr><td>fresh</td></tr>' +
'</tbody></table></td></tr></thead><tbody></tbody>',
}
}));
name: 'Y.DOM.getAttribute',
'should return "className" value': function() {
},
'should return "for" value': function() {
},
'should handle bad input': function() {
Y.DOM.getAttribute(null);
Y.DOM.getAttribute();
}
}));
name: 'Y.DOM.setAttribute',
'should set className': function() {
},
'should set "for" attribute': function() {
},
'should handle bad input': function() {
Y.DOM.setAttribute();
}
}));
name: 'Y.DOM.getValue',
'input value should match html value': function() {
val = 'test value';
},
'input value should match no html value': function() {
val = '';
},
'input value should match empty html value': function() {
val = '';
},
'textarea value should match html value': function() {
val = 'textarea test';
},
'textarea value should match no html value': function() {
val = '';
},
'should ignore textarea html value attribute': function() {
},
'select value should match html value': function() {
val = 'option value';
},
'select value should match no html value': function() {
val = '';
},
'select value should match empty html value with text': function() {
val = '';
},
'select value should match empty html value': function() {
val = '';
},
'option value should match html value': function() {
val = 'option value';
},
'option value should match html content': function() {
val = 'option text';
},
'option value should match no html value': function() {
val = '';
},
'option value should match empty html value with text': function() {
val = '';
},
'option value should match empty html value': function() {
val = '';
},
'button value should match html value': function() {
val = 'button value';
},
'button value should match no html value': function() {
val = '';
},
'button value should ignore html content': function() {
val = '';
},
'button value should match empty value': function() {
val = '';
}
}));
name: 'Y.DOM.setValue',
'input value should match updated value': function() {
val = 'new value';
},
'value updated from empty string should be new value': function() {
val = 'new value';
},
'value updated from no value should be new value': function() {
val = 'new value';
},
'textarea from html value should match new value': function() {
val = 'new textarea test';
},
'textarea from no value should match new value': function() {
val = 'new textarea test';
},
'button value should match updated value': function() {
val = 'new value';
},
'button value updated from empty string should be new value': function() {
val = 'new value';
},
'button value updated from no value should be new value': function() {
val = 'new value';
},
'option value should match updated value': function() {
val = 'new value';
},
'option value updated from text should be new value': function() {
val = 'new value';
},
'option value updated from empty string should be new value': function() {
val = 'new value';
},
'option value updated from no value should be new value': function() {
val = 'new value';
}
}));
name: 'Y.DOM._nl2Frag',
'should return fragment from HTMLCollection': function() {
frag;
},
'should return fragment from Array of HTML Elements': function() {
var nodes = [
],
},
'should return null for bad input': function() {
}
}));
name: 'Y.DOM.isWindow',
'should return true for window object': function() {
},
'should return true for frame window object': function() {
},
'should return false for document object': function() {
},
'should return false for non-window input': function() {
}
}));
name: 'Y.DOM._removeChildNodes',
'should remove all childNodes': function() {
html = '<em>foo</em><strong>bar</strong><span>baz</span>';
}
}));
name: 'Y.DOM.addHTML',
'should append the given html to the node': function() {
},
'should prepend the given html to the node': function() {
},
'should insert the given html after the first child': function() {
},
'should append the given node': function() {
},
'should add html before the given node': function() {
},
'should add html after the given node': function() {
}
}));
name: 'Y.DOM._getRegExp',
'should return RegExp obj': function() {
},
'should return cached RegExp obj': function() {
},
'should return new RegExp obj': function() {
}
}));
name: 'Y.DOM._getDoc',
'should return document from body': function() {
},
'should return document from new node': function() {
},
'should return document from window': function() {
},
'should return document from document': function() {
},
'should return iframe document from iframe window': function() {
},
'should return iframe document from iframe node': function() {
},
'should return iframe document from iframe document': function() {
}
}));
name: 'Y.DOM._getWin',
'should return window from body': function() {
},
'should return window from new node': function() {
},
'should return window from window': function() {
},
'should return window from document': function() {
},
'should return iframe window from iframe window': function() {
},
'should return iframe window from iframe node': function() {
},
'should return iframe window from iframe document': function() {
}
}));
name: 'Y.DOM._batch',
'should append html on all nodes in HTMLCollection': function() {
val = '<p>new text</p>';
},
'should setText on all nodes in HTMLCollection': function() {
val = 'new text';
}
}));
name: 'Y.DOM._setSize',
'should set the node offsetWidth to the given value': function() {
},
'should set the node offsetHeight to the given value': function() {
},
'should set the node offsetWidth to zero if given a negative number': function() {
},
'should set the node offsetHeight to zero if given a negative number': function() {
},
'should set the offsetWidth via setWidth': function() {
},
'should set the offsetHeight via setHeight': function() {
},
'should set offsetWidth accounting for padding': function() {
},
'should set offsetHeight accounting for padding': function() {
},
'should set offsetWidth to padding when setting to zero': function() {
},
'should set offsetHeight to padding when setting to zero': function() {
}
}));
name: 'Y.DOM.wrap',
'should wrap the node with the given html': function() {
},
'should wrap the node with the given complex html': function() {
}
}));
name: 'Y.DOM.unwrap',
'should remove the node\'s parent': function() {
},
'should remove the node\'s parent and replace in DOM': function() {
},
'should remove the node\'s parent and replace in DOM with siblings': function() {
node;
}
}));