ember-source 2.16.1 → 2.16.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/dist/ember-runtime.js +287 -331
- data/dist/ember-template-compiler.js +2 -2
- data/dist/ember-testing.js +1 -1
- data/dist/ember-tests.js +239 -19
- data/dist/ember-tests.prod.js +240 -19
- data/dist/ember.debug.js +298 -340
- data/dist/ember.min.js +159 -171
- data/dist/ember.prod.js +311 -349
- metadata +2 -2
@@ -6,7 +6,7 @@
|
|
6
6
|
* Portions Copyright 2008-2011 Apple Inc. All rights reserved.
|
7
7
|
* @license Licensed under MIT license
|
8
8
|
* See https://raw.github.com/emberjs/ember.js/master/LICENSE
|
9
|
-
* @version 2.16.
|
9
|
+
* @version 2.16.2
|
10
10
|
*/
|
11
11
|
|
12
12
|
var enifed, requireModule, Ember;
|
@@ -17293,7 +17293,7 @@ enifed('ember/features', ['exports', 'ember-environment', 'ember-utils'], functi
|
|
17293
17293
|
enifed("ember/version", ["exports"], function (exports) {
|
17294
17294
|
"use strict";
|
17295
17295
|
|
17296
|
-
exports.default = "2.16.
|
17296
|
+
exports.default = "2.16.2";
|
17297
17297
|
});
|
17298
17298
|
enifed("handlebars", ["exports"], function (exports) {
|
17299
17299
|
"use strict";
|
data/dist/ember-testing.js
CHANGED
data/dist/ember-tests.js
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
* Portions Copyright 2008-2011 Apple Inc. All rights reserved.
|
7
7
|
* @license Licensed under MIT license
|
8
8
|
* See https://raw.github.com/emberjs/ember.js/master/LICENSE
|
9
|
-
* @version 2.16.
|
9
|
+
* @version 2.16.2
|
10
10
|
*/
|
11
11
|
|
12
12
|
var enifed, requireModule, Ember;
|
@@ -29980,13 +29980,23 @@ QUnit.test('should pass ESLint', function(assert) {
|
|
29980
29980
|
assert.ok(true, 'ember-glimmer/tests/integration/helpers/mut-test.js should pass ESLint\n\n');
|
29981
29981
|
});
|
29982
29982
|
|
29983
|
-
enifed('ember-glimmer/tests/integration/helpers/partial-test', ['ember-babel', 'ember-glimmer/tests/utils/test-case', 'ember-metal', 'ember-glimmer/tests/utils/abstract-test-case'], function (_emberBabel, _testCase, _emberMetal, _abstractTestCase) {
|
29983
|
+
enifed('ember-glimmer/tests/integration/helpers/partial-test', ['ember-babel', 'ember-glimmer/tests/utils/test-case', 'ember-metal', 'ember-runtime', 'ember-glimmer/tests/utils/abstract-test-case'], function (_emberBabel, _testCase, _emberMetal, _emberRuntime, _abstractTestCase) {
|
29984
29984
|
'use strict';
|
29985
29985
|
|
29986
|
-
var _templateObject = (0, _emberBabel.taggedTemplateLiteralLoose)(['\n {{#each model.items as |
|
29987
|
-
_templateObject2 = (0, _emberBabel.taggedTemplateLiteralLoose)(['\n {{#with
|
29988
|
-
_templateObject3 = (0, _emberBabel.taggedTemplateLiteralLoose)(['\n {{#
|
29989
|
-
_templateObject4 = (0, _emberBabel.taggedTemplateLiteralLoose)(['\n {{#
|
29986
|
+
var _templateObject = (0, _emberBabel.taggedTemplateLiteralLoose)(['\n {{#each model.items as |item|}}\n {{item}}: {{partial \'show-item\'}} |\n {{/each}}'], ['\n {{#each model.items as |item|}}\n {{item}}: {{partial \'show-item\'}} |\n {{/each}}']),
|
29987
|
+
_templateObject2 = (0, _emberBabel.taggedTemplateLiteralLoose)(['\n {{#with model as |item|}}\n {{item.name}}: {{partial \'show-id\'}}\n {{/with}}'], ['\n {{#with model as |item|}}\n {{item.name}}: {{partial \'show-id\'}}\n {{/with}}']),
|
29988
|
+
_templateObject3 = (0, _emberBabel.taggedTemplateLiteralLoose)(['\n {{#each items as |item|}}\n {{item.id}}: {{partial \'show-item\'}} |\n {{/each}}'], ['\n {{#each items as |item|}}\n {{item.id}}: {{partial \'show-item\'}} |\n {{/each}}']),
|
29989
|
+
_templateObject4 = (0, _emberBabel.taggedTemplateLiteralLoose)(['\n {{#each items as |item|}}\n {{item}}: {{partial \'show-item\'}} |\n {{/each}}'], ['\n {{#each items as |item|}}\n {{item}}: {{partial \'show-item\'}} |\n {{/each}}']),
|
29990
|
+
_templateObject5 = (0, _emberBabel.taggedTemplateLiteralLoose)(['\n [outer: {{name}}] {{partial \'inner-partial\'}}\n '], ['\n [outer: {{name}}] {{partial \'inner-partial\'}}\n ']),
|
29991
|
+
_templateObject6 = (0, _emberBabel.taggedTemplateLiteralLoose)(['\n {{#each names as |name i|}}\n {{i}}: {{partial \'outer-partial\'}}\n {{/each}}'], ['\n {{#each names as |name i|}}\n {{i}}: {{partial \'outer-partial\'}}\n {{/each}}']),
|
29992
|
+
_templateObject7 = (0, _emberBabel.taggedTemplateLiteralLoose)(['\n {{#with \'Ben\' as |person2|}}\n Hi {{person1}} (aged {{age}}) and {{person2}}. {{partial \'person3-partial\'}}\n {{/with}}\n '], ['\n {{#with \'Ben\' as |person2|}}\n Hi {{person1}} (aged {{age}}) and {{person2}}. {{partial \'person3-partial\'}}\n {{/with}}\n ']),
|
29993
|
+
_templateObject8 = (0, _emberBabel.taggedTemplateLiteralLoose)(['\n {{#with \'Alex\' as |person3|}}\n Hi {{person1}} (aged {{age}}), {{person2}} and {{person3}}. {{partial \'person4-partial\'}}\n {{/with}}\n '], ['\n {{#with \'Alex\' as |person3|}}\n Hi {{person1}} (aged {{age}}), {{person2}} and {{person3}}. {{partial \'person4-partial\'}}\n {{/with}}\n ']),
|
29994
|
+
_templateObject9 = (0, _emberBabel.taggedTemplateLiteralLoose)(['\n {{#with \'Sarah\' as |person4|}}\n Hi {{person1}} (aged {{age}}), {{person2}}, {{person3}} and {{person4}}.\n {{/with}}\n '], ['\n {{#with \'Sarah\' as |person4|}}\n Hi {{person1}} (aged {{age}}), {{person2}}, {{person3}} and {{person4}}.\n {{/with}}\n ']),
|
29995
|
+
_templateObject10 = (0, _emberBabel.taggedTemplateLiteralLoose)(['\n {{#with \'Sophie\' as |person1|}}\n Hi {{person1}} (aged {{age}}). {{partial \'person2-partial\'}}\n {{/with}}'], ['\n {{#with \'Sophie\' as |person1|}}\n Hi {{person1}} (aged {{age}}). {{partial \'person2-partial\'}}\n {{/with}}']),
|
29996
|
+
_templateObject11 = (0, _emberBabel.taggedTemplateLiteralLoose)(['\n {{#each model.items as |template i|}}\n {{model.type}}: {{partial template}}\n {{/each}}'], ['\n {{#each model.items as |template i|}}\n {{model.type}}: {{partial template}}\n {{/each}}']),
|
29997
|
+
_templateObject12 = (0, _emberBabel.taggedTemplateLiteralLoose)(['\n {{#with item.thing as |t|}}\n {{partial t}}\n {{else}}\n Nothing!\n {{/with}}'], ['\n {{#with item.thing as |t|}}\n {{partial t}}\n {{else}}\n Nothing!\n {{/with}}']),
|
29998
|
+
_templateObject13 = (0, _emberBabel.taggedTemplateLiteralLoose)(['\n {{#outer.inner as |inner|}}\n inner.name: {{inner.name}}\n {{/outer.inner}}\n '], ['\n {{#outer.inner as |inner|}}\n inner.name: {{inner.name}}\n {{/outer.inner}}\n ']),
|
29999
|
+
_templateObject14 = (0, _emberBabel.taggedTemplateLiteralLoose)(['\n {{#outer-component name=name as |outer|}}\n {{partial \'some-partial\'}}\n {{/outer-component}}'], ['\n {{#outer-component name=name as |outer|}}\n {{partial \'some-partial\'}}\n {{/outer-component}}']);
|
29990
30000
|
|
29991
30001
|
(0, _testCase.moduleFor)('Helpers test: {{partial}}', function (_RenderingTest) {
|
29992
30002
|
(0, _emberBabel.inherits)(_class, _RenderingTest);
|
@@ -30078,13 +30088,183 @@ enifed('ember-glimmer/tests/integration/helpers/partial-test', ['ember-babel', '
|
|
30078
30088
|
this.assertText('This sub-template is pretty great.');
|
30079
30089
|
};
|
30080
30090
|
|
30081
|
-
_class.prototype['@test
|
30091
|
+
_class.prototype['@test partial using data from {{#each}}'] = function testPartialUsingDataFromEach() {
|
30082
30092
|
var _this4 = this;
|
30083
30093
|
|
30094
|
+
this.registerPartial('show-item', '{{item}}');
|
30095
|
+
|
30096
|
+
this.render((0, _abstractTestCase.strip)(_templateObject), {
|
30097
|
+
model: {
|
30098
|
+
items: (0, _emberRuntime.A)(['apple', 'orange', 'banana'])
|
30099
|
+
}
|
30100
|
+
});
|
30101
|
+
|
30102
|
+
this.assertStableRerender();
|
30103
|
+
|
30104
|
+
this.assertText('apple: apple |orange: orange |banana: banana |');
|
30105
|
+
|
30106
|
+
this.runTask(function () {
|
30107
|
+
return _this4.context.model.items.pushObject('strawberry');
|
30108
|
+
});
|
30109
|
+
|
30110
|
+
this.assertText('apple: apple |orange: orange |banana: banana |strawberry: strawberry |');
|
30111
|
+
|
30112
|
+
this.runTask(function () {
|
30113
|
+
return (0, _emberMetal.set)(_this4.context, 'model', {
|
30114
|
+
items: (0, _emberRuntime.A)(['apple', 'orange', 'banana'])
|
30115
|
+
});
|
30116
|
+
});
|
30117
|
+
|
30118
|
+
this.assertText('apple: apple |orange: orange |banana: banana |');
|
30119
|
+
};
|
30120
|
+
|
30121
|
+
_class.prototype['@test partial using `{{get` on data from {{#with}}'] = function testPartialUsingGetOnDataFromWith() {
|
30122
|
+
var _this5 = this;
|
30123
|
+
|
30124
|
+
this.registerPartial('show-id', '{{get item "id"}}');
|
30125
|
+
|
30126
|
+
this.render((0, _abstractTestCase.strip)(_templateObject2), {
|
30127
|
+
model: { id: 1, name: 'foo' }
|
30128
|
+
});
|
30129
|
+
|
30130
|
+
this.assertStableRerender();
|
30131
|
+
|
30132
|
+
this.assertText('foo: 1');
|
30133
|
+
|
30134
|
+
this.runTask(function () {
|
30135
|
+
return (0, _emberMetal.set)(_this5.context, 'model.id', 2);
|
30136
|
+
});
|
30137
|
+
|
30138
|
+
this.assertText('foo: 2');
|
30139
|
+
|
30140
|
+
this.runTask(function () {
|
30141
|
+
return (0, _emberMetal.set)(_this5.context, 'model.name', 'bar');
|
30142
|
+
});
|
30143
|
+
|
30144
|
+
this.assertText('bar: 2');
|
30145
|
+
|
30146
|
+
this.runTask(function () {
|
30147
|
+
return (0, _emberMetal.set)(_this5.context, 'model', { id: 1, name: 'foo' });
|
30148
|
+
});
|
30149
|
+
|
30150
|
+
this.assertText('foo: 1');
|
30151
|
+
};
|
30152
|
+
|
30153
|
+
_class.prototype['@test partial using `{{get` on data from {{#each}}'] = function testPartialUsingGetOnDataFromEach() {
|
30154
|
+
var _this6 = this;
|
30155
|
+
|
30156
|
+
this.registerPartial('show-item', '{{get item "id"}}');
|
30157
|
+
|
30158
|
+
this.render((0, _abstractTestCase.strip)(_templateObject3), {
|
30159
|
+
items: (0, _emberRuntime.A)([{ id: 1 }, { id: 2 }, { id: 3 }])
|
30160
|
+
});
|
30161
|
+
|
30162
|
+
this.assertStableRerender();
|
30163
|
+
|
30164
|
+
this.assertText('1: 1 |2: 2 |3: 3 |');
|
30165
|
+
|
30166
|
+
this.runTask(function () {
|
30167
|
+
return _this6.context.items.pushObject({ id: 4 });
|
30168
|
+
});
|
30169
|
+
|
30170
|
+
this.assertText('1: 1 |2: 2 |3: 3 |4: 4 |');
|
30171
|
+
|
30172
|
+
this.runTask(function () {
|
30173
|
+
return (0, _emberMetal.set)(_this6.context, 'items', (0, _emberRuntime.A)([{ id: 1 }, { id: 2 }, { id: 3 }]));
|
30174
|
+
});
|
30175
|
+
|
30176
|
+
this.assertText('1: 1 |2: 2 |3: 3 |');
|
30177
|
+
};
|
30178
|
+
|
30179
|
+
_class.prototype['@test partial using conditional on data from {{#each}}'] = function testPartialUsingConditionalOnDataFromEach() {
|
30180
|
+
var _this7 = this;
|
30181
|
+
|
30182
|
+
this.registerPartial('show-item', '{{#if item}}{{item}}{{/if}}');
|
30183
|
+
|
30184
|
+
this.render((0, _abstractTestCase.strip)(_templateObject4), {
|
30185
|
+
items: (0, _emberRuntime.A)(['apple', null, 'orange', 'banana'])
|
30186
|
+
});
|
30187
|
+
|
30188
|
+
this.assertStableRerender();
|
30189
|
+
|
30190
|
+
this.assertText('apple: apple |: |orange: orange |banana: banana |');
|
30191
|
+
|
30192
|
+
this.runTask(function () {
|
30193
|
+
return _this7.context.items.pushObject('strawberry');
|
30194
|
+
});
|
30195
|
+
|
30196
|
+
this.assertText('apple: apple |: |orange: orange |banana: banana |strawberry: strawberry |');
|
30197
|
+
|
30198
|
+
this.runTask(function () {
|
30199
|
+
return (0, _emberMetal.set)(_this7.context, 'items', (0, _emberRuntime.A)(['apple', null, 'orange', 'banana']));
|
30200
|
+
});
|
30201
|
+
|
30202
|
+
this.assertText('apple: apple |: |orange: orange |banana: banana |');
|
30203
|
+
};
|
30204
|
+
|
30205
|
+
_class.prototype['@test nested partials using data from {{#each}}'] = function testNestedPartialsUsingDataFromEach() {
|
30206
|
+
var _this8 = this;
|
30207
|
+
|
30208
|
+
this.registerPartial('_outer-partial', (0, _abstractTestCase.strip)(_templateObject5));
|
30209
|
+
|
30210
|
+
this.registerPartial('inner-partial', '[inner: {{name}}]');
|
30211
|
+
|
30212
|
+
this.render((0, _abstractTestCase.strip)(_templateObject6), {
|
30213
|
+
names: (0, _emberRuntime.A)(['Alex', 'Ben'])
|
30214
|
+
});
|
30215
|
+
|
30216
|
+
this.assertStableRerender();
|
30217
|
+
|
30218
|
+
this.assertText('0: [outer: Alex] [inner: Alex]1: [outer: Ben] [inner: Ben]');
|
30219
|
+
|
30220
|
+
this.runTask(function () {
|
30221
|
+
return _this8.context.names.pushObject('Sophie');
|
30222
|
+
});
|
30223
|
+
|
30224
|
+
this.assertText('0: [outer: Alex] [inner: Alex]1: [outer: Ben] [inner: Ben]2: [outer: Sophie] [inner: Sophie]');
|
30225
|
+
|
30226
|
+
this.runTask(function () {
|
30227
|
+
return (0, _emberMetal.set)(_this8.context, 'names', (0, _emberRuntime.A)(['Alex', 'Ben']));
|
30228
|
+
});
|
30229
|
+
|
30230
|
+
this.assertText('0: [outer: Alex] [inner: Alex]1: [outer: Ben] [inner: Ben]');
|
30231
|
+
};
|
30232
|
+
|
30233
|
+
_class.prototype['@test nested partials within nested `{{#with}}` blocks'] = function testNestedPartialsWithinNestedWithBlocks() {
|
30234
|
+
var _this9 = this;
|
30235
|
+
|
30236
|
+
this.registerPartial('_person2-partial', (0, _abstractTestCase.strip)(_templateObject7));
|
30237
|
+
|
30238
|
+
this.registerPartial('_person3-partial', (0, _abstractTestCase.strip)(_templateObject8));
|
30239
|
+
|
30240
|
+
this.registerPartial('_person4-partial', (0, _abstractTestCase.strip)(_templateObject9));
|
30241
|
+
|
30242
|
+
this.render((0, _abstractTestCase.strip)(_templateObject10), { age: 0 });
|
30243
|
+
|
30244
|
+
this.assertStableRerender();
|
30245
|
+
|
30246
|
+
this.assertText('Hi Sophie (aged 0). Hi Sophie (aged 0) and Ben. Hi Sophie (aged 0), Ben and Alex. Hi Sophie (aged 0), Ben, Alex and Sarah.');
|
30247
|
+
|
30248
|
+
this.runTask(function () {
|
30249
|
+
return (0, _emberMetal.set)(_this9.context, 'age', 1);
|
30250
|
+
});
|
30251
|
+
|
30252
|
+
this.assertText('Hi Sophie (aged 1). Hi Sophie (aged 1) and Ben. Hi Sophie (aged 1), Ben and Alex. Hi Sophie (aged 1), Ben, Alex and Sarah.');
|
30253
|
+
|
30254
|
+
this.runTask(function () {
|
30255
|
+
return (0, _emberMetal.set)(_this9.context, 'age', 0);
|
30256
|
+
});
|
30257
|
+
|
30258
|
+
this.assertText('Hi Sophie (aged 0). Hi Sophie (aged 0) and Ben. Hi Sophie (aged 0), Ben and Alex. Hi Sophie (aged 0), Ben, Alex and Sarah.');
|
30259
|
+
};
|
30260
|
+
|
30261
|
+
_class.prototype['@test dynamic partials in {{#each}}'] = function testDynamicPartialsInEach() {
|
30262
|
+
var _this10 = this;
|
30263
|
+
|
30084
30264
|
this.registerPartial('_odd', 'ODD{{i}}');
|
30085
30265
|
this.registerPartial('_even', 'EVEN{{i}}');
|
30086
30266
|
|
30087
|
-
this.render((0, _abstractTestCase.strip)(
|
30267
|
+
this.render((0, _abstractTestCase.strip)(_templateObject11), {
|
30088
30268
|
model: {
|
30089
30269
|
items: ['even', 'odd', 'even', 'odd'],
|
30090
30270
|
type: 'number'
|
@@ -30096,13 +30276,13 @@ enifed('ember-glimmer/tests/integration/helpers/partial-test', ['ember-babel', '
|
|
30096
30276
|
this.assertText('number: EVEN0number: ODD1number: EVEN2number: ODD3');
|
30097
30277
|
|
30098
30278
|
this.runTask(function () {
|
30099
|
-
return (0, _emberMetal.set)(
|
30279
|
+
return (0, _emberMetal.set)(_this10.context, 'model.type', 'integer');
|
30100
30280
|
});
|
30101
30281
|
|
30102
30282
|
this.assertText('integer: EVEN0integer: ODD1integer: EVEN2integer: ODD3');
|
30103
30283
|
|
30104
30284
|
this.runTask(function () {
|
30105
|
-
return (0, _emberMetal.set)(
|
30285
|
+
return (0, _emberMetal.set)(_this10.context, 'model', {
|
30106
30286
|
items: ['even', 'odd', 'even', 'odd'],
|
30107
30287
|
type: 'number'
|
30108
30288
|
});
|
@@ -30112,11 +30292,11 @@ enifed('ember-glimmer/tests/integration/helpers/partial-test', ['ember-babel', '
|
|
30112
30292
|
};
|
30113
30293
|
|
30114
30294
|
_class.prototype['@test dynamic partials in {{#with}}'] = function testDynamicPartialsInWith() {
|
30115
|
-
var
|
30295
|
+
var _this11 = this;
|
30116
30296
|
|
30117
30297
|
this.registerPartial('_thing', '{{t}}');
|
30118
30298
|
|
30119
|
-
this.render((0, _abstractTestCase.strip)(
|
30299
|
+
this.render((0, _abstractTestCase.strip)(_templateObject12), {
|
30120
30300
|
item: { thing: false }
|
30121
30301
|
});
|
30122
30302
|
|
@@ -30125,20 +30305,20 @@ enifed('ember-glimmer/tests/integration/helpers/partial-test', ['ember-babel', '
|
|
30125
30305
|
this.assertText('Nothing!');
|
30126
30306
|
|
30127
30307
|
this.runTask(function () {
|
30128
|
-
return (0, _emberMetal.set)(
|
30308
|
+
return (0, _emberMetal.set)(_this11.context, 'item.thing', 'thing');
|
30129
30309
|
});
|
30130
30310
|
|
30131
30311
|
this.assertText('thing');
|
30132
30312
|
|
30133
30313
|
this.runTask(function () {
|
30134
|
-
return (0, _emberMetal.set)(
|
30314
|
+
return (0, _emberMetal.set)(_this11.context, 'item', { thing: false });
|
30135
30315
|
});
|
30136
30316
|
|
30137
30317
|
this.assertText('Nothing!');
|
30138
30318
|
};
|
30139
30319
|
|
30140
30320
|
_class.prototype['@test partials which contain contextual components'] = function testPartialsWhichContainContextualComponents() {
|
30141
|
-
var
|
30321
|
+
var _this12 = this;
|
30142
30322
|
|
30143
30323
|
this.registerComponent('outer-component', {
|
30144
30324
|
template: '{{yield (hash inner=(component "inner-component" name=name))}}'
|
@@ -30148,22 +30328,22 @@ enifed('ember-glimmer/tests/integration/helpers/partial-test', ['ember-babel', '
|
|
30148
30328
|
template: '{{yield (hash name=name)}}'
|
30149
30329
|
});
|
30150
30330
|
|
30151
|
-
this.registerPartial('_some-partial', (0, _abstractTestCase.strip)(
|
30331
|
+
this.registerPartial('_some-partial', (0, _abstractTestCase.strip)(_templateObject13));
|
30152
30332
|
|
30153
|
-
this.render((0, _abstractTestCase.strip)(
|
30333
|
+
this.render((0, _abstractTestCase.strip)(_templateObject14), { name: 'Sophie' });
|
30154
30334
|
|
30155
30335
|
this.assertStableRerender();
|
30156
30336
|
|
30157
30337
|
this.assertText('inner.name: Sophie');
|
30158
30338
|
|
30159
30339
|
this.runTask(function () {
|
30160
|
-
return (0, _emberMetal.set)(
|
30340
|
+
return (0, _emberMetal.set)(_this12.context, 'name', 'Ben');
|
30161
30341
|
});
|
30162
30342
|
|
30163
30343
|
this.assertText('inner.name: Ben');
|
30164
30344
|
|
30165
30345
|
this.runTask(function () {
|
30166
|
-
return (0, _emberMetal.set)(
|
30346
|
+
return (0, _emberMetal.set)(_this12.context, 'name', 'Sophie');
|
30167
30347
|
});
|
30168
30348
|
|
30169
30349
|
this.assertText('inner.name: Sophie');
|
@@ -55773,6 +55953,46 @@ enifed('ember-runtime/tests/mixins/promise_proxy_test', ['ember-metal', 'ember-r
|
|
55773
55953
|
equal((0, _emberMetal.get)(proxy, 'isFulfilled'), false, 'expects the proxy to indicate that it is not fulfilled');
|
55774
55954
|
});
|
55775
55955
|
|
55956
|
+
// https://github.com/emberjs/ember.js/issues/15694
|
55957
|
+
QUnit.test('rejection without specifying reason', function () {
|
55958
|
+
var reason = new Error('failure');
|
55959
|
+
var deferred = _rsvp2.defer();
|
55960
|
+
var proxy = ObjectPromiseProxy.create({
|
55961
|
+
promise: deferred.promise
|
55962
|
+
});
|
55963
|
+
|
55964
|
+
var didFulfillCount = 0;
|
55965
|
+
var didRejectCount = 0;
|
55966
|
+
|
55967
|
+
proxy.then(function () {
|
55968
|
+
return didFulfillCount++;
|
55969
|
+
}, function () {
|
55970
|
+
return didRejectCount++;
|
55971
|
+
});
|
55972
|
+
|
55973
|
+
equal((0, _emberMetal.get)(proxy, 'content'), undefined, 'expects the proxy to have no content');
|
55974
|
+
equal((0, _emberMetal.get)(proxy, 'reason'), undefined, 'expects the proxy to have no reason');
|
55975
|
+
equal((0, _emberMetal.get)(proxy, 'isPending'), true, 'expects the proxy to indicate that it is loading');
|
55976
|
+
equal((0, _emberMetal.get)(proxy, 'isSettled'), false, 'expects the proxy to indicate that it is not settled');
|
55977
|
+
equal((0, _emberMetal.get)(proxy, 'isRejected'), false, 'expects the proxy to indicate that it is not rejected');
|
55978
|
+
equal((0, _emberMetal.get)(proxy, 'isFulfilled'), false, 'expects the proxy to indicate that it is not fulfilled');
|
55979
|
+
|
55980
|
+
equal(didFulfillCount, 0, 'should not yet have been fulfilled');
|
55981
|
+
equal(didRejectCount, 0, 'should not yet have been rejected');
|
55982
|
+
|
55983
|
+
(0, _emberMetal.run)(deferred, 'reject');
|
55984
|
+
|
55985
|
+
equal(didFulfillCount, 0, 'should not yet have been fulfilled');
|
55986
|
+
equal(didRejectCount, 1, 'should have been rejected');
|
55987
|
+
|
55988
|
+
equal((0, _emberMetal.get)(proxy, 'content'), undefined, 'expects the proxy to have no content');
|
55989
|
+
equal((0, _emberMetal.get)(proxy, 'reason'), undefined, 'expects the proxy to have a reason');
|
55990
|
+
equal((0, _emberMetal.get)(proxy, 'isPending'), false, 'expects the proxy to indicate that it is not longer loading');
|
55991
|
+
equal((0, _emberMetal.get)(proxy, 'isSettled'), true, 'expects the proxy to indicate that it is settled');
|
55992
|
+
equal((0, _emberMetal.get)(proxy, 'isRejected'), true, 'expects the proxy to indicate that it is rejected');
|
55993
|
+
equal((0, _emberMetal.get)(proxy, 'isFulfilled'), false, 'expects the proxy to indicate that it is not fulfilled');
|
55994
|
+
});
|
55995
|
+
|
55776
55996
|
QUnit.test('unhandled rejects still propagate to RSVP.on(\'error\', ...) ', function () {
|
55777
55997
|
expect(1);
|
55778
55998
|
|
data/dist/ember-tests.prod.js
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
* Portions Copyright 2008-2011 Apple Inc. All rights reserved.
|
7
7
|
* @license Licensed under MIT license
|
8
8
|
* See https://raw.github.com/emberjs/ember.js/master/LICENSE
|
9
|
-
* @version 2.16.
|
9
|
+
* @version 2.16.2
|
10
10
|
*/
|
11
11
|
|
12
12
|
var enifed, requireModule, Ember;
|
@@ -28255,13 +28255,23 @@ enifed('ember-glimmer/tests/integration/helpers/mut-test', ['ember-babel', 'embe
|
|
28255
28255
|
return _class2;
|
28256
28256
|
}(_testCase.RenderingTest));
|
28257
28257
|
});
|
28258
|
-
enifed('ember-glimmer/tests/integration/helpers/partial-test', ['ember-babel', 'ember-glimmer/tests/utils/test-case', 'ember-metal', 'ember-glimmer/tests/utils/abstract-test-case'], function (_emberBabel, _testCase, _emberMetal, _abstractTestCase) {
|
28258
|
+
enifed('ember-glimmer/tests/integration/helpers/partial-test', ['ember-babel', 'ember-glimmer/tests/utils/test-case', 'ember-metal', 'ember-runtime', 'ember-glimmer/tests/utils/abstract-test-case'], function (_emberBabel, _testCase, _emberMetal, _emberRuntime, _abstractTestCase) {
|
28259
28259
|
'use strict';
|
28260
28260
|
|
28261
|
-
var _templateObject = (0, _emberBabel.taggedTemplateLiteralLoose)(['\n {{#each model.items as |
|
28262
|
-
_templateObject2 = (0, _emberBabel.taggedTemplateLiteralLoose)(['\n {{#with
|
28263
|
-
_templateObject3 = (0, _emberBabel.taggedTemplateLiteralLoose)(['\n {{#
|
28264
|
-
_templateObject4 = (0, _emberBabel.taggedTemplateLiteralLoose)(['\n {{#
|
28261
|
+
var _templateObject = (0, _emberBabel.taggedTemplateLiteralLoose)(['\n {{#each model.items as |item|}}\n {{item}}: {{partial \'show-item\'}} |\n {{/each}}'], ['\n {{#each model.items as |item|}}\n {{item}}: {{partial \'show-item\'}} |\n {{/each}}']),
|
28262
|
+
_templateObject2 = (0, _emberBabel.taggedTemplateLiteralLoose)(['\n {{#with model as |item|}}\n {{item.name}}: {{partial \'show-id\'}}\n {{/with}}'], ['\n {{#with model as |item|}}\n {{item.name}}: {{partial \'show-id\'}}\n {{/with}}']),
|
28263
|
+
_templateObject3 = (0, _emberBabel.taggedTemplateLiteralLoose)(['\n {{#each items as |item|}}\n {{item.id}}: {{partial \'show-item\'}} |\n {{/each}}'], ['\n {{#each items as |item|}}\n {{item.id}}: {{partial \'show-item\'}} |\n {{/each}}']),
|
28264
|
+
_templateObject4 = (0, _emberBabel.taggedTemplateLiteralLoose)(['\n {{#each items as |item|}}\n {{item}}: {{partial \'show-item\'}} |\n {{/each}}'], ['\n {{#each items as |item|}}\n {{item}}: {{partial \'show-item\'}} |\n {{/each}}']),
|
28265
|
+
_templateObject5 = (0, _emberBabel.taggedTemplateLiteralLoose)(['\n [outer: {{name}}] {{partial \'inner-partial\'}}\n '], ['\n [outer: {{name}}] {{partial \'inner-partial\'}}\n ']),
|
28266
|
+
_templateObject6 = (0, _emberBabel.taggedTemplateLiteralLoose)(['\n {{#each names as |name i|}}\n {{i}}: {{partial \'outer-partial\'}}\n {{/each}}'], ['\n {{#each names as |name i|}}\n {{i}}: {{partial \'outer-partial\'}}\n {{/each}}']),
|
28267
|
+
_templateObject7 = (0, _emberBabel.taggedTemplateLiteralLoose)(['\n {{#with \'Ben\' as |person2|}}\n Hi {{person1}} (aged {{age}}) and {{person2}}. {{partial \'person3-partial\'}}\n {{/with}}\n '], ['\n {{#with \'Ben\' as |person2|}}\n Hi {{person1}} (aged {{age}}) and {{person2}}. {{partial \'person3-partial\'}}\n {{/with}}\n ']),
|
28268
|
+
_templateObject8 = (0, _emberBabel.taggedTemplateLiteralLoose)(['\n {{#with \'Alex\' as |person3|}}\n Hi {{person1}} (aged {{age}}), {{person2}} and {{person3}}. {{partial \'person4-partial\'}}\n {{/with}}\n '], ['\n {{#with \'Alex\' as |person3|}}\n Hi {{person1}} (aged {{age}}), {{person2}} and {{person3}}. {{partial \'person4-partial\'}}\n {{/with}}\n ']),
|
28269
|
+
_templateObject9 = (0, _emberBabel.taggedTemplateLiteralLoose)(['\n {{#with \'Sarah\' as |person4|}}\n Hi {{person1}} (aged {{age}}), {{person2}}, {{person3}} and {{person4}}.\n {{/with}}\n '], ['\n {{#with \'Sarah\' as |person4|}}\n Hi {{person1}} (aged {{age}}), {{person2}}, {{person3}} and {{person4}}.\n {{/with}}\n ']),
|
28270
|
+
_templateObject10 = (0, _emberBabel.taggedTemplateLiteralLoose)(['\n {{#with \'Sophie\' as |person1|}}\n Hi {{person1}} (aged {{age}}). {{partial \'person2-partial\'}}\n {{/with}}'], ['\n {{#with \'Sophie\' as |person1|}}\n Hi {{person1}} (aged {{age}}). {{partial \'person2-partial\'}}\n {{/with}}']),
|
28271
|
+
_templateObject11 = (0, _emberBabel.taggedTemplateLiteralLoose)(['\n {{#each model.items as |template i|}}\n {{model.type}}: {{partial template}}\n {{/each}}'], ['\n {{#each model.items as |template i|}}\n {{model.type}}: {{partial template}}\n {{/each}}']),
|
28272
|
+
_templateObject12 = (0, _emberBabel.taggedTemplateLiteralLoose)(['\n {{#with item.thing as |t|}}\n {{partial t}}\n {{else}}\n Nothing!\n {{/with}}'], ['\n {{#with item.thing as |t|}}\n {{partial t}}\n {{else}}\n Nothing!\n {{/with}}']),
|
28273
|
+
_templateObject13 = (0, _emberBabel.taggedTemplateLiteralLoose)(['\n {{#outer.inner as |inner|}}\n inner.name: {{inner.name}}\n {{/outer.inner}}\n '], ['\n {{#outer.inner as |inner|}}\n inner.name: {{inner.name}}\n {{/outer.inner}}\n ']),
|
28274
|
+
_templateObject14 = (0, _emberBabel.taggedTemplateLiteralLoose)(['\n {{#outer-component name=name as |outer|}}\n {{partial \'some-partial\'}}\n {{/outer-component}}'], ['\n {{#outer-component name=name as |outer|}}\n {{partial \'some-partial\'}}\n {{/outer-component}}']);
|
28265
28275
|
|
28266
28276
|
(0, _testCase.moduleFor)('Helpers test: {{partial}}', function (_RenderingTest) {
|
28267
28277
|
(0, _emberBabel.inherits)(_class, _RenderingTest);
|
@@ -28352,13 +28362,183 @@ enifed('ember-glimmer/tests/integration/helpers/partial-test', ['ember-babel', '
|
|
28352
28362
|
this.assertText('This sub-template is pretty great.');
|
28353
28363
|
};
|
28354
28364
|
|
28355
|
-
_class.prototype['@test
|
28365
|
+
_class.prototype['@test partial using data from {{#each}}'] = function () {
|
28356
28366
|
var _this4 = this;
|
28357
28367
|
|
28368
|
+
this.registerPartial('show-item', '{{item}}');
|
28369
|
+
|
28370
|
+
this.render((0, _abstractTestCase.strip)(_templateObject), {
|
28371
|
+
model: {
|
28372
|
+
items: (0, _emberRuntime.A)(['apple', 'orange', 'banana'])
|
28373
|
+
}
|
28374
|
+
});
|
28375
|
+
|
28376
|
+
this.assertStableRerender();
|
28377
|
+
|
28378
|
+
this.assertText('apple: apple |orange: orange |banana: banana |');
|
28379
|
+
|
28380
|
+
this.runTask(function () {
|
28381
|
+
return _this4.context.model.items.pushObject('strawberry');
|
28382
|
+
});
|
28383
|
+
|
28384
|
+
this.assertText('apple: apple |orange: orange |banana: banana |strawberry: strawberry |');
|
28385
|
+
|
28386
|
+
this.runTask(function () {
|
28387
|
+
return (0, _emberMetal.set)(_this4.context, 'model', {
|
28388
|
+
items: (0, _emberRuntime.A)(['apple', 'orange', 'banana'])
|
28389
|
+
});
|
28390
|
+
});
|
28391
|
+
|
28392
|
+
this.assertText('apple: apple |orange: orange |banana: banana |');
|
28393
|
+
};
|
28394
|
+
|
28395
|
+
_class.prototype['@test partial using `{{get` on data from {{#with}}'] = function () {
|
28396
|
+
var _this5 = this;
|
28397
|
+
|
28398
|
+
this.registerPartial('show-id', '{{get item "id"}}');
|
28399
|
+
|
28400
|
+
this.render((0, _abstractTestCase.strip)(_templateObject2), {
|
28401
|
+
model: { id: 1, name: 'foo' }
|
28402
|
+
});
|
28403
|
+
|
28404
|
+
this.assertStableRerender();
|
28405
|
+
|
28406
|
+
this.assertText('foo: 1');
|
28407
|
+
|
28408
|
+
this.runTask(function () {
|
28409
|
+
return (0, _emberMetal.set)(_this5.context, 'model.id', 2);
|
28410
|
+
});
|
28411
|
+
|
28412
|
+
this.assertText('foo: 2');
|
28413
|
+
|
28414
|
+
this.runTask(function () {
|
28415
|
+
return (0, _emberMetal.set)(_this5.context, 'model.name', 'bar');
|
28416
|
+
});
|
28417
|
+
|
28418
|
+
this.assertText('bar: 2');
|
28419
|
+
|
28420
|
+
this.runTask(function () {
|
28421
|
+
return (0, _emberMetal.set)(_this5.context, 'model', { id: 1, name: 'foo' });
|
28422
|
+
});
|
28423
|
+
|
28424
|
+
this.assertText('foo: 1');
|
28425
|
+
};
|
28426
|
+
|
28427
|
+
_class.prototype['@test partial using `{{get` on data from {{#each}}'] = function () {
|
28428
|
+
var _this6 = this;
|
28429
|
+
|
28430
|
+
this.registerPartial('show-item', '{{get item "id"}}');
|
28431
|
+
|
28432
|
+
this.render((0, _abstractTestCase.strip)(_templateObject3), {
|
28433
|
+
items: (0, _emberRuntime.A)([{ id: 1 }, { id: 2 }, { id: 3 }])
|
28434
|
+
});
|
28435
|
+
|
28436
|
+
this.assertStableRerender();
|
28437
|
+
|
28438
|
+
this.assertText('1: 1 |2: 2 |3: 3 |');
|
28439
|
+
|
28440
|
+
this.runTask(function () {
|
28441
|
+
return _this6.context.items.pushObject({ id: 4 });
|
28442
|
+
});
|
28443
|
+
|
28444
|
+
this.assertText('1: 1 |2: 2 |3: 3 |4: 4 |');
|
28445
|
+
|
28446
|
+
this.runTask(function () {
|
28447
|
+
return (0, _emberMetal.set)(_this6.context, 'items', (0, _emberRuntime.A)([{ id: 1 }, { id: 2 }, { id: 3 }]));
|
28448
|
+
});
|
28449
|
+
|
28450
|
+
this.assertText('1: 1 |2: 2 |3: 3 |');
|
28451
|
+
};
|
28452
|
+
|
28453
|
+
_class.prototype['@test partial using conditional on data from {{#each}}'] = function () {
|
28454
|
+
var _this7 = this;
|
28455
|
+
|
28456
|
+
this.registerPartial('show-item', '{{#if item}}{{item}}{{/if}}');
|
28457
|
+
|
28458
|
+
this.render((0, _abstractTestCase.strip)(_templateObject4), {
|
28459
|
+
items: (0, _emberRuntime.A)(['apple', null, 'orange', 'banana'])
|
28460
|
+
});
|
28461
|
+
|
28462
|
+
this.assertStableRerender();
|
28463
|
+
|
28464
|
+
this.assertText('apple: apple |: |orange: orange |banana: banana |');
|
28465
|
+
|
28466
|
+
this.runTask(function () {
|
28467
|
+
return _this7.context.items.pushObject('strawberry');
|
28468
|
+
});
|
28469
|
+
|
28470
|
+
this.assertText('apple: apple |: |orange: orange |banana: banana |strawberry: strawberry |');
|
28471
|
+
|
28472
|
+
this.runTask(function () {
|
28473
|
+
return (0, _emberMetal.set)(_this7.context, 'items', (0, _emberRuntime.A)(['apple', null, 'orange', 'banana']));
|
28474
|
+
});
|
28475
|
+
|
28476
|
+
this.assertText('apple: apple |: |orange: orange |banana: banana |');
|
28477
|
+
};
|
28478
|
+
|
28479
|
+
_class.prototype['@test nested partials using data from {{#each}}'] = function () {
|
28480
|
+
var _this8 = this;
|
28481
|
+
|
28482
|
+
this.registerPartial('_outer-partial', (0, _abstractTestCase.strip)(_templateObject5));
|
28483
|
+
|
28484
|
+
this.registerPartial('inner-partial', '[inner: {{name}}]');
|
28485
|
+
|
28486
|
+
this.render((0, _abstractTestCase.strip)(_templateObject6), {
|
28487
|
+
names: (0, _emberRuntime.A)(['Alex', 'Ben'])
|
28488
|
+
});
|
28489
|
+
|
28490
|
+
this.assertStableRerender();
|
28491
|
+
|
28492
|
+
this.assertText('0: [outer: Alex] [inner: Alex]1: [outer: Ben] [inner: Ben]');
|
28493
|
+
|
28494
|
+
this.runTask(function () {
|
28495
|
+
return _this8.context.names.pushObject('Sophie');
|
28496
|
+
});
|
28497
|
+
|
28498
|
+
this.assertText('0: [outer: Alex] [inner: Alex]1: [outer: Ben] [inner: Ben]2: [outer: Sophie] [inner: Sophie]');
|
28499
|
+
|
28500
|
+
this.runTask(function () {
|
28501
|
+
return (0, _emberMetal.set)(_this8.context, 'names', (0, _emberRuntime.A)(['Alex', 'Ben']));
|
28502
|
+
});
|
28503
|
+
|
28504
|
+
this.assertText('0: [outer: Alex] [inner: Alex]1: [outer: Ben] [inner: Ben]');
|
28505
|
+
};
|
28506
|
+
|
28507
|
+
_class.prototype['@test nested partials within nested `{{#with}}` blocks'] = function () {
|
28508
|
+
var _this9 = this;
|
28509
|
+
|
28510
|
+
this.registerPartial('_person2-partial', (0, _abstractTestCase.strip)(_templateObject7));
|
28511
|
+
|
28512
|
+
this.registerPartial('_person3-partial', (0, _abstractTestCase.strip)(_templateObject8));
|
28513
|
+
|
28514
|
+
this.registerPartial('_person4-partial', (0, _abstractTestCase.strip)(_templateObject9));
|
28515
|
+
|
28516
|
+
this.render((0, _abstractTestCase.strip)(_templateObject10), { age: 0 });
|
28517
|
+
|
28518
|
+
this.assertStableRerender();
|
28519
|
+
|
28520
|
+
this.assertText('Hi Sophie (aged 0). Hi Sophie (aged 0) and Ben. Hi Sophie (aged 0), Ben and Alex. Hi Sophie (aged 0), Ben, Alex and Sarah.');
|
28521
|
+
|
28522
|
+
this.runTask(function () {
|
28523
|
+
return (0, _emberMetal.set)(_this9.context, 'age', 1);
|
28524
|
+
});
|
28525
|
+
|
28526
|
+
this.assertText('Hi Sophie (aged 1). Hi Sophie (aged 1) and Ben. Hi Sophie (aged 1), Ben and Alex. Hi Sophie (aged 1), Ben, Alex and Sarah.');
|
28527
|
+
|
28528
|
+
this.runTask(function () {
|
28529
|
+
return (0, _emberMetal.set)(_this9.context, 'age', 0);
|
28530
|
+
});
|
28531
|
+
|
28532
|
+
this.assertText('Hi Sophie (aged 0). Hi Sophie (aged 0) and Ben. Hi Sophie (aged 0), Ben and Alex. Hi Sophie (aged 0), Ben, Alex and Sarah.');
|
28533
|
+
};
|
28534
|
+
|
28535
|
+
_class.prototype['@test dynamic partials in {{#each}}'] = function () {
|
28536
|
+
var _this10 = this;
|
28537
|
+
|
28358
28538
|
this.registerPartial('_odd', 'ODD{{i}}');
|
28359
28539
|
this.registerPartial('_even', 'EVEN{{i}}');
|
28360
28540
|
|
28361
|
-
this.render((0, _abstractTestCase.strip)(
|
28541
|
+
this.render((0, _abstractTestCase.strip)(_templateObject11), {
|
28362
28542
|
model: {
|
28363
28543
|
items: ['even', 'odd', 'even', 'odd'],
|
28364
28544
|
type: 'number'
|
@@ -28370,13 +28550,13 @@ enifed('ember-glimmer/tests/integration/helpers/partial-test', ['ember-babel', '
|
|
28370
28550
|
this.assertText('number: EVEN0number: ODD1number: EVEN2number: ODD3');
|
28371
28551
|
|
28372
28552
|
this.runTask(function () {
|
28373
|
-
return (0, _emberMetal.set)(
|
28553
|
+
return (0, _emberMetal.set)(_this10.context, 'model.type', 'integer');
|
28374
28554
|
});
|
28375
28555
|
|
28376
28556
|
this.assertText('integer: EVEN0integer: ODD1integer: EVEN2integer: ODD3');
|
28377
28557
|
|
28378
28558
|
this.runTask(function () {
|
28379
|
-
return (0, _emberMetal.set)(
|
28559
|
+
return (0, _emberMetal.set)(_this10.context, 'model', {
|
28380
28560
|
items: ['even', 'odd', 'even', 'odd'],
|
28381
28561
|
type: 'number'
|
28382
28562
|
});
|
@@ -28386,11 +28566,11 @@ enifed('ember-glimmer/tests/integration/helpers/partial-test', ['ember-babel', '
|
|
28386
28566
|
};
|
28387
28567
|
|
28388
28568
|
_class.prototype['@test dynamic partials in {{#with}}'] = function () {
|
28389
|
-
var
|
28569
|
+
var _this11 = this;
|
28390
28570
|
|
28391
28571
|
this.registerPartial('_thing', '{{t}}');
|
28392
28572
|
|
28393
|
-
this.render((0, _abstractTestCase.strip)(
|
28573
|
+
this.render((0, _abstractTestCase.strip)(_templateObject12), {
|
28394
28574
|
item: { thing: false }
|
28395
28575
|
});
|
28396
28576
|
|
@@ -28399,20 +28579,20 @@ enifed('ember-glimmer/tests/integration/helpers/partial-test', ['ember-babel', '
|
|
28399
28579
|
this.assertText('Nothing!');
|
28400
28580
|
|
28401
28581
|
this.runTask(function () {
|
28402
|
-
return (0, _emberMetal.set)(
|
28582
|
+
return (0, _emberMetal.set)(_this11.context, 'item.thing', 'thing');
|
28403
28583
|
});
|
28404
28584
|
|
28405
28585
|
this.assertText('thing');
|
28406
28586
|
|
28407
28587
|
this.runTask(function () {
|
28408
|
-
return (0, _emberMetal.set)(
|
28588
|
+
return (0, _emberMetal.set)(_this11.context, 'item', { thing: false });
|
28409
28589
|
});
|
28410
28590
|
|
28411
28591
|
this.assertText('Nothing!');
|
28412
28592
|
};
|
28413
28593
|
|
28414
28594
|
_class.prototype['@test partials which contain contextual components'] = function () {
|
28415
|
-
var
|
28595
|
+
var _this12 = this;
|
28416
28596
|
|
28417
28597
|
this.registerComponent('outer-component', {
|
28418
28598
|
template: '{{yield (hash inner=(component "inner-component" name=name))}}'
|
@@ -28422,22 +28602,22 @@ enifed('ember-glimmer/tests/integration/helpers/partial-test', ['ember-babel', '
|
|
28422
28602
|
template: '{{yield (hash name=name)}}'
|
28423
28603
|
});
|
28424
28604
|
|
28425
|
-
this.registerPartial('_some-partial', (0, _abstractTestCase.strip)(
|
28605
|
+
this.registerPartial('_some-partial', (0, _abstractTestCase.strip)(_templateObject13));
|
28426
28606
|
|
28427
|
-
this.render((0, _abstractTestCase.strip)(
|
28607
|
+
this.render((0, _abstractTestCase.strip)(_templateObject14), { name: 'Sophie' });
|
28428
28608
|
|
28429
28609
|
this.assertStableRerender();
|
28430
28610
|
|
28431
28611
|
this.assertText('inner.name: Sophie');
|
28432
28612
|
|
28433
28613
|
this.runTask(function () {
|
28434
|
-
return (0, _emberMetal.set)(
|
28614
|
+
return (0, _emberMetal.set)(_this12.context, 'name', 'Ben');
|
28435
28615
|
});
|
28436
28616
|
|
28437
28617
|
this.assertText('inner.name: Ben');
|
28438
28618
|
|
28439
28619
|
this.runTask(function () {
|
28440
|
-
return (0, _emberMetal.set)(
|
28620
|
+
return (0, _emberMetal.set)(_this12.context, 'name', 'Sophie');
|
28441
28621
|
});
|
28442
28622
|
|
28443
28623
|
this.assertText('inner.name: Sophie');
|
@@ -52172,6 +52352,47 @@ enifed('ember-runtime/tests/mixins/promise_proxy_test', ['ember-metal', 'ember-r
|
|
52172
52352
|
equal((0, _emberMetal.get)(proxy, 'isFulfilled'), false, 'expects the proxy to indicate that it is not fulfilled');
|
52173
52353
|
});
|
52174
52354
|
|
52355
|
+
// https://github.com/emberjs/ember.js/issues/15694
|
52356
|
+
QUnit.test('rejection without specifying reason', function () {
|
52357
|
+
new Error('failure');
|
52358
|
+
|
52359
|
+
var deferred = _rsvp2.defer();
|
52360
|
+
var proxy = ObjectPromiseProxy.create({
|
52361
|
+
promise: deferred.promise
|
52362
|
+
});
|
52363
|
+
|
52364
|
+
var didFulfillCount = 0;
|
52365
|
+
var didRejectCount = 0;
|
52366
|
+
|
52367
|
+
proxy.then(function () {
|
52368
|
+
return didFulfillCount++;
|
52369
|
+
}, function () {
|
52370
|
+
return didRejectCount++;
|
52371
|
+
});
|
52372
|
+
|
52373
|
+
equal((0, _emberMetal.get)(proxy, 'content'), undefined, 'expects the proxy to have no content');
|
52374
|
+
equal((0, _emberMetal.get)(proxy, 'reason'), undefined, 'expects the proxy to have no reason');
|
52375
|
+
equal((0, _emberMetal.get)(proxy, 'isPending'), true, 'expects the proxy to indicate that it is loading');
|
52376
|
+
equal((0, _emberMetal.get)(proxy, 'isSettled'), false, 'expects the proxy to indicate that it is not settled');
|
52377
|
+
equal((0, _emberMetal.get)(proxy, 'isRejected'), false, 'expects the proxy to indicate that it is not rejected');
|
52378
|
+
equal((0, _emberMetal.get)(proxy, 'isFulfilled'), false, 'expects the proxy to indicate that it is not fulfilled');
|
52379
|
+
|
52380
|
+
equal(didFulfillCount, 0, 'should not yet have been fulfilled');
|
52381
|
+
equal(didRejectCount, 0, 'should not yet have been rejected');
|
52382
|
+
|
52383
|
+
(0, _emberMetal.run)(deferred, 'reject');
|
52384
|
+
|
52385
|
+
equal(didFulfillCount, 0, 'should not yet have been fulfilled');
|
52386
|
+
equal(didRejectCount, 1, 'should have been rejected');
|
52387
|
+
|
52388
|
+
equal((0, _emberMetal.get)(proxy, 'content'), undefined, 'expects the proxy to have no content');
|
52389
|
+
equal((0, _emberMetal.get)(proxy, 'reason'), undefined, 'expects the proxy to have a reason');
|
52390
|
+
equal((0, _emberMetal.get)(proxy, 'isPending'), false, 'expects the proxy to indicate that it is not longer loading');
|
52391
|
+
equal((0, _emberMetal.get)(proxy, 'isSettled'), true, 'expects the proxy to indicate that it is settled');
|
52392
|
+
equal((0, _emberMetal.get)(proxy, 'isRejected'), true, 'expects the proxy to indicate that it is rejected');
|
52393
|
+
equal((0, _emberMetal.get)(proxy, 'isFulfilled'), false, 'expects the proxy to indicate that it is not fulfilled');
|
52394
|
+
});
|
52395
|
+
|
52175
52396
|
QUnit.test('unhandled rejects still propagate to RSVP.on(\'error\', ...) ', function () {
|
52176
52397
|
expect(1);
|
52177
52398
|
|