@ -12,8 +12,9 @@ export function getStringParameter(name:string) {
|
||||
|
||||
for (var i=0; i<els.length; i++) {
|
||||
el = els[i];
|
||||
if ((el.type !== 'radio' && el.type !== 'checkbox') || el.checked) {
|
||||
value = el.value;
|
||||
var type = DOM.type(el);
|
||||
if ((type !== 'radio' && type !== 'checkbox') || DOM.getChecked(el)) {
|
||||
value = DOM.getValue(el);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -151,12 +151,12 @@ export class SpyObject {
|
||||
|
||||
function elementText(n) {
|
||||
var hasShadowRoot = (n) => n instanceof Element && n.shadowRoot;
|
||||
var hasNodes = (n) => n.childNodes && n.childNodes.length > 0;
|
||||
var hasNodes = (n) => {var children = DOM.childNodes(n); return children && children.length > 0;}
|
||||
|
||||
if (n instanceof Comment) return '';
|
||||
|
||||
if (n instanceof Array) return n.map((nn) => elementText(nn)).join("");
|
||||
if (n instanceof Element && n.tagName == 'CONTENT')
|
||||
if (n instanceof Element && DOM.tagName(n) == 'CONTENT')
|
||||
return elementText(Array.prototype.slice.apply(n.getDistributedNodes()));
|
||||
if (hasShadowRoot(n)) return elementText(DOM.childNodesAsList(n.shadowRoot));
|
||||
if (hasNodes(n)) return elementText(DOM.childNodesAsList(n));
|
||||
|
2
modules/angular2/src/test_lib/utils.js
vendored
2
modules/angular2/src/test_lib/utils.js
vendored
@ -39,5 +39,5 @@ export function dispatchEvent(element, eventType) {
|
||||
}
|
||||
|
||||
export function el(html) {
|
||||
return DOM.firstChild(DOM.createTemplate(html).content);
|
||||
return DOM.firstChild(DOM.content(DOM.createTemplate(html)));
|
||||
}
|
||||
|
Reference in New Issue
Block a user