var __extends = (this && this.__extends) || function (d, b) {
    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
    function __() { this.constructor = d; }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
define(["require", "exports", "react", "react-dom", "./Layer", "./LayerHost"], function (require, exports, React, ReactDOM, Layer_1, LayerHost_1) {
    "use strict";
    var expect = chai.expect;
    describe('Layer', function () {
        it('can render in a targeted LayerHost and pass context through', function () {
            var Child = (function (_super) {
                __extends(Child, _super);
                function Child() {
                    return _super.apply(this, arguments) || this;
                }
                Child.prototype.render = function () {
                    return (React.createElement("div", { id: 'child' }, this.context.foo));
                };
                return Child;
            }(React.Component));
            Child.contextTypes = {
                foo: React.PropTypes.string.isRequired
            };
            var Parent = (function (_super) {
                __extends(Parent, _super);
                function Parent() {
                    return _super.apply(this, arguments) || this;
                }
                Parent.prototype.getChildContext = function () {
                    return {
                        foo: 'foo'
                    };
                };
                Parent.prototype.render = function () {
                    return (React.createElement("div", { id: 'parent' },
                        React.createElement(Layer_1.Layer, { hostId: 'foo' },
                            React.createElement(Child, null))));
                };
                return Parent;
            }(React.Component));
            Parent.childContextTypes = {
                foo: React.PropTypes.string
            };
            var App = (function (_super) {
                __extends(App, _super);
                function App() {
                    return _super.apply(this, arguments) || this;
                }
                App.prototype.render = function () {
                    return (React.createElement("div", { id: 'app' },
                        React.createElement(Parent, null),
                        React.createElement(LayerHost_1.LayerHost, { id: 'foo' })));
                };
                return App;
            }(React.Component));
            var appElement = document.createElement('div');
            try {
                document.body.appendChild(appElement);
                ReactDOM.render(React.createElement(App, null), appElement);
                var parentElement = appElement.querySelector('#parent');
                expect(parentElement).is.not.empty;
                expect(parentElement.ownerDocument).is.not.empty;
                var childElement = appElement.querySelector('#child');
                expect(childElement.textContent).equals('foo');
            }
            finally {
                ReactDOM.unmountComponentAtNode(appElement);
                appElement.remove();
            }
        });
    });
});

//# sourceMappingURL=Layer.test.js.map
