forked from emberjs/ember.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
So ArrayProxy inside ObjectProxy works with ES5 getters Fixes emberjs#16878
- Loading branch information
Showing
2 changed files
with
17 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,27 @@ | ||
import { isEmpty } from 'ember-metal'; | ||
import ArrayProxy from '../../lib/system/array_proxy'; | ||
import ObjectProxy from '../../lib/system/object_proxy'; | ||
import { A as emberA } from '../../lib/mixins/array'; | ||
import { moduleFor, AbstractTestCase } from 'internal-test-helpers'; | ||
|
||
moduleFor( | ||
'Ember.isEmpty', | ||
class extends AbstractTestCase { | ||
['@test Ember.isEmpty'](assert) { | ||
['@test Ember.isEmpty ArrayProxy'](assert) { | ||
let arrayProxy = ArrayProxy.create({ content: emberA() }); | ||
|
||
assert.equal(true, isEmpty(arrayProxy), 'for an ArrayProxy that has empty content'); | ||
} | ||
|
||
['@test Ember.isEmpty ObjectProxy ArrayProxy'](assert) { | ||
let arrayProxy = ArrayProxy.create({ content: emberA([]) }); | ||
let objectProxy = ObjectProxy.create({ content: arrayProxy }); | ||
|
||
assert.equal( | ||
true, | ||
isEmpty(objectProxy), | ||
'for an ArrayProxy inside ObjectProxy that has empty content' | ||
); | ||
} | ||
} | ||
); |