'));
}).toThrowError('No element binding found for property boundprop1 which is required by directive SomeDecoratorDirectiveWithBinding');
});
@@ -341,8 +341,3 @@ function sortArr(arr) {
arr2.sort();
return arr2;
}
-
-function createElement(html) {
- return DOM.createTemplate(html).content.firstChild;
-}
-
diff --git a/modules/core/test/compiler/pipeline/element_binding_marker_spec.js b/modules/core/test/compiler/pipeline/element_binding_marker_spec.js
index 28d206e549..f5a543d3b6 100644
--- a/modules/core/test/compiler/pipeline/element_binding_marker_spec.js
+++ b/modules/core/test/compiler/pipeline/element_binding_marker_spec.js
@@ -1,4 +1,4 @@
-import {describe, beforeEach, it, expect, iit, ddescribe} from 'test_lib/test_lib';
+import {describe, beforeEach, it, expect, iit, ddescribe, el} from 'test_lib/test_lib';
import {isPresent} from 'facade/lang';
import {DOM} from 'facade/dom';
import {MapWrapper} from 'facade/collection';
@@ -40,53 +40,53 @@ export function main() {
}
it('should not mark empty elements', () => {
- var results = createPipeline().process(createElement('
'));
+ var results = createPipeline().process(el('
'));
assertBinding(results[0], false);
});
it('should mark elements with text node bindings', () => {
var textNodeBindings = MapWrapper.create();
MapWrapper.set(textNodeBindings, 0, 'expr');
- var results = createPipeline({textNodeBindings: textNodeBindings}).process(createElement('
'));
+ var results = createPipeline({textNodeBindings: textNodeBindings}).process(el('
'));
assertBinding(results[0], true);
});
it('should mark elements with property bindings', () => {
var propertyBindings = MapWrapper.createFromStringMap({'a': 'expr'});
- var results = createPipeline({propertyBindings: propertyBindings}).process(createElement('
'));
+ var results = createPipeline({propertyBindings: propertyBindings}).process(el('
'));
assertBinding(results[0], true);
});
it('should mark elements with variable bindings', () => {
var variableBindings = MapWrapper.createFromStringMap({'a': 'expr'});
- var results = createPipeline({variableBindings: variableBindings}).process(createElement('
'));
+ var results = createPipeline({variableBindings: variableBindings}).process(el('
'));
assertBinding(results[0], true);
});
it('should mark elements with event bindings', () => {
var eventBindings = MapWrapper.createFromStringMap({'click': 'expr'});
- var results = createPipeline({eventBindings: eventBindings}).process(createElement('
'));
+ var results = createPipeline({eventBindings: eventBindings}).process(el('
'));
assertBinding(results[0], true);
});
it('should mark elements with decorator directives', () => {
var results = createPipeline({
directives: [SomeDecoratorDirective]
- }).process(createElement('
'));
+ }).process(el('
'));
assertBinding(results[0], true);
});
it('should mark elements with template directives', () => {
var results = createPipeline({
directives: [SomeTemplateDirective]
- }).process(createElement('
'));
+ }).process(el('
'));
assertBinding(results[0], true);
});
it('should mark elements with component directives', () => {
var results = createPipeline({
directives: [SomeComponentDirective]
- }).process(createElement('
'));
+ }).process(el('
'));
assertBinding(results[0], true);
});
@@ -115,8 +115,4 @@ class SomeTemplateDirective {}
class SomeComponentDirective {}
@Decorator()
-class SomeDecoratorDirective {}
-
-function createElement(html) {
- return DOM.createTemplate(html).content.firstChild;
-}
\ No newline at end of file
+class SomeDecoratorDirective {}
\ No newline at end of file
diff --git a/modules/core/test/compiler/pipeline/pipeline_spec.js b/modules/core/test/compiler/pipeline/pipeline_spec.js
index 34b4352a97..1058396092 100644
--- a/modules/core/test/compiler/pipeline/pipeline_spec.js
+++ b/modules/core/test/compiler/pipeline/pipeline_spec.js
@@ -1,4 +1,4 @@
-import {describe, beforeEach, it, expect, iit, ddescribe} from 'test_lib/test_lib';
+import {describe, beforeEach, it, expect, iit, ddescribe, el} from 'test_lib/test_lib';
import {ListWrapper, List, MapWrapper} from 'facade/collection';
import {DOM} from 'facade/dom';
import {isPresent, NumberWrapper, StringWrapper} from 'facade/lang';
@@ -12,7 +12,7 @@ export function main() {
describe('compile_pipeline', () => {
describe('children compilation', () => {
it('should walk the tree in depth first order including template contents', () => {
- var element = createElement('
');
+ var element = el('
');
var step0Log = [];
var results = new CompilePipeline([createLoggerStep(step0Log)]).process(element);
@@ -22,7 +22,7 @@ export function main() {
});
it('should stop walking the tree when compileChildren is false', () => {
- var element = createElement('
');
+ var element = el('
');
var step0Log = [];
var pipeline = new CompilePipeline([new IgnoreChildrenStep(), createLoggerStep(step0Log)]);
@@ -35,7 +35,7 @@ export function main() {
describe('control.addParent', () => {
it('should report the new parent to the following processor and the result', () => {
- var element = createElement('
');
+ var element = el('
');
var step0Log = [];
var step1Log = [];
var pipeline = new CompilePipeline([
@@ -49,7 +49,7 @@ export function main() {
});
it('should allow to add a parent by multiple processors to the same element', () => {
- var element = createElement('
');
+ var element = el('
');
var step0Log = [];
var step1Log = [];
var step2Log = [];
@@ -66,7 +66,7 @@ export function main() {
});
it('should allow to add a parent by multiple processors to different elements', () => {
- var element = createElement('
');
+ var element = el('
');
var step0Log = [];
var step1Log = [];
var step2Log = [];
@@ -83,7 +83,7 @@ export function main() {
});
it('should allow to add multiple parents by the same processor', () => {
- var element = createElement('
');
+ var element = el('
');
var step0Log = [];
var step1Log = [];
var pipeline = new CompilePipeline([
@@ -100,9 +100,9 @@ export function main() {
describe('control.addChild', () => {
it('should report the new child to all processors and the result', () => {
- var element = createElement('
');
+ var element = el('
');
var resultLog = [];
- var newChild = new CompileElement(createElement('
'));
+ var newChild = new CompileElement(el('
'));
var pipeline = new CompilePipeline([
new MockStep((parent, current, control) => {
if (StringWrapper.equals(current.element.id, '1')) {
@@ -161,7 +161,7 @@ function createWrapperStep(wrapperId, log) {
if (isPresent(parentCountStr)) {
var parentCount = NumberWrapper.parseInt(parentCountStr, 10);
while (parentCount > 0) {
- control.addParent(new CompileElement(createElement(`
`)));
+ control.addParent(new CompileElement(el(`
`)));
parentCount--;
}
}
@@ -175,8 +175,4 @@ function resultIdLog(result) {
logEntry(idLog, null, current);
});
return idLog;
-}
-
-function createElement(html) {
- return DOM.createTemplate(html).content.firstChild;
-}
+}
\ No newline at end of file
diff --git a/modules/core/test/compiler/pipeline/property_binding_parser_spec.js b/modules/core/test/compiler/pipeline/property_binding_parser_spec.js
index 9c4f658e95..d617d9bdac 100644
--- a/modules/core/test/compiler/pipeline/property_binding_parser_spec.js
+++ b/modules/core/test/compiler/pipeline/property_binding_parser_spec.js
@@ -1,4 +1,4 @@
-import {describe, beforeEach, it, expect, iit, ddescribe} from 'test_lib/test_lib';
+import {describe, beforeEach, it, expect, iit, ddescribe, el} from 'test_lib/test_lib';
import {PropertyBindingParser} from 'core/compiler/pipeline/property_binding_parser';
import {CompilePipeline} from 'core/compiler/pipeline/compile_pipeline';
import {DOM} from 'facade/dom';
@@ -13,49 +13,45 @@ export function main() {
}
it('should detect [] syntax', () => {
- var results = createPipeline().process(createElement('
'));
+ var results = createPipeline().process(el('
'));
expect(MapWrapper.get(results[0].propertyBindings, 'a').source).toEqual('b');
});
it('should detect bind- syntax', () => {
- var results = createPipeline().process(createElement('
'));
+ var results = createPipeline().process(el('
'));
expect(MapWrapper.get(results[0].propertyBindings, 'a').source).toEqual('b');
});
it('should detect interpolation syntax', () => {
// Note: we don't test all corner cases of interpolation as we assume shared functionality between text interpolation
// and attribute interpolation.
- var results = createPipeline().process(createElement('
'));
+ var results = createPipeline().process(el('
'));
expect(MapWrapper.get(results[0].propertyBindings, 'a').source).toEqual('(b)');
});
it('should detect let- syntax', () => {
- var results = createPipeline().process(createElement('
'));
+ var results = createPipeline().process(el('
'));
expect(MapWrapper.get(results[0].variableBindings, 'a')).toEqual('b');
});
it('should not allow let- syntax on non template elements', () => {
expect( () => {
- createPipeline().process(createElement('
'))
+ createPipeline().process(el('
'))
}).toThrowError('let-* is only allowed on
elements!');
});
it('should detect () syntax', () => {
- var results = createPipeline().process(createElement(''));
+ var results = createPipeline().process(el(''));
expect(MapWrapper.get(results[0].eventBindings, 'click').source).toEqual('b()');
// "(click[])" is not an expected syntax and is only used to validate the regexp
- results = createPipeline().process(createElement(''));
+ results = createPipeline().process(el(''));
expect(MapWrapper.get(results[0].eventBindings, 'click[]').source).toEqual('b()');
});
it('should detect on- syntax', () => {
- var results = createPipeline().process(createElement(''));
+ var results = createPipeline().process(el(''));
expect(MapWrapper.get(results[0].eventBindings, 'click').source).toEqual('b()');
});
});
-}
-
-function createElement(html) {
- return DOM.createTemplate(html).content.firstChild;
-}
+}
\ No newline at end of file
diff --git a/modules/core/test/compiler/pipeline/proto_element_injector_builder_spec.js b/modules/core/test/compiler/pipeline/proto_element_injector_builder_spec.js
index 9ae2ef0a11..ad485b2285 100644
--- a/modules/core/test/compiler/pipeline/proto_element_injector_builder_spec.js
+++ b/modules/core/test/compiler/pipeline/proto_element_injector_builder_spec.js
@@ -1,4 +1,4 @@
-import {describe, beforeEach, it, expect, iit, ddescribe} from 'test_lib/test_lib';
+import {describe, beforeEach, it, expect, iit, ddescribe, el} from 'test_lib/test_lib';
import {isPresent, isBlank} from 'facade/lang';
import {DOM} from 'facade/dom';
import {List, ListWrapper} from 'facade/collection';
@@ -44,20 +44,20 @@ export function main() {
}
it('should not create a ProtoElementInjector for elements without directives', () => {
- var results = createPipeline().process(createElement(''));
+ var results = createPipeline().process(el(''));
expect(results[0].inheritedProtoElementInjector).toBe(null);
});
it('should create a ProtoElementInjector for elements directives', () => {
var directives = [SomeComponentDirective, SomeTemplateDirective, SomeDecoratorDirective];
- var results = createPipeline(directives).process(createElement(''));
+ var results = createPipeline(directives).process(el(''));
var creationArgs = getCreationArgs(results[0].inheritedProtoElementInjector);
expect(creationArgs['bindings']).toEqual(directives);
});
it('should mark ProtoElementInjector for elements with component directives and use the ComponentDirective as first binding', () => {
var directives = [SomeDecoratorDirective, SomeComponentDirective];
- var results = createPipeline(directives).process(createElement(''));
+ var results = createPipeline(directives).process(el(''));
var creationArgs = getCreationArgs(results[0].inheritedProtoElementInjector);
expect(creationArgs['firstBindingIsComponent']).toBe(true);
expect(creationArgs['bindings']).toEqual([SomeComponentDirective, SomeDecoratorDirective]);
@@ -68,7 +68,7 @@ export function main() {
ListWrapper.push(protoView.elementBinders, null);
ListWrapper.push(protoView.elementBinders, null);
var directives = [SomeDecoratorDirective];
- var results = createPipeline(directives).process(createElement(''));
+ var results = createPipeline(directives).process(el(''));
var creationArgs = getCreationArgs(results[0].inheritedProtoElementInjector);
expect(creationArgs['index']).toBe(protoView.elementBinders.length);
});
@@ -76,52 +76,52 @@ export function main() {
describe("inheritedProtoElementInjector", () => {
it('should inherit the ProtoElementInjector down to children without directives', () => {
var directives = [SomeDecoratorDirective];
- var results = createPipeline(directives).process(createElement('
'));
+ var results = createPipeline(directives).process(el('
'));
expect(results[1].inheritedProtoElementInjector).toBe(results[0].inheritedProtoElementInjector);
});
it('should use the ProtoElementInjector of the parent element as parent', () => {
- var el = createElement('');
+ var element = el('');
var directives = [SomeDecoratorDirective];
- var results = createPipeline(directives).process(el);
+ var results = createPipeline(directives).process(element);
expect(results[2].inheritedProtoElementInjector.parent).toBe(
results[0].inheritedProtoElementInjector);
});
it('should use a null parent for viewRoots', () => {
- var el = createElement('
');
+ var element = el('
');
var directives = [SomeDecoratorDirective];
- var results = createPipeline(directives).process(el);
+ var results = createPipeline(directives).process(element);
expect(results[1].inheritedProtoElementInjector.parent).toBe(null);
});
it('should use a null parent if there is an intermediate viewRoot', () => {
- var el = createElement('');
+ var element = el('');
var directives = [SomeDecoratorDirective];
- var results = createPipeline(directives).process(el);
+ var results = createPipeline(directives).process(element);
expect(results[2].inheritedProtoElementInjector.parent).toBe(null);
});
});
describe("distanceToParentInjector", () => {
it("should be 0 for root elements", () => {
- var el = createElement('');
+ var element = el('');
var directives = [SomeDecoratorDirective];
- var results = createPipeline(directives).process(el);
+ var results = createPipeline(directives).process(element);
expect(results[0].inheritedProtoElementInjector.distanceToParent).toBe(0);
});
it("should be 1 when a parent element has an injector", () => {
- var el = createElement('
');
+ var element = el('
');
var directives = [SomeDecoratorDirective];
- var results = createPipeline(directives).process(el);
+ var results = createPipeline(directives).process(element);
expect(results[1].inheritedProtoElementInjector.distanceToParent).toBe(1);
});
it("should add 1 for every element that does not have an injector", () => {
- var el = createElement('');
+ var element = el('');
var directives = [SomeDecoratorDirective];
- var results = createPipeline(directives).process(el);
+ var results = createPipeline(directives).process(element);
expect(results[3].inheritedProtoElementInjector.distanceToParent).toBe(3);
});
});
@@ -171,8 +171,4 @@ class SomeTemplateDirective {}
class SomeComponentDirective {}
@Decorator()
-class SomeDecoratorDirective {}
-
-function createElement(html) {
- return DOM.createTemplate(html).content.firstChild;
-}
\ No newline at end of file
+class SomeDecoratorDirective {}
\ No newline at end of file
diff --git a/modules/core/test/compiler/pipeline/proto_view_builder_spec.js b/modules/core/test/compiler/pipeline/proto_view_builder_spec.js
index 13e46e195e..7b609dca43 100644
--- a/modules/core/test/compiler/pipeline/proto_view_builder_spec.js
+++ b/modules/core/test/compiler/pipeline/proto_view_builder_spec.js
@@ -1,4 +1,4 @@
-import {describe, beforeEach, it, expect, iit, ddescribe} from 'test_lib/test_lib';
+import {describe, beforeEach, it, expect, iit, ddescribe, el} from 'test_lib/test_lib';
import {isPresent} from 'facade/lang';
import {ElementBinder} from 'core/compiler/element_binder';
import {ProtoViewBuilder} from 'core/compiler/pipeline/proto_view_builder';
@@ -24,35 +24,35 @@ export function main() {
}
it('should not create a ProtoView when the isViewRoot flag is not set', () => {
- var results = createPipeline().process(createElement(''));
+ var results = createPipeline().process(el(''));
expect(results[0].inheritedProtoView).toBe(null);
});
it('should create a ProtoView when the isViewRoot flag is set', () => {
- var viewRootElement = createElement('');
+ var viewRootElement = el('');
var results = createPipeline().process(viewRootElement);
expect(results[0].inheritedProtoView.element).toBe(viewRootElement);
});
it('should inherit the ProtoView down to children that have no isViewRoot set', () => {
- var viewRootElement = createElement('
');
+ var viewRootElement = el('
');
var results = createPipeline().process(viewRootElement);
expect(results[0].inheritedProtoView.element).toBe(viewRootElement);
expect(results[1].inheritedProtoView.element).toBe(viewRootElement);
});
it('should save ProtoView into the elementBinder of parent element', () => {
- var el = createElement('');
- var results = createPipeline().process(el);
+ var element = el('');
+ var results = createPipeline().process(element);
expect(results[1].inheritedElementBinder.nestedProtoView).toBe(results[2].inheritedProtoView);
});
it('should bind variables to the nested ProtoView', () => {
- var el = createElement('');
+ var element = el('');
var results = createPipeline({
'var1': 'map1',
'var2': 'map2'
- }).process(el);
+ }).process(element);
var npv = results[1].inheritedElementBinder.nestedProtoView;
expect(npv.variableBindings).toEqual(MapWrapper.createFromStringMap({
'var1': 'map1',
@@ -63,9 +63,9 @@ export function main() {
describe('errors', () => {
it('should not allow multiple nested ProtoViews for the same parent element', () => {
- var el = createElement('');
+ var element = el('');
expect( () => {
- createPipeline().process(el);
+ createPipeline().process(element);
}).toThrowError('Only one nested view per element is allowed');
});
@@ -82,8 +82,4 @@ class MockStep extends CompileStep {
process(parent:CompileElement, current:CompileElement, control:CompileControl) {
this.processClosure(parent, current, control);
}
-}
-
-function createElement(html) {
- return DOM.createTemplate(html).content.firstChild;
}
\ No newline at end of file
diff --git a/modules/core/test/compiler/pipeline/text_interpolation_parser_spec.js b/modules/core/test/compiler/pipeline/text_interpolation_parser_spec.js
index 89ebb02dfc..c83533a0b8 100644
--- a/modules/core/test/compiler/pipeline/text_interpolation_parser_spec.js
+++ b/modules/core/test/compiler/pipeline/text_interpolation_parser_spec.js
@@ -1,4 +1,4 @@
-import {describe, beforeEach, expect, it, iit, ddescribe} from 'test_lib/test_lib';
+import {describe, beforeEach, expect, it, iit, ddescribe, el} from 'test_lib/test_lib';
import {TextInterpolationParser} from 'core/compiler/pipeline/text_interpolation_parser';
import {CompilePipeline} from 'core/compiler/pipeline/compile_pipeline';
import {DOM} from 'facade/dom';
@@ -17,45 +17,41 @@ export function main() {
}
it('should find text interpolation in normal elements', () => {
- var results = createPipeline().process(createElement('{{expr1}}{{expr2}}
'));
+ var results = createPipeline().process(el('{{expr1}}{{expr2}}
'));
var bindings = results[0].textNodeBindings;
expect(MapWrapper.get(bindings, 0).source).toEqual("(expr1)");
expect(MapWrapper.get(bindings, 2).source).toEqual("(expr2)");
});
it('should find text interpolation in template elements', () => {
- var results = createPipeline().process(createElement('{{expr1}}{{expr2}}'));
+ var results = createPipeline().process(el('{{expr1}}{{expr2}}'));
var bindings = results[0].textNodeBindings;
expect(MapWrapper.get(bindings, 0).source).toEqual("(expr1)");
expect(MapWrapper.get(bindings, 2).source).toEqual("(expr2)");
});
it('should allow multiple expressions', () => {
- var results = createPipeline().process(createElement('{{expr1}}{{expr2}}
'));
+ var results = createPipeline().process(el('{{expr1}}{{expr2}}
'));
var bindings = results[0].textNodeBindings;
expect(MapWrapper.get(bindings, 0).source).toEqual("(expr1)+(expr2)");
});
it('should not interpolate when compileChildren is false', () => {
- var results = createPipeline().process(createElement('{{included}}{{excluded}}
'));
+ var results = createPipeline().process(el('{{included}}{{excluded}}
'));
var bindings = results[0].textNodeBindings;
expect(MapWrapper.get(bindings, 0).source).toEqual("(included)");
expect(results[1].textNodeBindings).toBe(null);
});
it('should allow fixed text before, in between and after expressions', () => {
- var results = createPipeline().process(createElement('a{{expr1}}b{{expr2}}c
'));
+ var results = createPipeline().process(el('a{{expr1}}b{{expr2}}c
'));
var bindings = results[0].textNodeBindings;
expect(MapWrapper.get(bindings, 0).source).toEqual("'a'+(expr1)+'b'+(expr2)+'c'");
});
it('should escape quotes in fixed parts', () => {
- var results = createPipeline().process(createElement("'\"a{{expr1}}
"));
+ var results = createPipeline().process(el("'\"a{{expr1}}
"));
expect(MapWrapper.get(results[0].textNodeBindings, 0).source).toEqual("'\\'\"a'+(expr1)");
});
});
}
-
-function createElement(html) {
- return DOM.createTemplate(html).content.firstChild;
-}
diff --git a/modules/core/test/compiler/pipeline/view_splitter_spec.js b/modules/core/test/compiler/pipeline/view_splitter_spec.js
index b0b780acac..ad936e0068 100644
--- a/modules/core/test/compiler/pipeline/view_splitter_spec.js
+++ b/modules/core/test/compiler/pipeline/view_splitter_spec.js
@@ -1,4 +1,4 @@
-import {describe, beforeEach, it, expect, iit, ddescribe} from 'test_lib/test_lib';
+import {describe, beforeEach, it, expect, iit, ddescribe, el} from 'test_lib/test_lib';
import {isPresent} from 'facade/lang';
import {MapWrapper} from 'facade/collection';
@@ -16,7 +16,7 @@ export function main() {
}
it('should mark root elements as viewRoot', () => {
- var rootElement = createElement('');
+ var rootElement = el('');
var results = createPipeline().process(rootElement);
expect(results[0].isViewRoot).toBe(true);
});
@@ -24,7 +24,7 @@ export function main() {
describe(' elements', () => {
it('should move the content into a new element and mark that as viewRoot', () => {
- var rootElement = createElement('a
');
+ var rootElement = el('a
');
var results = createPipeline().process(rootElement);
expect(DOM.getOuterHTML(results[1].element)).toEqual('');
expect(results[1].isViewRoot).toBe(false);
@@ -33,7 +33,7 @@ export function main() {
});
it('should not wrap a root element', () => {
- var rootElement = createElement('');
+ var rootElement = el('');
var results = createPipeline().process(rootElement);
expect(results.length).toBe(1);
expect(DOM.getOuterHTML(rootElement)).toEqual('');
@@ -44,7 +44,7 @@ export function main() {
describe('elements with template attribute', () => {
it('should replace the element with an empty element', () => {
- var rootElement = createElement('
');
+ var rootElement = el('
');
var originalChild = rootElement.childNodes[0];
var results = createPipeline().process(rootElement);
expect(results[0].element).toBe(rootElement);
@@ -54,25 +54,25 @@ export function main() {
});
it('should mark the element as viewRoot', () => {
- var rootElement = createElement('');
+ var rootElement = el('');
var results = createPipeline().process(rootElement);
expect(results[2].isViewRoot).toBe(true);
});
it('should add property bindings from the template attribute', () => {
- var rootElement = createElement('');
+ var rootElement = el('');
var results = createPipeline().process(rootElement);
expect(MapWrapper.get(results[1].propertyBindings, 'prop').source).toEqual('expr');
});
it('should add variable mappings from the template attribute', () => {
- var rootElement = createElement('');
+ var rootElement = el('');
var results = createPipeline().process(rootElement);
expect(results[1].variableBindings).toEqual(MapWrapper.createFromStringMap({'varName': 'mapName'}));
});
it('should add entries without value as attribute to the element', () => {
- var rootElement = createElement('');
+ var rootElement = el('');
var results = createPipeline().process(rootElement);
expect(results[1].attrs()).toEqual(MapWrapper.createFromStringMap({'varname': ''}));
expect(results[1].propertyBindings).toBe(null);
@@ -80,7 +80,7 @@ export function main() {
});
it('should iterate properly after a template dom modification', () => {
- var rootElement = createElement('');
+ var rootElement = el('');
var results = createPipeline().process(rootElement);
// 1 root + 2 initial + 1 generated template elements
expect(results.length).toEqual(4);
@@ -89,8 +89,4 @@ export function main() {
});
});
-}
-
-function createElement(html) {
- return DOM.createTemplate(html).content.firstChild;
-}
+}
\ No newline at end of file
diff --git a/modules/core/test/compiler/selector_spec.js b/modules/core/test/compiler/selector_spec.js
index ab01ab9212..6e124ed0e8 100644
--- a/modules/core/test/compiler/selector_spec.js
+++ b/modules/core/test/compiler/selector_spec.js
@@ -1,4 +1,4 @@
-import {describe, it, expect, beforeEach, ddescribe, iit, xit} from 'test_lib/test_lib';
+import {describe, it, expect, beforeEach, ddescribe, iit, xit, el} from 'test_lib/test_lib';
import {SelectorMatcher} from 'core/compiler/selector';
import {CssSelector} from 'core/compiler/selector';
import {List, ListWrapper, MapWrapper} from 'facade/collection';
@@ -68,8 +68,8 @@ export function main() {
matcher.addSelectable(CssSelector.parse('[some-decor]'), 1);
var elementSelector = new CssSelector();
- var el = createElement('');
- var empty = el.getAttribute('attr');
+ var element = el('');
+ var empty = element.getAttribute('attr');
elementSelector.addAttribute('some-decor', empty);
matcher.match(elementSelector, selectableCollector);
expect(matched).toEqual([1]);
@@ -163,8 +163,4 @@ export function main() {
expect(cssSelector.toString()).toEqual('sometag.someclass[attrname=attrvalue]');
});
});
-}
-
-function createElement(html) {
- return DOM.createTemplate(html).content.firstChild;
}
\ No newline at end of file
diff --git a/modules/core/test/compiler/shadow_dom/content_tag_spec.js b/modules/core/test/compiler/shadow_dom/content_tag_spec.js
index 571baf1c22..004fbf9286 100644
--- a/modules/core/test/compiler/shadow_dom/content_tag_spec.js
+++ b/modules/core/test/compiler/shadow_dom/content_tag_spec.js
@@ -1,4 +1,4 @@
-import {describe, beforeEach, it, expect, ddescribe, iit, SpyObject} from 'test_lib/test_lib';
+import {describe, beforeEach, it, expect, ddescribe, iit, SpyObject, el} from 'test_lib/test_lib';
import {proxy, IMPLEMENTS} from 'facade/lang';
import {DOM} from 'facade/dom';
import {Content} from 'core/compiler/shadow_dom_emulation/content_tag';
@@ -15,41 +15,37 @@ export function main() {
describe('Content', function() {
it("should insert the nodes", () => {
var lightDom = new DummyLightDom();
- var parent = createElement("
");
+ var parent = el("
");
var content = DOM.firstChild(parent);
var c = new Content(lightDom, new NgElement(content));
- c.insert([createElement(""), createElement("")])
+ c.insert([el(""), el("")])
expect(DOM.getInnerHTML(parent)).toEqual(`${_script}${_script}`);
});
it("should remove the nodes from the previous insertion", () => {
var lightDom = new DummyLightDom();
- var parent = createElement("
");
+ var parent = el("
");
var content = DOM.firstChild(parent);
var c = new Content(lightDom, new NgElement(content));
- c.insert([createElement("")]);
- c.insert([createElement("")]);
+ c.insert([el("")]);
+ c.insert([el("")]);
expect(DOM.getInnerHTML(parent)).toEqual(`${_script}${_script}`);
});
it("should insert empty list", () => {
var lightDom = new DummyLightDom();
- var parent = createElement("
");
+ var parent = el("
");
var content = DOM.firstChild(parent);
var c = new Content(lightDom, new NgElement(content));
- c.insert([createElement("")]);
+ c.insert([el("")]);
c.insert([]);
expect(DOM.getInnerHTML(parent)).toEqual(`${_script}${_script}`);
});
});
-}
-
-function createElement(html) {
- return DOM.createTemplate(html).content.firstChild;
-}
+}
\ No newline at end of file
diff --git a/modules/core/test/compiler/shadow_dom/light_dom_spec.js b/modules/core/test/compiler/shadow_dom/light_dom_spec.js
index 0f40f8ee86..73ea4d0204 100644
--- a/modules/core/test/compiler/shadow_dom/light_dom_spec.js
+++ b/modules/core/test/compiler/shadow_dom/light_dom_spec.js
@@ -1,4 +1,4 @@
-import {describe, beforeEach, it, expect, ddescribe, iit, SpyObject} from 'test_lib/test_lib';
+import {describe, beforeEach, it, expect, ddescribe, iit, SpyObject, el} from 'test_lib/test_lib';
import {proxy, IMPLEMENTS, isBlank} from 'facade/lang';
import {ListWrapper, MapWrapper} from 'facade/collection';
import {DOM} from 'facade/dom';
@@ -119,7 +119,7 @@ export function main() {
var tag = new FakeContentTag();
var shadowDomView = new FakeView([new FakeElementInjector(tag, null)]);
- var lightDom = new LightDom(lightDomView, shadowDomView, createElement(""));
+ var lightDom = new LightDom(lightDomView, shadowDomView, el(""));
expect(lightDom.contentTags()).toEqual([tag]);
});
@@ -132,7 +132,7 @@ export function main() {
var shadowDomView = new FakeView([new FakeElementInjector(null, vp)]);
- var lightDom = new LightDom(lightDomView, shadowDomView, createElement(""));
+ var lightDom = new LightDom(lightDomView, shadowDomView, el(""));
expect(lightDom.contentTags()).toEqual([tag]);
});
@@ -140,18 +140,18 @@ export function main() {
describe("expanded roots", () => {
it("should contain root nodes", () => {
- var lightDomEl = createElement("")
+ var lightDomEl = el("")
var lightDom = new LightDom(lightDomView, new FakeView(), lightDomEl);
expect(toHtml(lightDom.expandedDomNodes())).toEqual([""]);
});
it("should include view port nodes", () => {
- var lightDomEl = createElement("")
+ var lightDomEl = el("")
var template = lightDomEl.childNodes[0];
var lightDomView = new FakeView([],
MapWrapper.createFromPairs([
- [template, new FakeViewPort([createElement("")], null)]
+ [template, new FakeViewPort([el("")], null)]
])
);
@@ -166,7 +166,7 @@ export function main() {
var contentA = new FakeContentTag("a");
var contentB = new FakeContentTag("b");
- var lightDomEl = createElement("")
+ var lightDomEl = el("")
var lightDom = new LightDom(lightDomView, new FakeView([
new FakeElementInjector(contentA, null),
@@ -183,7 +183,7 @@ export function main() {
var wildcard = new FakeContentTag(null);
var contentB = new FakeContentTag("b");
- var lightDomEl = createElement("")
+ var lightDomEl = el("")
var lightDom = new LightDom(lightDomView, new FakeView([
new FakeElementInjector(wildcard, null),
@@ -202,8 +202,4 @@ export function main() {
function toHtml(nodes) {
if (isBlank(nodes)) return [];
return ListWrapper.map(nodes, DOM.getOuterHTML);
-}
-
-function createElement(html) {
- return DOM.createTemplate(html).content.firstChild;
-}
+}
\ No newline at end of file
diff --git a/modules/core/test/compiler/view_spec.js b/modules/core/test/compiler/view_spec.js
index bea7b82d54..80cb42004b 100644
--- a/modules/core/test/compiler/view_spec.js
+++ b/modules/core/test/compiler/view_spec.js
@@ -1,4 +1,4 @@
-import {describe, xit, it, expect, beforeEach, ddescribe, iit} from 'test_lib/test_lib';
+import {describe, xit, it, expect, beforeEach, ddescribe, iit, el} from 'test_lib/test_lib';
import {ProtoView, ElementPropertyMemento, DirectivePropertyMemento} from 'core/compiler/view';
import {ProtoElementInjector, ElementInjector} from 'core/compiler/element_injector';
import {ShadowDomEmulated} from 'core/compiler/shadow_dom';
@@ -51,7 +51,7 @@ export function main() {
describe('instatiated from protoView', () => {
var view;
beforeEach(() => {
- var pv = new ProtoView(createElement(''), new ProtoRecordRange());
+ var pv = new ProtoView(el(''), new ProtoRecordRange());
view = pv.instantiate(null);
});
@@ -73,7 +73,7 @@ export function main() {
var view, viewPort, templateElement;
beforeEach(() => {
- templateElement = createElement("");
+ templateElement = el("");
view = new View(null, null, new ProtoRecordRange(), MapWrapper.create());
viewPort = new FakeViewPort(templateElement);
view.viewPorts = [viewPort];
@@ -91,7 +91,7 @@ export function main() {
describe('with locals', function() {
var view;
beforeEach(() => {
- var pv = new ProtoView(createElement(''), new ProtoRecordRange());
+ var pv = new ProtoView(el(''), new ProtoRecordRange());
pv.bindVariable('context-foo', 'template-foo');
view = createView(pv);
});
@@ -123,7 +123,7 @@ export function main() {
function createCollectDomNodesTestCases(useTemplateElement:boolean) {
function templateAwareCreateElement(html) {
- return createElement(useTemplateElement ? `${html}` : html);
+ return el(useTemplateElement ? `${html}` : html);
}
it('should collect the root node in the ProtoView element', () => {
@@ -193,7 +193,7 @@ export function main() {
describe('inplace instantiation', () => {
it('should be supported.', () => {
- var template = createElement('');
+ var template = el('');
var pv = new ProtoView(template, new ProtoRecordRange());
pv.instantiateInPlace = true;
var view = pv.instantiate(null);
@@ -202,7 +202,7 @@ export function main() {
});
it('should be off by default.', () => {
- var template = createElement('')
+ var template = el('')
var view = new ProtoView(template, new ProtoRecordRange())
.instantiate(null);
view.hydrate(null, null, null);
@@ -220,7 +220,7 @@ export function main() {
describe('create ElementInjectors', () => {
it('should use the directives of the ProtoElementInjector', () => {
- var pv = new ProtoView(createElement(''), new ProtoRecordRange());
+ var pv = new ProtoView(el(''), new ProtoRecordRange());
pv.bindElement(new ProtoElementInjector(null, 1, [SomeDirective]));
var view = pv.instantiate(null);
@@ -230,7 +230,7 @@ export function main() {
});
it('should use the correct parent', () => {
- var pv = new ProtoView(createElement('
'),
+ var pv = new ProtoView(el('
'),
new ProtoRecordRange());
var protoParent = new ProtoElementInjector(null, 0, [SomeDirective]);
pv.bindElement(protoParent);
@@ -244,7 +244,7 @@ export function main() {
});
it('should not pass the host injector when a parent injector exists', () => {
- var pv = new ProtoView(createElement('
'),
+ var pv = new ProtoView(el('
'),
new ProtoRecordRange());
var protoParent = new ProtoElementInjector(null, 0, [SomeDirective]);
pv.bindElement(protoParent);
@@ -260,7 +260,7 @@ export function main() {
});
it('should pass the host injector when there is no parent injector', () => {
- var pv = new ProtoView(createElement('
'),
+ var pv = new ProtoView(el('
'),
new ProtoRecordRange());
pv.bindElement(new ProtoElementInjector(null, 0, [SomeDirective]));
var testProtoElementInjector = new TestProtoElementInjector(null, 1, [AnotherDirective]);
@@ -277,7 +277,7 @@ export function main() {
describe('collect root element injectors', () => {
it('should collect a single root element injector', () => {
- var pv = new ProtoView(createElement('
'),
+ var pv = new ProtoView(el('
'),
new ProtoRecordRange());
var protoParent = new ProtoElementInjector(null, 0, [SomeDirective]);
pv.bindElement(protoParent);
@@ -290,7 +290,7 @@ export function main() {
});
it('should collect multiple root element injectors', () => {
- var pv = new ProtoView(createElement('
'),
+ var pv = new ProtoView(el('
'),
new ProtoRecordRange());
pv.bindElement(new ProtoElementInjector(null, 1, [SomeDirective]));
pv.bindElement(new ProtoElementInjector(null, 2, [AnotherDirective]));
@@ -308,7 +308,7 @@ export function main() {
var ctx;
function createComponentWithSubPV(subProtoView) {
- var pv = new ProtoView(createElement(''), new ProtoRecordRange());
+ var pv = new ProtoView(el(''), new ProtoRecordRange());
var binder = pv.bindElement(new ProtoElementInjector(null, 0, [SomeComponent], true));
binder.componentDirective = someComponentDirective;
binder.nestedProtoView = subProtoView;
@@ -323,7 +323,7 @@ export function main() {
}
it('should expose component services to the component', () => {
- var subpv = new ProtoView(createElement(''), new ProtoRecordRange());
+ var subpv = new ProtoView(el(''), new ProtoRecordRange());
var pv = createComponentWithSubPV(subpv);
var view = createNestedView(pv);
@@ -335,7 +335,7 @@ export function main() {
it('should expose component services and component instance to directives in the shadow Dom',
() => {
var subpv = new ProtoView(
- createElement('hello shadow dom
'), new ProtoRecordRange());
+ el('hello shadow dom
'), new ProtoRecordRange());
subpv.bindElement(
new ProtoElementInjector(null, 0, [ServiceDependentDecorator]));
var pv = createComponentWithSubPV(subpv);
@@ -358,7 +358,7 @@ export function main() {
it('dehydration should dehydrate child component views too', () => {
var subpv = new ProtoView(
- createElement('hello shadow dom
'), new ProtoRecordRange());
+ el('hello shadow dom
'), new ProtoRecordRange());
subpv.bindElement(
new ProtoElementInjector(null, 0, [ServiceDependentDecorator]));
var pv = createComponentWithSubPV(subpv);
@@ -373,7 +373,7 @@ export function main() {
});
it('should create shadow dom', () => {
- var subpv = new ProtoView(createElement('hello shadow dom'), new ProtoRecordRange());
+ var subpv = new ProtoView(el('hello shadow dom'), new ProtoRecordRange());
var pv = createComponentWithSubPV(subpv);
var view = createNestedView(pv);
@@ -382,9 +382,9 @@ export function main() {
});
it('should use the provided shadow DOM strategy', () => {
- var subpv = new ProtoView(createElement('hello shadow dom'), new ProtoRecordRange());
+ var subpv = new ProtoView(el('hello shadow dom'), new ProtoRecordRange());
- var pv = new ProtoView(createElement(''), new ProtoRecordRange());
+ var pv = new ProtoView(el(''), new ProtoRecordRange());
var binder = pv.bindElement(new ProtoElementInjector(null, 0, [SomeComponentWithEmulatedShadowDom], true));
binder.componentDirective = new DirectiveMetadataReader().read(SomeComponentWithEmulatedShadowDom);
binder.nestedProtoView = subpv;
@@ -398,8 +398,8 @@ export function main() {
describe('with template views', () => {
function createViewWithTemplate() {
var templateProtoView = new ProtoView(
- createElement(''), new ProtoRecordRange());
- var pv = new ProtoView(createElement(''), new ProtoRecordRange());
+ el(''), new ProtoRecordRange());
+ var pv = new ProtoView(el(''), new ProtoRecordRange());
var binder = pv.bindElement(new ProtoElementInjector(null, 0, [SomeTemplate]));
binder.templateDirective = someTemplateDirective;
binder.nestedProtoView = templateProtoView;
@@ -437,7 +437,7 @@ export function main() {
}
it('should fire on non-bubbling native events', () => {
- var pv = new ProtoView(createElement(''),
+ var pv = new ProtoView(el(''),
new ProtoRecordRange());
pv.bindElement(null);
pv.bindEvent('click', parser.parseBinding('callMe()', null));
@@ -463,7 +463,7 @@ export function main() {
}
it('should consume text node changes', () => {
- var pv = new ProtoView(createElement('{{}}
'),
+ var pv = new ProtoView(el('{{}}
'),
new ProtoRecordRange());
pv.bindElement(null);
pv.bindTextNode(0, parser.parseBinding('foo', null));
@@ -475,7 +475,7 @@ export function main() {
});
it('should consume element binding changes', () => {
- var pv = new ProtoView(createElement(''),
+ var pv = new ProtoView(el(''),
new ProtoRecordRange());
pv.bindElement(null);
pv.bindElementProperty(parser.parseBinding('foo', null), 'id', reflector.setter('id'));
@@ -487,7 +487,7 @@ export function main() {
});
it('should consume directive watch expression change', () => {
- var pv = new ProtoView(createElement(''),
+ var pv = new ProtoView(el(''),
new ProtoRecordRange());
pv.bindElement(new ProtoElementInjector(null, 0, [SomeDirective]));
pv.bindDirectiveProperty(0, parser.parseBinding('foo', null), 'prop', reflector.setter('prop'), false);
@@ -499,7 +499,7 @@ export function main() {
});
it('should notify a directive about changes after all its properties have been set', () => {
- var pv = new ProtoView(createElement(''),
+ var pv = new ProtoView(el(''),
new ProtoRecordRange());
pv.bindElement(new ProtoElementInjector(null, 0, [DirectiveImplementingOnChange]));
@@ -516,7 +516,7 @@ export function main() {
});
it('should provide a map of updated properties', () => {
- var pv = new ProtoView(createElement(''),
+ var pv = new ProtoView(el(''),
new ProtoRecordRange());
pv.bindElement(new ProtoElementInjector(null, 0, [DirectiveImplementingOnChange]));
@@ -539,24 +539,24 @@ export function main() {
});
describe('protoView createRootProtoView', () => {
- var el, pv;
+ var element, pv;
beforeEach(() => {
- el = DOM.createElement('div');
- pv = new ProtoView(createElement('hi
'), new ProtoRecordRange());
+ element = DOM.createElement('div');
+ pv = new ProtoView(el('hi
'), new ProtoRecordRange());
});
it('should create the root component when instantiated', () => {
- var rootProtoView = ProtoView.createRootProtoView(pv, el, someComponentDirective);
+ var rootProtoView = ProtoView.createRootProtoView(pv, element, someComponentDirective);
var view = rootProtoView.instantiate(null);
view.hydrate(new Injector([]), null, null);
expect(view.rootElementInjectors[0].get(SomeComponent)).not.toBe(null);
});
it('should inject the protoView into the shadowDom', () => {
- var rootProtoView = ProtoView.createRootProtoView(pv, el, someComponentDirective);
+ var rootProtoView = ProtoView.createRootProtoView(pv, element, someComponentDirective);
var view = rootProtoView.instantiate(null);
view.hydrate(new Injector([]), null, null);
- expect(el.shadowRoot.childNodes[0].childNodes[0].nodeValue).toEqual('hi');
+ expect(element.shadowRoot.childNodes[0].childNodes[0].nodeValue).toEqual('hi');
});
});
});
@@ -639,10 +639,6 @@ class MyEvaluationContext {
};
}
-function createElement(html) {
- return DOM.createTemplate(html).content.firstChild;
-}
-
class TestProtoElementInjector extends ProtoElementInjector {
parentElementInjector: ElementInjector;
hostElementInjector: ElementInjector;
diff --git a/modules/core/test/compiler/viewport_spec.js b/modules/core/test/compiler/viewport_spec.js
index 27b0b9ceaa..634e4c100d 100644
--- a/modules/core/test/compiler/viewport_spec.js
+++ b/modules/core/test/compiler/viewport_spec.js
@@ -1,4 +1,4 @@
-import {describe, xit, it, expect, beforeEach, ddescribe, iit} from 'test_lib/test_lib';
+import {describe, xit, it, expect, beforeEach, ddescribe, iit, el} from 'test_lib/test_lib';
import {View, ProtoView} from 'core/compiler/view';
import {ViewPort} from 'core/compiler/viewport';
import {DOM} from 'facade/dom';
@@ -7,10 +7,6 @@ import {Injector} from 'di/di';
import {ProtoElementInjector, ElementInjector} from 'core/compiler/element_injector';
import {ProtoRecordRange, Lexer, Parser} from 'change_detection/change_detection';
-function createElement(html) {
- return DOM.createTemplate(html).content.firstChild;
-}
-
function createView(nodes) {
var view = new View(null, nodes, new ProtoRecordRange(), MapWrapper.create());
view.init([], [], [], [], [], [], []);
@@ -23,14 +19,14 @@ export function main() {
customViewWithTwoNodes, elementInjector;
beforeEach(() => {
- dom = createElement(``);
+ dom = el(``);
var insertionElement = dom.childNodes[1];
parentView = createView([dom.childNodes[0]]);
- protoView = new ProtoView(createElement('hi
'), new ProtoRecordRange());
+ protoView = new ProtoView(el('hi
'), new ProtoRecordRange());
elementInjector = new ElementInjector(null, null, null);
viewPort = new ViewPort(parentView, insertionElement, protoView, elementInjector);
- customViewWithOneNode = createView([createElement('single
')]);
- customViewWithTwoNodes = createView([createElement('one
'), createElement('two
')]);
+ customViewWithOneNode = createView([el('single
')]);
+ customViewWithTwoNodes = createView([el('one
'), el('two
')]);
});
describe('when dehydrated', () => {
@@ -52,7 +48,7 @@ export function main() {
beforeEach(() => {
viewPort.hydrate(new Injector([]), null);
- var fillerView = createView([createElement('filler')]);
+ var fillerView = createView([el('filler')]);
viewPort.insert(fillerView);
});
@@ -120,7 +116,7 @@ export function main() {
var parser = new Parser(new Lexer());
viewPort.hydrate(new Injector([]), null);
- var pv = new ProtoView(createElement('{{}}
'),
+ var pv = new ProtoView(el('{{}}
'),
new ProtoRecordRange());
pv.bindElement(new ProtoElementInjector(null, 1, [SomeDirective]));
pv.bindTextNode(0, parser.parseBinding('foo', null));
diff --git a/modules/directives/test/ng_non_bindable_spec.js b/modules/directives/test/ng_non_bindable_spec.js
index 3282f75951..abff3720d6 100644
--- a/modules/directives/test/ng_non_bindable_spec.js
+++ b/modules/directives/test/ng_non_bindable_spec.js
@@ -1,4 +1,4 @@
-import {describe, xit, it, expect, beforeEach, ddescribe, iit} from 'test_lib/test_lib';
+import {describe, xit, it, expect, beforeEach, ddescribe, iit, el} from 'test_lib/test_lib';
import {DOM} from 'facade/dom';
import {Injector} from 'di/di';
import {Lexer, Parser, ChangeDetector} from 'change_detection/change_detection';
@@ -16,10 +16,6 @@ export function main() {
compiler = new Compiler(null, new DirectiveMetadataReader(), new Parser(new Lexer()), new CompilerCache());
});
- function createElement(html) {
- return DOM.createTemplate(html).content.firstChild;
- }
-
function createView(pv) {
component = new TestComponent();
view = pv.instantiate(null);
@@ -28,7 +24,7 @@ export function main() {
}
function compileWithTemplate(template) {
- return compiler.compile(TestComponent, createElement(template));
+ return compiler.compile(TestComponent, el(template));
}
it('should not interpolate children', (done) => {
diff --git a/modules/directives/test/ng_repeat_spec.js b/modules/directives/test/ng_repeat_spec.js
index 15d326d7cf..cd52cda49b 100644
--- a/modules/directives/test/ng_repeat_spec.js
+++ b/modules/directives/test/ng_repeat_spec.js
@@ -1,4 +1,4 @@
-import {describe, xit, it, expect, beforeEach, ddescribe, iit} from 'test_lib/test_lib';
+import {describe, xit, it, expect, beforeEach, ddescribe, iit, el} from 'test_lib/test_lib';
import {DOM} from 'facade/dom';
@@ -23,10 +23,6 @@ export function main() {
compiler = new Compiler(null, new DirectiveMetadataReader(), new Parser(new Lexer()), new CompilerCache());
});
- function createElement(html) {
- return DOM.createTemplate(html).content.firstChild;
- }
-
function createView(pv) {
component = new TestComponent();
view = pv.instantiate(null);
@@ -35,7 +31,7 @@ export function main() {
}
function compileWithTemplate(template) {
- return compiler.compile(TestComponent, createElement(template));
+ return compiler.compile(TestComponent, el(template));
}
var TEMPLATE = '{{item.toString()}};
';
diff --git a/modules/test_lib/src/test_lib.dart b/modules/test_lib/src/test_lib.dart
index 2f85243ec5..d04d30ed59 100644
--- a/modules/test_lib/src/test_lib.dart
+++ b/modules/test_lib/src/test_lib.dart
@@ -6,6 +6,7 @@ import 'package:unittest/unittest.dart' hide expect;
import 'dart:mirrors';
import 'dart:async';
import 'package:reflection/reflection.dart';
+import 'package:facade/dom.dart';
import 'package:reflection/reflection_capabilities.dart';
bool IS_DARTIUM = true;
@@ -67,4 +68,8 @@ _handleAsync(fn) {
}
return fn;
+}
+
+el(String html) {
+ return DOM.createTemplate(html).content.firstChild;
}
\ No newline at end of file
diff --git a/modules/test_lib/src/test_lib.es6 b/modules/test_lib/src/test_lib.es6
index 2a1b76c841..47d97281b8 100644
--- a/modules/test_lib/src/test_lib.es6
+++ b/modules/test_lib/src/test_lib.es6
@@ -1,3 +1,5 @@
+import {DOM} from 'facade/dom';
+
export var describe = window.describe;
export var xdescribe = window.xdescribe;
export var ddescribe = window.ddescribe;
@@ -127,4 +129,9 @@ function mapToString(m) {
res.push(`${k}:${v}`);
});
return `{ ${res.join(',')} }`;
+}
+
+
+export function el(html) {
+ return DOM.createTemplate(html).content.firstChild;
}
\ No newline at end of file