import { afterEach, AsyncTestCompleter, beforeEach, ddescribe, describe, dispatchEvent, el, expect, iit, inject, it, queryView, xit } from 'angular2/test_lib'; import {DOM} from 'angular2/src/dom/dom_adapter'; import {Lexer, Parser, ChangeDetector, dynamicChangeDetection} from 'angular2/change_detection'; import {Compiler, CompilerCache} from 'angular2/src/core/compiler/compiler'; import {DirectiveMetadataReader} from 'angular2/src/core/compiler/directive_metadata_reader'; import {NativeShadowDomStrategy} from 'angular2/src/core/compiler/shadow_dom_strategy'; import {TemplateLoader} from 'angular2/src/core/compiler/template_loader'; import {ComponentUrlMapper} from 'angular2/src/core/compiler/component_url_mapper'; import {UrlResolver} from 'angular2/src/core/compiler/url_resolver'; import {StyleUrlResolver} from 'angular2/src/core/compiler/style_url_resolver'; import {CssProcessor} from 'angular2/src/core/compiler/css_processor'; import {EventManager, DomEventsPlugin} from 'angular2/src/core/events/event_manager'; import {VmTurnZone} from 'angular2/src/core/zone/vm_turn_zone'; import {MockTemplateResolver} from 'angular2/src/mock/template_resolver_mock'; import {Injector} from 'angular2/di'; import {Component, Decorator, Template, PropertySetter} from 'angular2/angular2'; import {ControlGroupDirective, ControlDirective, Control, ControlGroup, OptionalControl, ControlValueAccessor, RequiredValidatorDirective, CheckboxControlValueAccessor, DefaultValueAccessor, Validators} from 'angular2/forms'; export function main() { function detectChanges(view) { view.changeDetector.detectChanges(); } function compile(componentType, template, context, callback) { var tplResolver = new MockTemplateResolver(); var urlResolver = new UrlResolver(); var compiler = new Compiler(dynamicChangeDetection, new TemplateLoader(null, null), new DirectiveMetadataReader(), new Parser(new Lexer()), new CompilerCache(), new NativeShadowDomStrategy(new StyleUrlResolver(urlResolver)), tplResolver, new ComponentUrlMapper(), urlResolver, new CssProcessor(null) ); tplResolver.setTemplate(componentType, new Template({ inline: template, directives: [ControlGroupDirective, ControlDirective, WrappedValue, RequiredValidatorDirective, CheckboxControlValueAccessor, DefaultValueAccessor] })); compiler.compile(componentType).then((pv) => { var eventManager = new EventManager([new DomEventsPlugin()], new FakeVmTurnZone()); var view = pv.instantiate(null, eventManager); view.hydrate(new Injector([]), null, null, context, null); detectChanges(view); callback(view); }); } if (DOM.supportsDOMEvents()) { describe("integration tests", () => { it("should initialize DOM elements with the given form object", inject([AsyncTestCompleter], (async) => { var ctx = new MyComp(new ControlGroup({ "login": new Control("loginValue") })); var t = `