ember-source 2.9.0.alpha.2 → 2.9.0.beta.1
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 +4027 -4378
- data/dist/ember-template-compiler.js +6168 -5625
- data/dist/ember-testing.js +415 -299
- data/dist/ember-tests.js +80794 -0
- data/dist/ember-tests.prod.js +80729 -0
- data/dist/ember.debug.js +13295 -13237
- data/dist/ember.js +13295 -13237
- data/dist/ember.min.js +16 -17
- data/dist/ember.prod.js +12616 -12774
- metadata +5 -4
data/dist/ember-testing.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
|
9
|
+
* @version 2.9.0-beta.1
|
10
10
|
*/
|
11
11
|
|
12
12
|
var enifed, requireModule, require, Ember;
|
@@ -112,12 +112,85 @@ var mainContext = this;
|
|
112
112
|
}
|
113
113
|
})();
|
114
114
|
|
115
|
-
|
115
|
+
var babelHelpers;
|
116
|
+
|
117
|
+
function classCallCheck(instance, Constructor) {
|
118
|
+
if (!(instance instanceof Constructor)) {
|
119
|
+
throw new TypeError('Cannot call a class as a function');
|
120
|
+
}
|
121
|
+
}
|
122
|
+
|
123
|
+
function inherits(subClass, superClass) {
|
124
|
+
if (typeof superClass !== 'function' && superClass !== null) {
|
125
|
+
throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass);
|
126
|
+
}
|
127
|
+
|
128
|
+
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
129
|
+
constructor: {
|
130
|
+
value: subClass,
|
131
|
+
enumerable: false,
|
132
|
+
writable: true,
|
133
|
+
configurable: true
|
134
|
+
}
|
135
|
+
});
|
136
|
+
|
137
|
+
if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : defaults(subClass, superClass);
|
138
|
+
}
|
139
|
+
|
140
|
+
function taggedTemplateLiteralLoose(strings, raw) {
|
141
|
+
strings.raw = raw;
|
142
|
+
return strings;
|
143
|
+
}
|
144
|
+
|
145
|
+
function defineProperties(target, props) {
|
146
|
+
for (var i = 0; i < props.length; i++) {
|
147
|
+
var descriptor = props[i];
|
148
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
149
|
+
descriptor.configurable = true;
|
150
|
+
if ('value' in descriptor) descriptor.writable = true;
|
151
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
152
|
+
}
|
153
|
+
}
|
154
|
+
|
155
|
+
function createClass(Constructor, protoProps, staticProps) {
|
156
|
+
if (protoProps) defineProperties(Constructor.prototype, protoProps);
|
157
|
+
if (staticProps) defineProperties(Constructor, staticProps);
|
158
|
+
return Constructor;
|
159
|
+
}
|
160
|
+
|
161
|
+
function interopExportWildcard(obj, defaults) {
|
162
|
+
var newObj = defaults({}, obj);
|
163
|
+
delete newObj['default'];
|
164
|
+
return newObj;
|
165
|
+
}
|
166
|
+
|
167
|
+
function defaults(obj, defaults) {
|
168
|
+
var keys = Object.getOwnPropertyNames(defaults);
|
169
|
+
for (var i = 0; i < keys.length; i++) {
|
170
|
+
var key = keys[i];
|
171
|
+
var value = Object.getOwnPropertyDescriptor(defaults, key);
|
172
|
+
if (value && value.configurable && obj[key] === undefined) {
|
173
|
+
Object.defineProperty(obj, key, value);
|
174
|
+
}
|
175
|
+
}
|
176
|
+
return obj;
|
177
|
+
}
|
178
|
+
|
179
|
+
babelHelpers = {
|
180
|
+
classCallCheck: classCallCheck,
|
181
|
+
inherits: inherits,
|
182
|
+
taggedTemplateLiteralLoose: taggedTemplateLiteralLoose,
|
183
|
+
slice: Array.prototype.slice,
|
184
|
+
createClass: createClass,
|
185
|
+
interopExportWildcard: interopExportWildcard,
|
186
|
+
defaults: defaults
|
187
|
+
};
|
188
|
+
|
189
|
+
enifed('ember-debug/deprecate', ['exports', 'ember-metal', 'ember-console', 'ember-environment', 'ember-debug/handlers'], function (exports, _emberMetal, _emberConsole, _emberEnvironment, _emberDebugHandlers) {
|
116
190
|
/*global __fail__*/
|
117
191
|
|
118
192
|
'use strict';
|
119
193
|
|
120
|
-
var _slice = Array.prototype.slice;
|
121
194
|
exports.registerHandler = registerHandler;
|
122
195
|
exports.default = deprecate;
|
123
196
|
|
@@ -192,7 +265,7 @@ enifed('ember-debug/deprecate', ['exports', 'ember-metal/error', 'ember-console'
|
|
192
265
|
if (_emberEnvironment.ENV.RAISE_ON_DEPRECATION) {
|
193
266
|
var updatedMessage = formatMessage(message);
|
194
267
|
|
195
|
-
throw new
|
268
|
+
throw new _emberMetal.Error(updatedMessage);
|
196
269
|
} else {
|
197
270
|
next.apply(undefined, arguments);
|
198
271
|
}
|
@@ -219,13 +292,16 @@ enifed('ember-debug/deprecate', ['exports', 'ember-metal/error', 'ember-console'
|
|
219
292
|
|
220
293
|
@method deprecate
|
221
294
|
@param {String} message A description of the deprecation.
|
222
|
-
@param {Boolean} test A boolean. If falsy, the deprecation
|
223
|
-
|
224
|
-
@param {
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
295
|
+
@param {Boolean} test A boolean. If falsy, the deprecation will be displayed.
|
296
|
+
@param {Object} options
|
297
|
+
@param {String} options.id A unique id for this deprecation. The id can be
|
298
|
+
used by Ember debugging tools to change the behavior (raise, log or silence)
|
299
|
+
for that specific deprecation. The id should be namespaced by dots, e.g.
|
300
|
+
"view.helper.select".
|
301
|
+
@param {string} options.until The version of Ember when this deprecation
|
302
|
+
warning will be removed.
|
303
|
+
@param {String} [options.url] An optional url to the transition guide on the
|
304
|
+
emberjs.com website.
|
229
305
|
@for Ember
|
230
306
|
@public
|
231
307
|
*/
|
@@ -255,7 +331,7 @@ enifed('ember-debug/deprecate', ['exports', 'ember-metal/error', 'ember-console'
|
|
255
331
|
});
|
256
332
|
}
|
257
333
|
|
258
|
-
_emberDebugHandlers.invoke.apply(undefined, ['deprecate'].concat(
|
334
|
+
_emberDebugHandlers.invoke.apply(undefined, ['deprecate'].concat(babelHelpers.slice.call(arguments)));
|
259
335
|
}
|
260
336
|
});
|
261
337
|
enifed("ember-debug/handlers", ["exports"], function (exports) {
|
@@ -291,7 +367,7 @@ enifed("ember-debug/handlers", ["exports"], function (exports) {
|
|
291
367
|
}
|
292
368
|
}
|
293
369
|
});
|
294
|
-
enifed('ember-debug/index', ['exports', 'ember-metal
|
370
|
+
enifed('ember-debug/index', ['exports', 'ember-metal', 'ember-environment', 'ember-console', 'ember-debug/deprecate', 'ember-debug/warn'], function (exports, _emberMetal, _emberEnvironment, _emberConsole, _emberDebugDeprecate, _emberDebugWarn) {
|
295
371
|
'use strict';
|
296
372
|
|
297
373
|
exports._warnIfUsingStrippedFeatureFlags = _warnIfUsingStrippedFeatureFlags;
|
@@ -327,9 +403,9 @@ enifed('ember-debug/index', ['exports', 'ember-metal/core', 'ember-environment',
|
|
327
403
|
falsy, an exception will be thrown.
|
328
404
|
@public
|
329
405
|
*/
|
330
|
-
|
406
|
+
_emberMetal.setDebugFunction('assert', function assert(desc, test) {
|
331
407
|
if (!test) {
|
332
|
-
throw new
|
408
|
+
throw new _emberMetal.Error('Assertion Failed: ' + desc);
|
333
409
|
}
|
334
410
|
});
|
335
411
|
|
@@ -347,7 +423,7 @@ enifed('ember-debug/index', ['exports', 'ember-metal/core', 'ember-environment',
|
|
347
423
|
@param {String} message A debug message to display.
|
348
424
|
@public
|
349
425
|
*/
|
350
|
-
|
426
|
+
_emberMetal.setDebugFunction('debug', function debug(message) {
|
351
427
|
_emberConsole.default.debug('DEBUG: ' + message);
|
352
428
|
});
|
353
429
|
|
@@ -360,7 +436,7 @@ enifed('ember-debug/index', ['exports', 'ember-metal/core', 'ember-environment',
|
|
360
436
|
@method info
|
361
437
|
@private
|
362
438
|
*/
|
363
|
-
|
439
|
+
_emberMetal.setDebugFunction('info', function info() {
|
364
440
|
_emberConsole.default.info.apply(undefined, arguments);
|
365
441
|
});
|
366
442
|
|
@@ -383,7 +459,7 @@ enifed('ember-debug/index', ['exports', 'ember-metal/core', 'ember-environment',
|
|
383
459
|
@return {Function} A new function that wraps the original function with a deprecation warning
|
384
460
|
@private
|
385
461
|
*/
|
386
|
-
|
462
|
+
_emberMetal.setDebugFunction('deprecateFunc', function deprecateFunc() {
|
387
463
|
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
388
464
|
args[_key] = arguments[_key];
|
389
465
|
}
|
@@ -396,7 +472,7 @@ enifed('ember-debug/index', ['exports', 'ember-metal/core', 'ember-environment',
|
|
396
472
|
|
397
473
|
return {
|
398
474
|
v: function () {
|
399
|
-
|
475
|
+
_emberMetal.deprecate(message, false, options);
|
400
476
|
return func.apply(this, arguments);
|
401
477
|
}
|
402
478
|
};
|
@@ -410,7 +486,7 @@ enifed('ember-debug/index', ['exports', 'ember-metal/core', 'ember-environment',
|
|
410
486
|
|
411
487
|
return {
|
412
488
|
v: function () {
|
413
|
-
|
489
|
+
_emberMetal.deprecate(message);
|
414
490
|
return func.apply(this, arguments);
|
415
491
|
}
|
416
492
|
};
|
@@ -441,17 +517,17 @@ enifed('ember-debug/index', ['exports', 'ember-metal/core', 'ember-environment',
|
|
441
517
|
@since 1.5.0
|
442
518
|
@public
|
443
519
|
*/
|
444
|
-
|
520
|
+
_emberMetal.setDebugFunction('runInDebug', function runInDebug(func) {
|
445
521
|
func();
|
446
522
|
});
|
447
523
|
|
448
|
-
|
524
|
+
_emberMetal.setDebugFunction('debugSeal', function debugSeal(obj) {
|
449
525
|
Object.seal(obj);
|
450
526
|
});
|
451
527
|
|
452
|
-
|
528
|
+
_emberMetal.setDebugFunction('deprecate', _emberDebugDeprecate.default);
|
453
529
|
|
454
|
-
|
530
|
+
_emberMetal.setDebugFunction('warn', _emberDebugWarn.default);
|
455
531
|
|
456
532
|
/**
|
457
533
|
Will call `Ember.warn()` if ENABLE_OPTIONAL_FEATURES or
|
@@ -466,7 +542,7 @@ enifed('ember-debug/index', ['exports', 'ember-metal/core', 'ember-environment',
|
|
466
542
|
|
467
543
|
function _warnIfUsingStrippedFeatureFlags(FEATURES, knownFeatures, featuresWereStripped) {
|
468
544
|
if (featuresWereStripped) {
|
469
|
-
|
545
|
+
_emberMetal.warn('Ember.ENV.ENABLE_OPTIONAL_FEATURES is only available in canary builds.', !_emberEnvironment.ENV.ENABLE_OPTIONAL_FEATURES, { id: 'ember-debug.feature-flag-with-features-stripped' });
|
470
546
|
|
471
547
|
var keys = Object.keys(FEATURES || {});
|
472
548
|
for (var i = 0; i < keys.length; i++) {
|
@@ -475,23 +551,23 @@ enifed('ember-debug/index', ['exports', 'ember-metal/core', 'ember-environment',
|
|
475
551
|
continue;
|
476
552
|
}
|
477
553
|
|
478
|
-
|
554
|
+
_emberMetal.warn('FEATURE["' + key + '"] is set as enabled, but FEATURE flags are only available in canary builds.', !FEATURES[key], { id: 'ember-debug.feature-flag-with-features-stripped' });
|
479
555
|
}
|
480
556
|
}
|
481
557
|
}
|
482
558
|
|
483
|
-
if (!
|
559
|
+
if (!_emberMetal.isTesting()) {
|
484
560
|
(function () {
|
485
561
|
// Complain if they're using FEATURE flags in builds other than canary
|
486
|
-
|
562
|
+
_emberMetal.FEATURES['features-stripped-test'] = true;
|
487
563
|
var featuresWereStripped = true;
|
488
564
|
|
489
|
-
if (
|
565
|
+
if (_emberMetal.isFeatureEnabled('features-stripped-test')) {
|
490
566
|
featuresWereStripped = false;
|
491
567
|
}
|
492
568
|
|
493
|
-
delete
|
494
|
-
_warnIfUsingStrippedFeatureFlags(_emberEnvironment.ENV.FEATURES,
|
569
|
+
delete _emberMetal.FEATURES['features-stripped-test'];
|
570
|
+
_warnIfUsingStrippedFeatureFlags(_emberEnvironment.ENV.FEATURES, _emberMetal.DEFAULT_FEATURES, featuresWereStripped);
|
495
571
|
|
496
572
|
// Inform the developer about the Ember Inspector if not installed.
|
497
573
|
var isFirefox = _emberEnvironment.environment.isFirefox;
|
@@ -508,7 +584,7 @@ enifed('ember-debug/index', ['exports', 'ember-metal/core', 'ember-environment',
|
|
508
584
|
downloadURL = 'https://addons.mozilla.org/en-US/firefox/addon/ember-inspector/';
|
509
585
|
}
|
510
586
|
|
511
|
-
|
587
|
+
_emberMetal.debug('For more advanced debugging, install the Ember Inspector from ' + downloadURL);
|
512
588
|
}
|
513
589
|
}, false);
|
514
590
|
}
|
@@ -518,7 +594,7 @@ enifed('ember-debug/index', ['exports', 'ember-metal/core', 'ember-environment',
|
|
518
594
|
@public
|
519
595
|
@class Ember.Debug
|
520
596
|
*/
|
521
|
-
|
597
|
+
_emberMetal.default.Debug = {};
|
522
598
|
|
523
599
|
/**
|
524
600
|
Allows for runtime registration of handler functions that override the default deprecation behavior.
|
@@ -555,7 +631,7 @@ enifed('ember-debug/index', ['exports', 'ember-metal/core', 'ember-environment',
|
|
555
631
|
@param handler {Function} A function to handle deprecation calls.
|
556
632
|
@since 2.1.0
|
557
633
|
*/
|
558
|
-
|
634
|
+
_emberMetal.default.Debug.registerDeprecationHandler = _emberDebugDeprecate.registerHandler;
|
559
635
|
/**
|
560
636
|
Allows for runtime registration of handler functions that override the default warning behavior.
|
561
637
|
Warnings are invoked by calls made to [Ember.warn](http://emberjs.com/api/classes/Ember.html#method_warn).
|
@@ -584,7 +660,7 @@ enifed('ember-debug/index', ['exports', 'ember-metal/core', 'ember-environment',
|
|
584
660
|
@param handler {Function} A function to handle warnings.
|
585
661
|
@since 2.1.0
|
586
662
|
*/
|
587
|
-
|
663
|
+
_emberMetal.default.Debug.registerWarnHandler = _emberDebugWarn.registerHandler;
|
588
664
|
|
589
665
|
/*
|
590
666
|
We are transitioning away from `ember.js` to `ember.debug.js` to make
|
@@ -597,14 +673,13 @@ enifed('ember-debug/index', ['exports', 'ember-metal/core', 'ember-environment',
|
|
597
673
|
var runningNonEmberDebugJS = false;
|
598
674
|
exports.runningNonEmberDebugJS = runningNonEmberDebugJS;
|
599
675
|
if (runningNonEmberDebugJS) {
|
600
|
-
|
676
|
+
_emberMetal.warn('Please use `ember.debug.js` instead of `ember.js` for development and debugging.');
|
601
677
|
}
|
602
678
|
});
|
603
679
|
// reexports
|
604
|
-
enifed('ember-debug/warn', ['exports', 'ember-console', 'ember-metal
|
680
|
+
enifed('ember-debug/warn', ['exports', 'ember-console', 'ember-metal', 'ember-debug/handlers'], function (exports, _emberConsole, _emberMetal, _emberDebugHandlers) {
|
605
681
|
'use strict';
|
606
682
|
|
607
|
-
var _slice = Array.prototype.slice;
|
608
683
|
exports.registerHandler = registerHandler;
|
609
684
|
exports.default = warn;
|
610
685
|
|
@@ -649,7 +724,7 @@ enifed('ember-debug/warn', ['exports', 'ember-console', 'ember-metal/debug', 'em
|
|
649
724
|
|
650
725
|
function warn(message, test, options) {
|
651
726
|
if (!options) {
|
652
|
-
|
727
|
+
_emberMetal.deprecate(missingOptionsDeprecation, false, {
|
653
728
|
id: 'ember-debug.warn-options-missing',
|
654
729
|
until: '3.0.0',
|
655
730
|
url: 'http://emberjs.com/deprecations/v2.x/#toc_ember-debug-function-options'
|
@@ -657,17 +732,17 @@ enifed('ember-debug/warn', ['exports', 'ember-console', 'ember-metal/debug', 'em
|
|
657
732
|
}
|
658
733
|
|
659
734
|
if (options && !options.id) {
|
660
|
-
|
735
|
+
_emberMetal.deprecate(missingOptionsIdDeprecation, false, {
|
661
736
|
id: 'ember-debug.warn-id-missing',
|
662
737
|
until: '3.0.0',
|
663
738
|
url: 'http://emberjs.com/deprecations/v2.x/#toc_ember-debug-function-options'
|
664
739
|
});
|
665
740
|
}
|
666
741
|
|
667
|
-
_emberDebugHandlers.invoke.apply(undefined, ['warn'].concat(
|
742
|
+
_emberDebugHandlers.invoke.apply(undefined, ['warn'].concat(babelHelpers.slice.call(arguments)));
|
668
743
|
}
|
669
744
|
});
|
670
|
-
enifed('ember-testing/adapters/adapter', ['exports', 'ember-runtime
|
745
|
+
enifed('ember-testing/adapters/adapter', ['exports', 'ember-runtime'], function (exports, _emberRuntime) {
|
671
746
|
'use strict';
|
672
747
|
|
673
748
|
function K() {
|
@@ -687,7 +762,7 @@ enifed('ember-testing/adapters/adapter', ['exports', 'ember-runtime/system/objec
|
|
687
762
|
@namespace Ember.Test
|
688
763
|
@public
|
689
764
|
*/
|
690
|
-
exports.default =
|
765
|
+
exports.default = _emberRuntime.Object.extend({
|
691
766
|
/**
|
692
767
|
This callback will be called whenever an async operation is about to start.
|
693
768
|
Override this to call your framework's methods that handle async
|
@@ -723,7 +798,7 @@ enifed('ember-testing/adapters/adapter', ['exports', 'ember-runtime/system/objec
|
|
723
798
|
}
|
724
799
|
});
|
725
800
|
});
|
726
|
-
enifed('ember-testing/adapters/qunit', ['exports', 'ember-testing/adapters/adapter', 'ember-metal
|
801
|
+
enifed('ember-testing/adapters/qunit', ['exports', 'ember-testing/adapters/adapter', 'ember-metal'], function (exports, _emberTestingAdaptersAdapter, _emberMetal) {
|
727
802
|
'use strict';
|
728
803
|
|
729
804
|
/**
|
@@ -743,11 +818,11 @@ enifed('ember-testing/adapters/qunit', ['exports', 'ember-testing/adapters/adapt
|
|
743
818
|
QUnit.start();
|
744
819
|
},
|
745
820
|
exception: function (error) {
|
746
|
-
ok(false,
|
821
|
+
ok(false, _emberMetal.inspect(error));
|
747
822
|
}
|
748
823
|
});
|
749
824
|
});
|
750
|
-
enifed('ember-testing/events', ['exports', 'ember-views
|
825
|
+
enifed('ember-testing/events', ['exports', 'ember-views', 'ember-metal'], function (exports, _emberViews, _emberMetal) {
|
751
826
|
'use strict';
|
752
827
|
|
753
828
|
exports.focus = focus;
|
@@ -761,11 +836,11 @@ enifed('ember-testing/events', ['exports', 'ember-views/system/jquery', 'ember-m
|
|
761
836
|
if (!el) {
|
762
837
|
return;
|
763
838
|
}
|
764
|
-
var $el =
|
839
|
+
var $el = _emberViews.jQuery(el);
|
765
840
|
if ($el.is(':input, [contenteditable=true]')) {
|
766
841
|
var type = $el.prop('type');
|
767
842
|
if (type !== 'checkbox' && type !== 'radio' && type !== 'hidden') {
|
768
|
-
|
843
|
+
_emberMetal.run(null, function () {
|
769
844
|
// Firefox does not trigger the `focusin` event if the window
|
770
845
|
// does not have focus. If the document doesn't have focus just
|
771
846
|
// use trigger('focusin') instead.
|
@@ -799,7 +874,7 @@ enifed('ember-testing/events', ['exports', 'ember-views/system/jquery', 'ember-m
|
|
799
874
|
clientX: x,
|
800
875
|
clientY: y
|
801
876
|
};
|
802
|
-
event = buildMouseEvent(type,
|
877
|
+
event = buildMouseEvent(type, _emberViews.jQuery.extend(simulatedCoordinates, options));
|
803
878
|
} else {
|
804
879
|
event = buildBasicEvent(type, options);
|
805
880
|
}
|
@@ -811,7 +886,7 @@ enifed('ember-testing/events', ['exports', 'ember-views/system/jquery', 'ember-m
|
|
811
886
|
|
812
887
|
var event = document.createEvent('Events');
|
813
888
|
event.initEvent(type, true, true);
|
814
|
-
|
889
|
+
_emberViews.jQuery.extend(event, options);
|
815
890
|
return event;
|
816
891
|
}
|
817
892
|
|
@@ -821,7 +896,7 @@ enifed('ember-testing/events', ['exports', 'ember-views/system/jquery', 'ember-m
|
|
821
896
|
var event = undefined;
|
822
897
|
try {
|
823
898
|
event = document.createEvent('MouseEvents');
|
824
|
-
var eventOpts =
|
899
|
+
var eventOpts = _emberViews.jQuery.extend({}, DEFAULT_EVENT_OPTIONS, options);
|
825
900
|
event.initMouseEvent(type, eventOpts.canBubble, eventOpts.cancelable, window, eventOpts.detail, eventOpts.screenX, eventOpts.screenY, eventOpts.clientX, eventOpts.clientY, eventOpts.ctrlKey, eventOpts.altKey, eventOpts.shiftKey, eventOpts.metaKey, eventOpts.button, eventOpts.relatedTarget);
|
826
901
|
} catch (e) {
|
827
902
|
event = buildBasicEvent(type, options);
|
@@ -835,7 +910,7 @@ enifed('ember-testing/events', ['exports', 'ember-views/system/jquery', 'ember-m
|
|
835
910
|
var event = undefined;
|
836
911
|
try {
|
837
912
|
event = document.createEvent('KeyEvents');
|
838
|
-
var eventOpts =
|
913
|
+
var eventOpts = _emberViews.jQuery.extend({}, DEFAULT_EVENT_OPTIONS, options);
|
839
914
|
event.initKeyEvent(type, eventOpts.canBubble, eventOpts.cancelable, window, eventOpts.ctrlKey, eventOpts.altKey, eventOpts.shiftKey, eventOpts.metaKey, eventOpts.keyCode, eventOpts.charCode);
|
840
915
|
} catch (e) {
|
841
916
|
event = buildBasicEvent(type, options);
|
@@ -843,10 +918,10 @@ enifed('ember-testing/events', ['exports', 'ember-views/system/jquery', 'ember-m
|
|
843
918
|
return event;
|
844
919
|
}
|
845
920
|
});
|
846
|
-
enifed('ember-testing/ext/application', ['exports', 'ember-application
|
921
|
+
enifed('ember-testing/ext/application', ['exports', 'ember-application', 'ember-testing/setup_for_testing', 'ember-testing/test/helpers', 'ember-testing/test/promise', 'ember-testing/test/run', 'ember-testing/test/on_inject_helpers', 'ember-testing/test/adapter'], function (exports, _emberApplication, _emberTestingSetup_for_testing, _emberTestingTestHelpers, _emberTestingTestPromise, _emberTestingTestRun, _emberTestingTestOn_inject_helpers, _emberTestingTestAdapter) {
|
847
922
|
'use strict';
|
848
923
|
|
849
|
-
|
924
|
+
_emberApplication.Application.reopen({
|
850
925
|
/**
|
851
926
|
This property contains the testing helpers for the current application. These
|
852
927
|
are created once you call `injectTestHelpers` on your `Ember.Application`
|
@@ -1033,53 +1108,65 @@ enifed('ember-testing/ext/application', ['exports', 'ember-application/system/ap
|
|
1033
1108
|
};
|
1034
1109
|
}
|
1035
1110
|
});
|
1036
|
-
enifed('ember-testing/ext/rsvp', ['exports', 'ember-runtime
|
1111
|
+
enifed('ember-testing/ext/rsvp', ['exports', 'ember-runtime', 'ember-metal', 'ember-testing/test/adapter'], function (exports, _emberRuntime, _emberMetal, _emberTestingTestAdapter) {
|
1037
1112
|
'use strict';
|
1038
1113
|
|
1039
|
-
|
1114
|
+
_emberRuntime.RSVP.configure('async', function (callback, promise) {
|
1040
1115
|
// if schedule will cause autorun, we need to inform adapter
|
1041
|
-
if (
|
1116
|
+
if (_emberMetal.isTesting() && !_emberMetal.run.backburner.currentInstance) {
|
1042
1117
|
_emberTestingTestAdapter.asyncStart();
|
1043
|
-
|
1118
|
+
_emberMetal.run.backburner.schedule('actions', function () {
|
1044
1119
|
_emberTestingTestAdapter.asyncEnd();
|
1045
1120
|
callback(promise);
|
1046
1121
|
});
|
1047
1122
|
} else {
|
1048
|
-
|
1123
|
+
_emberMetal.run.backburner.schedule('actions', function () {
|
1049
1124
|
return callback(promise);
|
1050
1125
|
});
|
1051
1126
|
}
|
1052
1127
|
});
|
1053
1128
|
|
1054
|
-
exports.default =
|
1129
|
+
exports.default = _emberRuntime.RSVP;
|
1055
1130
|
});
|
1056
1131
|
enifed('ember-testing/helpers', ['exports', 'ember-testing/test/helpers', 'ember-testing/helpers/and_then', 'ember-testing/helpers/click', 'ember-testing/helpers/current_path', 'ember-testing/helpers/current_route_name', 'ember-testing/helpers/current_url', 'ember-testing/helpers/fill_in', 'ember-testing/helpers/find', 'ember-testing/helpers/find_with_assert', 'ember-testing/helpers/key_event', 'ember-testing/helpers/pause_test', 'ember-testing/helpers/trigger_event', 'ember-testing/helpers/visit', 'ember-testing/helpers/wait'], function (exports, _emberTestingTestHelpers, _emberTestingHelpersAnd_then, _emberTestingHelpersClick, _emberTestingHelpersCurrent_path, _emberTestingHelpersCurrent_route_name, _emberTestingHelpersCurrent_url, _emberTestingHelpersFill_in, _emberTestingHelpersFind, _emberTestingHelpersFind_with_assert, _emberTestingHelpersKey_event, _emberTestingHelpersPause_test, _emberTestingHelpersTrigger_event, _emberTestingHelpersVisit, _emberTestingHelpersWait) {
|
1057
1132
|
'use strict';
|
1058
1133
|
|
1134
|
+
_emberTestingTestHelpers.registerAsyncHelper('visit', _emberTestingHelpersVisit.default);
|
1135
|
+
_emberTestingTestHelpers.registerAsyncHelper('click', _emberTestingHelpersClick.default);
|
1136
|
+
_emberTestingTestHelpers.registerAsyncHelper('keyEvent', _emberTestingHelpersKey_event.default);
|
1137
|
+
_emberTestingTestHelpers.registerAsyncHelper('fillIn', _emberTestingHelpersFill_in.default);
|
1138
|
+
_emberTestingTestHelpers.registerAsyncHelper('wait', _emberTestingHelpersWait.default);
|
1139
|
+
_emberTestingTestHelpers.registerAsyncHelper('andThen', _emberTestingHelpersAnd_then.default);
|
1140
|
+
_emberTestingTestHelpers.registerAsyncHelper('pauseTest', _emberTestingHelpersPause_test.default);
|
1141
|
+
_emberTestingTestHelpers.registerAsyncHelper('triggerEvent', _emberTestingHelpersTrigger_event.default);
|
1142
|
+
|
1143
|
+
_emberTestingTestHelpers.registerHelper('find', _emberTestingHelpersFind.default);
|
1144
|
+
_emberTestingTestHelpers.registerHelper('findWithAssert', _emberTestingHelpersFind_with_assert.default);
|
1145
|
+
_emberTestingTestHelpers.registerHelper('currentRouteName', _emberTestingHelpersCurrent_route_name.default);
|
1146
|
+
_emberTestingTestHelpers.registerHelper('currentPath', _emberTestingHelpersCurrent_path.default);
|
1147
|
+
_emberTestingTestHelpers.registerHelper('currentURL', _emberTestingHelpersCurrent_url.default);
|
1148
|
+
});
|
1149
|
+
enifed("ember-testing/helpers/and_then", ["exports"], function (exports) {
|
1059
1150
|
/**
|
1060
1151
|
@module ember
|
1061
1152
|
@submodule ember-testing
|
1062
1153
|
*/
|
1154
|
+
"use strict";
|
1063
1155
|
|
1156
|
+
exports.default = andThen;
|
1157
|
+
|
1158
|
+
function andThen(app, callback) {
|
1159
|
+
return app.testHelpers.wait(callback(app));
|
1160
|
+
}
|
1161
|
+
});
|
1162
|
+
enifed('ember-testing/helpers/click', ['exports', 'ember-testing/events'], function (exports, _emberTestingEvents) {
|
1064
1163
|
/**
|
1065
|
-
|
1066
|
-
|
1067
|
-
using your app.
|
1068
|
-
|
1069
|
-
Example:
|
1070
|
-
|
1071
|
-
```javascript
|
1072
|
-
visit('posts/index').then(function() {
|
1073
|
-
// assert something
|
1074
|
-
});
|
1075
|
-
```
|
1076
|
-
|
1077
|
-
@method visit
|
1078
|
-
@param {String} url the name of the route
|
1079
|
-
@return {RSVP.Promise}
|
1080
|
-
@public
|
1164
|
+
@module ember
|
1165
|
+
@submodule ember-testing
|
1081
1166
|
*/
|
1082
|
-
|
1167
|
+
'use strict';
|
1168
|
+
|
1169
|
+
exports.default = click;
|
1083
1170
|
|
1084
1171
|
/**
|
1085
1172
|
Clicks an element and triggers any actions triggered by the element's `click`
|
@@ -1095,114 +1182,34 @@ enifed('ember-testing/helpers', ['exports', 'ember-testing/test/helpers', 'ember
|
|
1095
1182
|
|
1096
1183
|
@method click
|
1097
1184
|
@param {String} selector jQuery selector for finding element on the DOM
|
1185
|
+
@param {Object} context A DOM Element, Document, or jQuery to use as context
|
1098
1186
|
@return {RSVP.Promise}
|
1099
1187
|
@public
|
1100
1188
|
*/
|
1101
|
-
_emberTestingTestHelpers.registerAsyncHelper('click', _emberTestingHelpersClick.default);
|
1102
1189
|
|
1103
|
-
|
1104
|
-
|
1105
|
-
|
1106
|
-
Example:
|
1107
|
-
|
1108
|
-
```javascript
|
1109
|
-
keyEvent('.some-jQuery-selector', 'keypress', 13).then(function() {
|
1110
|
-
// assert something
|
1111
|
-
});
|
1112
|
-
```
|
1113
|
-
|
1114
|
-
@method keyEvent
|
1115
|
-
@param {String} selector jQuery selector for finding element on the DOM
|
1116
|
-
@param {String} type the type of key event, e.g. `keypress`, `keydown`, `keyup`
|
1117
|
-
@param {Number} keyCode the keyCode of the simulated key event
|
1118
|
-
@return {RSVP.Promise}
|
1119
|
-
@since 1.5.0
|
1120
|
-
@public
|
1121
|
-
*/
|
1122
|
-
_emberTestingTestHelpers.registerAsyncHelper('keyEvent', _emberTestingHelpersKey_event.default);
|
1190
|
+
function click(app, selector, context) {
|
1191
|
+
var $el = app.testHelpers.findWithAssert(selector, context);
|
1192
|
+
var el = $el[0];
|
1123
1193
|
|
1124
|
-
|
1125
|
-
Fills in an input element with some text.
|
1126
|
-
|
1127
|
-
Example:
|
1128
|
-
|
1129
|
-
```javascript
|
1130
|
-
fillIn('#email', 'you@example.com').then(function() {
|
1131
|
-
// assert something
|
1132
|
-
});
|
1133
|
-
```
|
1134
|
-
|
1135
|
-
@method fillIn
|
1136
|
-
@param {String} selector jQuery selector finding an input element on the DOM
|
1137
|
-
to fill text with
|
1138
|
-
@param {String} text text to place inside the input element
|
1139
|
-
@return {RSVP.Promise}
|
1140
|
-
@public
|
1141
|
-
*/
|
1142
|
-
_emberTestingTestHelpers.registerAsyncHelper('fillIn', _emberTestingHelpersFill_in.default);
|
1194
|
+
_emberTestingEvents.fireEvent(el, 'mousedown');
|
1143
1195
|
|
1144
|
-
|
1145
|
-
Finds an element in the context of the app's container element. A simple alias
|
1146
|
-
for `app.$(selector)`.
|
1147
|
-
|
1148
|
-
Example:
|
1149
|
-
|
1150
|
-
```javascript
|
1151
|
-
var $el = find('.my-selector');
|
1152
|
-
```
|
1153
|
-
|
1154
|
-
@method find
|
1155
|
-
@param {String} selector jQuery string selector for element lookup
|
1156
|
-
@return {Object} jQuery object representing the results of the query
|
1157
|
-
@public
|
1158
|
-
*/
|
1159
|
-
_emberTestingTestHelpers.registerHelper('find', _emberTestingHelpersFind.default);
|
1196
|
+
_emberTestingEvents.focus(el);
|
1160
1197
|
|
1161
|
-
|
1162
|
-
|
1163
|
-
|
1164
|
-
Example:
|
1165
|
-
|
1166
|
-
```javascript
|
1167
|
-
var $el = findWithAssert('.doesnt-exist'); // throws error
|
1168
|
-
```
|
1169
|
-
|
1170
|
-
@method findWithAssert
|
1171
|
-
@param {String} selector jQuery selector string for finding an element within
|
1172
|
-
the DOM
|
1173
|
-
@return {Object} jQuery object representing the results of the query
|
1174
|
-
@throws {Error} throws error if jQuery object returned has a length of 0
|
1175
|
-
@public
|
1176
|
-
*/
|
1177
|
-
_emberTestingTestHelpers.registerHelper('findWithAssert', _emberTestingHelpersFind_with_assert.default);
|
1198
|
+
_emberTestingEvents.fireEvent(el, 'mouseup');
|
1199
|
+
_emberTestingEvents.fireEvent(el, 'click');
|
1178
1200
|
|
1201
|
+
return app.testHelpers.wait();
|
1202
|
+
}
|
1203
|
+
});
|
1204
|
+
enifed('ember-testing/helpers/current_path', ['exports', 'ember-metal'], function (exports, _emberMetal) {
|
1179
1205
|
/**
|
1180
|
-
|
1181
|
-
|
1182
|
-
|
1183
|
-
This is most often used as the return value for the helper functions (see 'click',
|
1184
|
-
'fillIn','visit',etc).
|
1185
|
-
|
1186
|
-
Example:
|
1187
|
-
|
1188
|
-
```javascript
|
1189
|
-
Ember.Test.registerAsyncHelper('loginUser', function(app, username, password) {
|
1190
|
-
visit('secured/path/here')
|
1191
|
-
.fillIn('#username', username)
|
1192
|
-
.fillIn('#password', password)
|
1193
|
-
.click('.submit')
|
1194
|
-
|
1195
|
-
return app.testHelpers.wait();
|
1196
|
-
});
|
1197
|
-
|
1198
|
-
@method wait
|
1199
|
-
@param {Object} value The value to be returned.
|
1200
|
-
@return {RSVP.Promise}
|
1201
|
-
@public
|
1206
|
+
@module ember
|
1207
|
+
@submodule ember-testing
|
1202
1208
|
*/
|
1203
|
-
|
1204
|
-
|
1205
|
-
|
1209
|
+
'use strict';
|
1210
|
+
|
1211
|
+
exports.default = currentPath;
|
1212
|
+
|
1206
1213
|
/**
|
1207
1214
|
Returns the current path.
|
1208
1215
|
|
@@ -1221,69 +1228,13 @@ enifed('ember-testing/helpers', ['exports', 'ember-testing/test/helpers', 'ember
|
|
1221
1228
|
@since 1.5.0
|
1222
1229
|
@public
|
1223
1230
|
*/
|
1224
|
-
_emberTestingTestHelpers.registerHelper('currentPath', _emberTestingHelpersCurrent_path.default);
|
1225
|
-
|
1226
|
-
/**
|
1227
|
-
Returns the current URL.
|
1228
|
-
|
1229
|
-
Example:
|
1230
|
-
|
1231
|
-
```javascript
|
1232
|
-
function validateURL() {
|
1233
|
-
equal(currentURL(), '/some/path', "correct URL was transitioned into.");
|
1234
|
-
}
|
1235
|
-
|
1236
|
-
click('#some-link-id').then(validateURL);
|
1237
|
-
```
|
1238
|
-
|
1239
|
-
@method currentURL
|
1240
|
-
@return {Object} The currently active URL.
|
1241
|
-
@since 1.5.0
|
1242
|
-
@public
|
1243
|
-
*/
|
1244
|
-
_emberTestingTestHelpers.registerHelper('currentURL', _emberTestingHelpersCurrent_url.default);
|
1245
|
-
_emberTestingTestHelpers.registerAsyncHelper('pauseTest', _emberTestingHelpersPause_test.default);
|
1246
|
-
_emberTestingTestHelpers.registerAsyncHelper('triggerEvent', _emberTestingHelpersTrigger_event.default);
|
1247
|
-
});
|
1248
|
-
enifed("ember-testing/helpers/and_then", ["exports"], function (exports) {
|
1249
|
-
"use strict";
|
1250
|
-
|
1251
|
-
exports.default = andThen;
|
1252
|
-
|
1253
|
-
function andThen(app, callback) {
|
1254
|
-
return app.testHelpers.wait(callback(app));
|
1255
|
-
}
|
1256
|
-
});
|
1257
|
-
enifed('ember-testing/helpers/click', ['exports', 'ember-testing/events'], function (exports, _emberTestingEvents) {
|
1258
|
-
'use strict';
|
1259
|
-
|
1260
|
-
exports.default = click;
|
1261
|
-
|
1262
|
-
function click(app, selector, context) {
|
1263
|
-
var $el = app.testHelpers.findWithAssert(selector, context);
|
1264
|
-
var el = $el[0];
|
1265
|
-
|
1266
|
-
_emberTestingEvents.fireEvent(el, 'mousedown');
|
1267
|
-
|
1268
|
-
_emberTestingEvents.focus(el);
|
1269
|
-
|
1270
|
-
_emberTestingEvents.fireEvent(el, 'mouseup');
|
1271
|
-
_emberTestingEvents.fireEvent(el, 'click');
|
1272
|
-
|
1273
|
-
return app.testHelpers.wait();
|
1274
|
-
}
|
1275
|
-
});
|
1276
|
-
enifed('ember-testing/helpers/current_path', ['exports', 'ember-metal/property_get'], function (exports, _emberMetalProperty_get) {
|
1277
|
-
'use strict';
|
1278
|
-
|
1279
|
-
exports.default = currentPath;
|
1280
1231
|
|
1281
1232
|
function currentPath(app) {
|
1282
1233
|
var routingService = app.__container__.lookup('service:-routing');
|
1283
|
-
return
|
1234
|
+
return _emberMetal.get(routingService, 'currentPath');
|
1284
1235
|
}
|
1285
1236
|
});
|
1286
|
-
enifed('ember-testing/helpers/current_route_name', ['exports', 'ember-metal
|
1237
|
+
enifed('ember-testing/helpers/current_route_name', ['exports', 'ember-metal'], function (exports, _emberMetal) {
|
1287
1238
|
/**
|
1288
1239
|
@module ember
|
1289
1240
|
@submodule ember-testing
|
@@ -1309,24 +1260,70 @@ enifed('ember-testing/helpers/current_route_name', ['exports', 'ember-metal/prop
|
|
1309
1260
|
|
1310
1261
|
function currentRouteName(app) {
|
1311
1262
|
var routingService = app.__container__.lookup('service:-routing');
|
1312
|
-
return
|
1263
|
+
return _emberMetal.get(routingService, 'currentRouteName');
|
1313
1264
|
}
|
1314
1265
|
});
|
1315
|
-
enifed('ember-testing/helpers/current_url', ['exports', 'ember-metal
|
1266
|
+
enifed('ember-testing/helpers/current_url', ['exports', 'ember-metal'], function (exports, _emberMetal) {
|
1267
|
+
/**
|
1268
|
+
@module ember
|
1269
|
+
@submodule ember-testing
|
1270
|
+
*/
|
1316
1271
|
'use strict';
|
1317
1272
|
|
1318
1273
|
exports.default = currentURL;
|
1319
1274
|
|
1275
|
+
/**
|
1276
|
+
Returns the current URL.
|
1277
|
+
|
1278
|
+
Example:
|
1279
|
+
|
1280
|
+
```javascript
|
1281
|
+
function validateURL() {
|
1282
|
+
equal(currentURL(), '/some/path', "correct URL was transitioned into.");
|
1283
|
+
}
|
1284
|
+
|
1285
|
+
click('#some-link-id').then(validateURL);
|
1286
|
+
```
|
1287
|
+
|
1288
|
+
@method currentURL
|
1289
|
+
@return {Object} The currently active URL.
|
1290
|
+
@since 1.5.0
|
1291
|
+
@public
|
1292
|
+
*/
|
1293
|
+
|
1320
1294
|
function currentURL(app) {
|
1321
1295
|
var router = app.__container__.lookup('router:main');
|
1322
|
-
return
|
1296
|
+
return _emberMetal.get(router, 'location').getURL();
|
1323
1297
|
}
|
1324
1298
|
});
|
1325
1299
|
enifed('ember-testing/helpers/fill_in', ['exports', 'ember-testing/events'], function (exports, _emberTestingEvents) {
|
1300
|
+
/**
|
1301
|
+
@module ember
|
1302
|
+
@submodule ember-testing
|
1303
|
+
*/
|
1326
1304
|
'use strict';
|
1327
1305
|
|
1328
1306
|
exports.default = fillIn;
|
1329
1307
|
|
1308
|
+
/**
|
1309
|
+
Fills in an input element with some text.
|
1310
|
+
|
1311
|
+
Example:
|
1312
|
+
|
1313
|
+
```javascript
|
1314
|
+
fillIn('#email', 'you@example.com').then(function() {
|
1315
|
+
// assert something
|
1316
|
+
});
|
1317
|
+
```
|
1318
|
+
|
1319
|
+
@method fillIn
|
1320
|
+
@param {String} selector jQuery selector finding an input element on the DOM
|
1321
|
+
to fill text with
|
1322
|
+
@param {String} text text to place inside the input element
|
1323
|
+
@return {RSVP.Promise}
|
1324
|
+
@public
|
1325
|
+
*/
|
1326
|
+
|
1330
1327
|
function fillIn(app, selector, contextOrText, text) {
|
1331
1328
|
var $el = undefined,
|
1332
1329
|
el = undefined,
|
@@ -1340,26 +1337,82 @@ enifed('ember-testing/helpers/fill_in', ['exports', 'ember-testing/events'], fun
|
|
1340
1337
|
el = $el[0];
|
1341
1338
|
_emberTestingEvents.focus(el);
|
1342
1339
|
|
1343
|
-
$el.val(text);
|
1340
|
+
$el.eq(0).val(text);
|
1344
1341
|
_emberTestingEvents.fireEvent(el, 'input');
|
1345
1342
|
_emberTestingEvents.fireEvent(el, 'change');
|
1346
1343
|
|
1347
1344
|
return app.testHelpers.wait();
|
1348
1345
|
}
|
1349
1346
|
});
|
1350
|
-
enifed('ember-testing/helpers/find', ['exports', 'ember-metal
|
1347
|
+
enifed('ember-testing/helpers/find', ['exports', 'ember-metal'], function (exports, _emberMetal) {
|
1348
|
+
/**
|
1349
|
+
@module ember
|
1350
|
+
@submodule ember-testing
|
1351
|
+
*/
|
1351
1352
|
'use strict';
|
1352
1353
|
|
1353
1354
|
exports.default = find;
|
1354
1355
|
|
1356
|
+
/**
|
1357
|
+
Finds an element in the context of the app's container element. A simple alias
|
1358
|
+
for `app.$(selector)`.
|
1359
|
+
|
1360
|
+
Example:
|
1361
|
+
|
1362
|
+
```javascript
|
1363
|
+
var $el = find('.my-selector');
|
1364
|
+
```
|
1365
|
+
|
1366
|
+
With the `context` param:
|
1367
|
+
|
1368
|
+
```javascript
|
1369
|
+
var $el = find('.my-selector', '.parent-element-class');
|
1370
|
+
```
|
1371
|
+
|
1372
|
+
@method find
|
1373
|
+
@param {String} selector jQuery string selector for element lookup
|
1374
|
+
@param {String} [context] (optional) jQuery selector that will limit the selector
|
1375
|
+
argument to find only within the context's children
|
1376
|
+
@return {Object} jQuery object representing the results of the query
|
1377
|
+
@public
|
1378
|
+
*/
|
1379
|
+
|
1355
1380
|
function find(app, selector, context) {
|
1356
1381
|
var $el = undefined;
|
1357
|
-
context = context ||
|
1382
|
+
context = context || _emberMetal.get(app, 'rootElement');
|
1358
1383
|
$el = app.$(selector, context);
|
1359
1384
|
return $el;
|
1360
1385
|
}
|
1361
1386
|
});
|
1362
1387
|
enifed('ember-testing/helpers/find_with_assert', ['exports'], function (exports) {
|
1388
|
+
/**
|
1389
|
+
@module ember
|
1390
|
+
@submodule ember-testing
|
1391
|
+
*/
|
1392
|
+
/**
|
1393
|
+
Like `find`, but throws an error if the element selector returns no results.
|
1394
|
+
|
1395
|
+
Example:
|
1396
|
+
|
1397
|
+
```javascript
|
1398
|
+
var $el = findWithAssert('.doesnt-exist'); // throws error
|
1399
|
+
```
|
1400
|
+
|
1401
|
+
With the `context` param:
|
1402
|
+
|
1403
|
+
```javascript
|
1404
|
+
var $el = findWithAssert('.selector-id', '.parent-element-class'); // assert will pass
|
1405
|
+
```
|
1406
|
+
|
1407
|
+
@method findWithAssert
|
1408
|
+
@param {String} selector jQuery selector string for finding an element within
|
1409
|
+
the DOM
|
1410
|
+
@param {String} [context] (optional) jQuery selector that will limit the
|
1411
|
+
selector argument to find only within the context's children
|
1412
|
+
@return {Object} jQuery object representing the results of the query
|
1413
|
+
@throws {Error} throws error if jQuery object returned has a length of 0
|
1414
|
+
@public
|
1415
|
+
*/
|
1363
1416
|
'use strict';
|
1364
1417
|
|
1365
1418
|
exports.default = findWithAssert;
|
@@ -1373,6 +1426,26 @@ enifed('ember-testing/helpers/find_with_assert', ['exports'], function (exports)
|
|
1373
1426
|
}
|
1374
1427
|
});
|
1375
1428
|
enifed('ember-testing/helpers/key_event', ['exports'], function (exports) {
|
1429
|
+
/**
|
1430
|
+
@module ember
|
1431
|
+
@submodule ember-testing
|
1432
|
+
*/
|
1433
|
+
/**
|
1434
|
+
Simulates a key event, e.g. `keypress`, `keydown`, `keyup` with the desired keyCode
|
1435
|
+
Example:
|
1436
|
+
```javascript
|
1437
|
+
keyEvent('.some-jQuery-selector', 'keypress', 13).then(function() {
|
1438
|
+
// assert something
|
1439
|
+
});
|
1440
|
+
```
|
1441
|
+
@method keyEvent
|
1442
|
+
@param {String} selector jQuery selector for finding element on the DOM
|
1443
|
+
@param {String} type the type of key event, e.g. `keypress`, `keydown`, `keyup`
|
1444
|
+
@param {Number} keyCode the keyCode of the simulated key event
|
1445
|
+
@return {RSVP.Promise}
|
1446
|
+
@since 1.5.0
|
1447
|
+
@public
|
1448
|
+
*/
|
1376
1449
|
'use strict';
|
1377
1450
|
|
1378
1451
|
exports.default = keyEvent;
|
@@ -1393,7 +1466,7 @@ enifed('ember-testing/helpers/key_event', ['exports'], function (exports) {
|
|
1393
1466
|
return app.testHelpers.triggerEvent(selector, context, type, { keyCode: keyCode, which: keyCode });
|
1394
1467
|
}
|
1395
1468
|
});
|
1396
|
-
enifed('ember-testing/helpers/pause_test', ['exports', 'ember-runtime
|
1469
|
+
enifed('ember-testing/helpers/pause_test', ['exports', 'ember-runtime'], function (exports, _emberRuntime) {
|
1397
1470
|
/**
|
1398
1471
|
@module ember
|
1399
1472
|
@submodule ember-testing
|
@@ -1418,7 +1491,7 @@ enifed('ember-testing/helpers/pause_test', ['exports', 'ember-runtime/ext/rsvp']
|
|
1418
1491
|
*/
|
1419
1492
|
|
1420
1493
|
function pauseTest() {
|
1421
|
-
return new
|
1494
|
+
return new _emberRuntime.RSVP.Promise(function () {}, 'TestAdapter paused promise');
|
1422
1495
|
}
|
1423
1496
|
});
|
1424
1497
|
enifed('ember-testing/helpers/trigger_event', ['exports', 'ember-testing/events'], function (exports, _emberTestingEvents) {
|
@@ -1492,11 +1565,34 @@ enifed('ember-testing/helpers/trigger_event', ['exports', 'ember-testing/events'
|
|
1492
1565
|
return app.testHelpers.wait();
|
1493
1566
|
}
|
1494
1567
|
});
|
1495
|
-
enifed('ember-testing/helpers/visit', ['exports', 'ember-metal
|
1568
|
+
enifed('ember-testing/helpers/visit', ['exports', 'ember-metal'], function (exports, _emberMetal) {
|
1569
|
+
/**
|
1570
|
+
@module ember
|
1571
|
+
@submodule ember-testing
|
1572
|
+
*/
|
1496
1573
|
'use strict';
|
1497
1574
|
|
1498
1575
|
exports.default = visit;
|
1499
1576
|
|
1577
|
+
/**
|
1578
|
+
Loads a route, sets up any controllers, and renders any templates associated
|
1579
|
+
with the route as though a real user had triggered the route change while
|
1580
|
+
using your app.
|
1581
|
+
|
1582
|
+
Example:
|
1583
|
+
|
1584
|
+
```javascript
|
1585
|
+
visit('posts/index').then(function() {
|
1586
|
+
// assert something
|
1587
|
+
});
|
1588
|
+
```
|
1589
|
+
|
1590
|
+
@method visit
|
1591
|
+
@param {String} url the name of the route
|
1592
|
+
@return {RSVP.Promise}
|
1593
|
+
@public
|
1594
|
+
*/
|
1595
|
+
|
1500
1596
|
function visit(app, url) {
|
1501
1597
|
var router = app.__container__.lookup('router:main');
|
1502
1598
|
var shouldHandleURL = false;
|
@@ -1505,13 +1601,13 @@ enifed('ember-testing/helpers/visit', ['exports', 'ember-metal/run_loop'], funct
|
|
1505
1601
|
router.location.setURL(url);
|
1506
1602
|
|
1507
1603
|
if (shouldHandleURL) {
|
1508
|
-
|
1604
|
+
_emberMetal.run(app.__deprecatedInstance__, 'handleURL', url);
|
1509
1605
|
}
|
1510
1606
|
});
|
1511
1607
|
|
1512
1608
|
if (app._readinessDeferrals > 0) {
|
1513
1609
|
router['initialURL'] = url;
|
1514
|
-
|
1610
|
+
_emberMetal.run(app, 'advanceReadiness');
|
1515
1611
|
delete router['initialURL'];
|
1516
1612
|
} else {
|
1517
1613
|
shouldHandleURL = true;
|
@@ -1520,13 +1616,42 @@ enifed('ember-testing/helpers/visit', ['exports', 'ember-metal/run_loop'], funct
|
|
1520
1616
|
return app.testHelpers.wait();
|
1521
1617
|
}
|
1522
1618
|
});
|
1523
|
-
enifed('ember-testing/helpers/wait', ['exports', 'ember-testing/test/waiters', 'ember-runtime
|
1619
|
+
enifed('ember-testing/helpers/wait', ['exports', 'ember-testing/test/waiters', 'ember-runtime', 'ember-metal', 'ember-testing/test/pending_requests'], function (exports, _emberTestingTestWaiters, _emberRuntime, _emberMetal, _emberTestingTestPending_requests) {
|
1620
|
+
/**
|
1621
|
+
@module ember
|
1622
|
+
@submodule ember-testing
|
1623
|
+
*/
|
1524
1624
|
'use strict';
|
1525
1625
|
|
1526
1626
|
exports.default = wait;
|
1527
1627
|
|
1628
|
+
/**
|
1629
|
+
Causes the run loop to process any pending events. This is used to ensure that
|
1630
|
+
any async operations from other helpers (or your assertions) have been processed.
|
1631
|
+
|
1632
|
+
This is most often used as the return value for the helper functions (see 'click',
|
1633
|
+
'fillIn','visit',etc).
|
1634
|
+
|
1635
|
+
Example:
|
1636
|
+
|
1637
|
+
```javascript
|
1638
|
+
Ember.Test.registerAsyncHelper('loginUser', function(app, username, password) {
|
1639
|
+
visit('secured/path/here')
|
1640
|
+
.fillIn('#username', username)
|
1641
|
+
.fillIn('#password', password)
|
1642
|
+
.click('.submit')
|
1643
|
+
|
1644
|
+
return app.testHelpers.wait();
|
1645
|
+
});
|
1646
|
+
|
1647
|
+
@method wait
|
1648
|
+
@param {Object} value The value to be returned.
|
1649
|
+
@return {RSVP.Promise}
|
1650
|
+
@public
|
1651
|
+
*/
|
1652
|
+
|
1528
1653
|
function wait(app, value) {
|
1529
|
-
return new
|
1654
|
+
return new _emberRuntime.RSVP.Promise(function (resolve) {
|
1530
1655
|
var router = app.__container__.lookup('router:main');
|
1531
1656
|
|
1532
1657
|
// Every 10ms, poll for the async thing to have finished
|
@@ -1543,7 +1668,7 @@ enifed('ember-testing/helpers/wait', ['exports', 'ember-testing/test/waiters', '
|
|
1543
1668
|
}
|
1544
1669
|
|
1545
1670
|
// 3. If there are scheduled timers or we are inside of a run loop, keep polling
|
1546
|
-
if (
|
1671
|
+
if (_emberMetal.run.hasScheduledTimers() || _emberMetal.run.currentRunLoop) {
|
1547
1672
|
return;
|
1548
1673
|
}
|
1549
1674
|
|
@@ -1555,39 +1680,34 @@ enifed('ember-testing/helpers/wait', ['exports', 'ember-testing/test/waiters', '
|
|
1555
1680
|
clearInterval(watcher);
|
1556
1681
|
|
1557
1682
|
// Synchronously resolve the promise
|
1558
|
-
|
1683
|
+
_emberMetal.run(null, resolve, value);
|
1559
1684
|
}, 10);
|
1560
1685
|
});
|
1561
1686
|
}
|
1562
1687
|
});
|
1563
|
-
enifed('ember-testing/index', ['exports', 'ember-
|
1688
|
+
enifed('ember-testing/index', ['exports', 'ember-testing/support', 'ember-testing/ext/application', 'ember-testing/ext/rsvp', 'ember-testing/helpers', 'ember-testing/initializers', 'ember-testing/test', 'ember-testing/adapters/adapter', 'ember-testing/setup_for_testing', 'ember-testing/adapters/qunit'], function (exports, _emberTestingSupport, _emberTestingExtApplication, _emberTestingExtRsvp, _emberTestingHelpers, _emberTestingInitializers, _emberTestingTest, _emberTestingAdaptersAdapter, _emberTestingSetup_for_testing, _emberTestingAdaptersQunit) {
|
1564
1689
|
'use strict';
|
1565
1690
|
|
1566
|
-
|
1567
|
-
|
1568
|
-
|
1569
|
-
|
1570
|
-
@submodule ember-testing
|
1571
|
-
*/
|
1572
|
-
|
1573
|
-
_emberMetalCore.default.Test = _emberTestingTest.default;
|
1574
|
-
_emberMetalCore.default.Test.Adapter = _emberTestingAdaptersAdapter.default;
|
1575
|
-
_emberMetalCore.default.setupForTesting = _emberTestingSetup_for_testing.default;
|
1576
|
-
Object.defineProperty(_emberTestingTest.default, 'QUnitAdapter', {
|
1577
|
-
get: function () {
|
1578
|
-
return _require.default('ember-testing/adapters/qunit').default;
|
1579
|
-
}
|
1580
|
-
});
|
1691
|
+
exports.Test = _emberTestingTest.default;
|
1692
|
+
exports.Adapter = _emberTestingAdaptersAdapter.default;
|
1693
|
+
exports.setupForTesting = _emberTestingSetup_for_testing.default;
|
1694
|
+
exports.QUnitAdapter = _emberTestingAdaptersQunit.default;
|
1581
1695
|
});
|
1582
|
-
// reexports
|
1583
1696
|
// to handle various edge cases
|
1697
|
+
// setup RSVP + run loop integration
|
1584
1698
|
// adds helpers to helpers object in Test
|
1585
|
-
|
1699
|
+
// to setup initializer
|
1700
|
+
|
1701
|
+
/**
|
1702
|
+
@module ember
|
1703
|
+
@submodule ember-testing
|
1704
|
+
*/
|
1705
|
+
enifed('ember-testing/initializers', ['exports', 'ember-runtime'], function (exports, _emberRuntime) {
|
1586
1706
|
'use strict';
|
1587
1707
|
|
1588
1708
|
var name = 'deferReadiness in `testing` mode';
|
1589
1709
|
|
1590
|
-
|
1710
|
+
_emberRuntime.onLoad('Ember.Application', function (Application) {
|
1591
1711
|
if (!Application.initializers[name]) {
|
1592
1712
|
Application.initializer({
|
1593
1713
|
name: name,
|
@@ -1601,7 +1721,7 @@ enifed('ember-testing/initializers', ['exports', 'ember-runtime/system/lazy_load
|
|
1601
1721
|
}
|
1602
1722
|
});
|
1603
1723
|
});
|
1604
|
-
enifed('ember-testing/setup_for_testing', ['exports', 'ember-metal
|
1724
|
+
enifed('ember-testing/setup_for_testing', ['exports', 'ember-metal', 'ember-views', 'ember-testing/test/adapter', 'ember-testing/test/pending_requests', 'ember-testing/adapters/qunit'], function (exports, _emberMetal, _emberViews, _emberTestingTestAdapter, _emberTestingTestPending_requests, _emberTestingAdaptersQunit) {
|
1605
1725
|
'use strict';
|
1606
1726
|
|
1607
1727
|
exports.default = setupForTesting;
|
@@ -1620,25 +1740,24 @@ enifed('ember-testing/setup_for_testing', ['exports', 'ember-metal/testing', 'em
|
|
1620
1740
|
*/
|
1621
1741
|
|
1622
1742
|
function setupForTesting() {
|
1623
|
-
|
1743
|
+
_emberMetal.setTesting(true);
|
1624
1744
|
|
1625
1745
|
var adapter = _emberTestingTestAdapter.getAdapter();
|
1626
1746
|
// if adapter is not manually set default to QUnit
|
1627
1747
|
if (!adapter) {
|
1628
|
-
|
1629
|
-
_emberTestingTestAdapter.setAdapter(new QUnitAdapter());
|
1748
|
+
_emberTestingTestAdapter.setAdapter(new _emberTestingAdaptersQunit.default());
|
1630
1749
|
}
|
1631
1750
|
|
1632
|
-
|
1633
|
-
|
1751
|
+
_emberViews.jQuery(document).off('ajaxSend', _emberTestingTestPending_requests.incrementPendingRequests);
|
1752
|
+
_emberViews.jQuery(document).off('ajaxComplete', _emberTestingTestPending_requests.decrementPendingRequests);
|
1634
1753
|
|
1635
1754
|
_emberTestingTestPending_requests.clearPendingRequests();
|
1636
1755
|
|
1637
|
-
|
1638
|
-
|
1756
|
+
_emberViews.jQuery(document).on('ajaxSend', _emberTestingTestPending_requests.incrementPendingRequests);
|
1757
|
+
_emberViews.jQuery(document).on('ajaxComplete', _emberTestingTestPending_requests.decrementPendingRequests);
|
1639
1758
|
}
|
1640
1759
|
});
|
1641
|
-
enifed('ember-testing/support', ['exports', 'ember-metal
|
1760
|
+
enifed('ember-testing/support', ['exports', 'ember-metal', 'ember-views', 'ember-environment'], function (exports, _emberMetal, _emberViews, _emberEnvironment) {
|
1642
1761
|
'use strict';
|
1643
1762
|
|
1644
1763
|
/**
|
@@ -1646,7 +1765,7 @@ enifed('ember-testing/support', ['exports', 'ember-metal/debug', 'ember-views/sy
|
|
1646
1765
|
@submodule ember-testing
|
1647
1766
|
*/
|
1648
1767
|
|
1649
|
-
var $ =
|
1768
|
+
var $ = _emberViews.jQuery;
|
1650
1769
|
|
1651
1770
|
/**
|
1652
1771
|
This method creates a checkbox and triggers the click event to fire the
|
@@ -1685,12 +1804,12 @@ enifed('ember-testing/support', ['exports', 'ember-metal/debug', 'ember-views/sy
|
|
1685
1804
|
|
1686
1805
|
// Try again to verify that the patch took effect or blow up.
|
1687
1806
|
testCheckboxClick(function () {
|
1688
|
-
|
1807
|
+
_emberMetal.warn('clicked checkboxes should be checked! the jQuery patch didn\'t work', this.checked, { id: 'ember-testing.test-checkbox-click' });
|
1689
1808
|
});
|
1690
1809
|
});
|
1691
1810
|
}
|
1692
1811
|
});
|
1693
|
-
enifed('ember-testing/test', ['exports', 'ember-testing/test/helpers', 'ember-testing/test/on_inject_helpers', 'ember-testing/test/promise', 'ember-testing/test/waiters', 'ember-testing/test/adapter', 'ember-metal
|
1812
|
+
enifed('ember-testing/test', ['exports', 'ember-testing/test/helpers', 'ember-testing/test/on_inject_helpers', 'ember-testing/test/promise', 'ember-testing/test/waiters', 'ember-testing/test/adapter', 'ember-metal'], function (exports, _emberTestingTestHelpers, _emberTestingTestOn_inject_helpers, _emberTestingTestPromise, _emberTestingTestWaiters, _emberTestingTestAdapter, _emberMetal) {
|
1694
1813
|
/**
|
1695
1814
|
@module ember
|
1696
1815
|
@submodule ember-testing
|
@@ -1729,7 +1848,7 @@ enifed('ember-testing/test', ['exports', 'ember-testing/test/helpers', 'ember-te
|
|
1729
1848
|
unregisterWaiter: _emberTestingTestWaiters.unregisterWaiter
|
1730
1849
|
};
|
1731
1850
|
|
1732
|
-
if (
|
1851
|
+
if (_emberMetal.isFeatureEnabled('ember-testing-check-waiters')) {
|
1733
1852
|
Test.checkWaiters = _emberTestingTestWaiters.checkWaiters;
|
1734
1853
|
}
|
1735
1854
|
|
@@ -1764,7 +1883,7 @@ enifed('ember-testing/test', ['exports', 'ember-testing/test/helpers', 'ember-te
|
|
1764
1883
|
|
1765
1884
|
exports.default = Test;
|
1766
1885
|
});
|
1767
|
-
enifed('ember-testing/test/adapter', ['exports', 'ember-console', 'ember-metal
|
1886
|
+
enifed('ember-testing/test/adapter', ['exports', 'ember-console', 'ember-metal'], function (exports, _emberConsole, _emberMetal) {
|
1768
1887
|
'use strict';
|
1769
1888
|
|
1770
1889
|
exports.getAdapter = getAdapter;
|
@@ -1781,9 +1900,9 @@ enifed('ember-testing/test/adapter', ['exports', 'ember-console', 'ember-metal/e
|
|
1781
1900
|
function setAdapter(value) {
|
1782
1901
|
adapter = value;
|
1783
1902
|
if (value) {
|
1784
|
-
|
1903
|
+
_emberMetal.setDispatchOverride(adapterDispatch);
|
1785
1904
|
} else {
|
1786
|
-
|
1905
|
+
_emberMetal.setDispatchOverride(null);
|
1787
1906
|
}
|
1788
1907
|
}
|
1789
1908
|
|
@@ -1994,26 +2113,20 @@ enifed("ember-testing/test/pending_requests", ["exports"], function (exports) {
|
|
1994
2113
|
}
|
1995
2114
|
}
|
1996
2115
|
});
|
1997
|
-
enifed('ember-testing/test/promise', ['exports', 'ember-runtime
|
2116
|
+
enifed('ember-testing/test/promise', ['exports', 'ember-runtime', 'ember-testing/test/run'], function (exports, _emberRuntime, _emberTestingTestRun) {
|
1998
2117
|
'use strict';
|
1999
2118
|
|
2000
2119
|
exports.promise = promise;
|
2001
2120
|
exports.resolve = resolve;
|
2002
2121
|
exports.getLastPromise = getLastPromise;
|
2003
2122
|
|
2004
|
-
function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
|
2005
|
-
|
2006
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
|
2007
|
-
|
2008
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); }
|
2009
|
-
|
2010
2123
|
var lastPromise = undefined;
|
2011
2124
|
|
2012
2125
|
var TestPromise = (function (_RSVP$Promise) {
|
2013
|
-
|
2126
|
+
babelHelpers.inherits(TestPromise, _RSVP$Promise);
|
2014
2127
|
|
2015
2128
|
function TestPromise() {
|
2016
|
-
|
2129
|
+
babelHelpers.classCallCheck(this, TestPromise);
|
2017
2130
|
|
2018
2131
|
_RSVP$Promise.apply(this, arguments);
|
2019
2132
|
lastPromise = this;
|
@@ -2052,7 +2165,7 @@ enifed('ember-testing/test/promise', ['exports', 'ember-runtime/ext/rsvp', 'embe
|
|
2052
2165
|
};
|
2053
2166
|
|
2054
2167
|
return TestPromise;
|
2055
|
-
})(
|
2168
|
+
})(_emberRuntime.RSVP.Promise);
|
2056
2169
|
|
2057
2170
|
exports.default = TestPromise;
|
2058
2171
|
|
@@ -2112,20 +2225,20 @@ enifed('ember-testing/test/promise', ['exports', 'ember-runtime/ext/rsvp', 'embe
|
|
2112
2225
|
}
|
2113
2226
|
}
|
2114
2227
|
});
|
2115
|
-
enifed('ember-testing/test/run', ['exports', 'ember-metal
|
2228
|
+
enifed('ember-testing/test/run', ['exports', 'ember-metal'], function (exports, _emberMetal) {
|
2116
2229
|
'use strict';
|
2117
2230
|
|
2118
2231
|
exports.default = run;
|
2119
2232
|
|
2120
2233
|
function run(fn) {
|
2121
|
-
if (!
|
2122
|
-
return
|
2234
|
+
if (!_emberMetal.run.currentRunLoop) {
|
2235
|
+
return _emberMetal.run(fn);
|
2123
2236
|
} else {
|
2124
2237
|
return fn();
|
2125
2238
|
}
|
2126
2239
|
}
|
2127
2240
|
});
|
2128
|
-
enifed('ember-testing/test/waiters', ['exports', 'ember-metal
|
2241
|
+
enifed('ember-testing/test/waiters', ['exports', 'ember-metal'], function (exports, _emberMetal) {
|
2129
2242
|
'use strict';
|
2130
2243
|
|
2131
2244
|
exports.registerWaiter = registerWaiter;
|
@@ -2139,7 +2252,10 @@ enifed('ember-testing/test/waiters', ['exports', 'ember-metal/features', 'ember-
|
|
2139
2252
|
/**
|
2140
2253
|
This allows ember-testing to play nicely with other asynchronous
|
2141
2254
|
events, such as an application that is waiting for a CSS3
|
2142
|
-
transition or an IndexDB transaction.
|
2255
|
+
transition or an IndexDB transaction. The waiter runs periodically
|
2256
|
+
after each async helper (i.e. `click`, `andThen`, `visit`, etc) has executed,
|
2257
|
+
until the returning result is truthy. After the waiters finish, the next async helper
|
2258
|
+
is executed and the process repeats.
|
2143
2259
|
|
2144
2260
|
For example:
|
2145
2261
|
|
@@ -2243,7 +2359,7 @@ enifed('ember-testing/test/waiters', ['exports', 'ember-metal/features', 'ember-
|
|
2243
2359
|
}
|
2244
2360
|
|
2245
2361
|
function generateDeprecatedWaitersArray() {
|
2246
|
-
|
2362
|
+
_emberMetal.deprecate('Usage of `Ember.Test.waiters` is deprecated. Please refactor to `Ember.Test.checkWaiters`.', !_emberMetal.isFeatureEnabled('ember-testing-check-waiters'), { until: '2.8.0', id: 'ember-testing.test-waiters' });
|
2247
2363
|
|
2248
2364
|
var array = new Array(callbacks.length);
|
2249
2365
|
for (var i = 0; i < callbacks.length; i++) {
|