diff --git a/packages/ember-htmlbars/lib/templates/container-view.hbs b/packages/ember-htmlbars/lib/templates/container-view.hbs deleted file mode 100644 index 40419ec7485..00000000000 --- a/packages/ember-htmlbars/lib/templates/container-view.hbs +++ /dev/null @@ -1 +0,0 @@ -{{#each view.childViews key='elementId' as |childView|}}{{view childView}}{{else if view._emptyView}}{{view view._emptyView _defaultTagName=view._emptyViewTagName}}{{/each}} \ No newline at end of file diff --git a/packages/ember-views/tests/system/event_dispatcher_test.js b/packages/ember-views/tests/system/event_dispatcher_test.js index 1ead71336b1..314e5bfad68 100644 --- a/packages/ember-views/tests/system/event_dispatcher_test.js +++ b/packages/ember-views/tests/system/event_dispatcher_test.js @@ -156,9 +156,10 @@ QUnit.test('should send change events up view hierarchy if view contains form el }); QUnit.test('events should stop propagating if the view is destroyed', function() { - var parentViewReceived, receivedEvent; + var parentComponentReceived, receivedEvent; owner.register('component:x-foo', Component.extend({ + layout: compile(''), change(evt) { receivedEvent = true; run(() => { @@ -167,25 +168,21 @@ QUnit.test('events should stop propagating if the view is destroyed', function() } })); - owner.register('template:components/x-foo', compile(' runDestroy(v)); + runDestroy(view); resetKeyword('view', originalViewKeyword); } }); @@ -63,21 +74,18 @@ QUnit.module('View#removeFromParent', { } }); -import isEnabled from 'ember-metal/features'; -if (!isEnabled('ember-glimmer')) { - // jscs:disable - QUnit.test('removes view from parent view', function() { - expectDeprecation('Setting `childViews` on a Container is deprecated.'); + parentView = View.extend({ + template: compile('{{view view.childView}}'), + childView: View.extend({ + template: compile('child view template') + }) + }).create(); + run(parentView, parentView.append); - parentView = ContainerView.create({ childViews: [View] }); child = objectAt(get(parentView, 'childViews'), 0); ok(get(child, 'parentView'), 'precond - has parentView'); - run(function() { - parentView.createElement(); - }); - ok(parentView.$('div').length, 'precond - has a child DOM element'); run(function() { @@ -89,16 +97,18 @@ QUnit.test('removes view from parent view', function() { equal(parentView.$('div').length, 0, 'removes DOM element from parent'); }); -} - QUnit.test('returns receiver', function() { - expectDeprecation('Setting `childViews` on a Container is deprecated.'); - - parentView = ContainerView.create({ childViews: [View] }); + parentView = View.extend({ + template: compile('{{view view.childView}}'), + childView: View.extend({ + template: compile('child view template') + }) + }).create(); + + run(parentView, parentView.append); child = objectAt(get(parentView, 'childViews'), 0); - var removed = run(function() { - return child.removeFromParent(); - }); + + let removed = run(() => child.removeFromParent()); equal(removed, child, 'receiver'); }); @@ -116,7 +126,6 @@ QUnit.test('does nothing if not in parentView', function() { }); }); - QUnit.test('the DOM element is gone after doing append and remove in two separate runloops', function() { view = View.create(); run(function() { @@ -140,3 +149,5 @@ QUnit.test('the DOM element is gone after doing append and remove in a single ru var viewElem = jQuery('#' + get(view, 'elementId')); ok(viewElem.length === 0, 'view\'s element doesn\'t exist in DOM'); }); + +} diff --git a/packages/ember-views/tests/views/view/replace_in_test.js b/packages/ember-views/tests/views/view/replace_in_test.js index 0fef535911c..4d8764a6dbd 100644 --- a/packages/ember-views/tests/views/view/replace_in_test.js +++ b/packages/ember-views/tests/views/view/replace_in_test.js @@ -2,7 +2,7 @@ import { get } from 'ember-metal/property_get'; import run from 'ember-metal/run_loop'; import jQuery from 'ember-views/system/jquery'; import EmberView from 'ember-views/views/view'; -import ContainerView from 'ember-views/views/container_view'; +import compile from 'ember-template-compiler/system/compile'; import { registerKeyword, resetKeyword } from 'ember-htmlbars/tests/utils'; import viewKeyword from 'ember-htmlbars/keywords/view'; @@ -91,11 +91,10 @@ if (!isEnabled('ember-glimmer')) { QUnit.module('EmberView - replaceIn() in a view hierarchy', { setup() { originalViewKeyword = registerKeyword('view', viewKeyword); - expectDeprecation('Setting `childViews` on a Container is deprecated.'); - View = ContainerView.extend({ - childViews: ['child'], - child: EmberView.extend({ + View = EmberView.extend({ + template: compile('{{view view.childView}}'), + childView: EmberView.extend({ elementId: 'child' }) });