{"version":3,"sources":["license.js","loader.js","@ember/-internals/container/tests/container_test.js","@ember/-internals/container/tests/owner_test.js","@ember/-internals/container/tests/registry_test.js","@ember/-internals/extension-support/tests/container_debug_adapter_test.js","@ember/-internals/extension-support/tests/data_adapter_test.js","@ember/-internals/glimmer/tests/integration/application/actions-test.js","@ember/-internals/glimmer/tests/integration/application/engine-test.js","@ember/-internals/glimmer/tests/integration/application/hot-reload-test.js","@ember/-internals/glimmer/tests/integration/application/rendering-test.js","@ember/-internals/glimmer/tests/integration/components/angle-bracket-invocation-test.js","@ember/-internals/glimmer/tests/integration/components/append-test.js","@ember/-internals/glimmer/tests/integration/components/attribute-bindings-test.js","@ember/-internals/glimmer/tests/integration/components/attrs-lookup-test.js","@ember/-internals/glimmer/tests/integration/components/class-bindings-test.js","@ember/-internals/glimmer/tests/integration/components/contextual-components-test.js","@ember/-internals/glimmer/tests/integration/components/curly-components-test.js","@ember/-internals/glimmer/tests/integration/components/destroy-test.js","@ember/-internals/glimmer/tests/integration/components/dynamic-components-test.js","@ember/-internals/glimmer/tests/integration/components/error-handling-test.js","@ember/-internals/glimmer/tests/integration/components/fragment-components-test.js","@ember/-internals/glimmer/tests/integration/components/instrumentation-compile-test.js","@ember/-internals/glimmer/tests/integration/components/instrumentation-test.js","@ember/-internals/glimmer/tests/integration/components/life-cycle-test.js","@ember/-internals/glimmer/tests/integration/components/link-to-test.js","@ember/-internals/glimmer/tests/integration/components/local-lookup-test.js","@ember/-internals/glimmer/tests/integration/components/namespaced-lookup-test.js","@ember/-internals/glimmer/tests/integration/components/render-to-element-test.js","@ember/-internals/glimmer/tests/integration/components/target-action-test.js","@ember/-internals/glimmer/tests/integration/components/template-only-components-test.js","@ember/-internals/glimmer/tests/integration/components/to-string-test.js","@ember/-internals/glimmer/tests/integration/components/utils-test.js","@ember/-internals/glimmer/tests/integration/components/web-component-fallback-test.js","@ember/-internals/glimmer/tests/integration/components/will-destroy-element-hook-test.js","@ember/-internals/glimmer/tests/integration/content-test.js","@ember/-internals/glimmer/tests/integration/custom-component-manager-test.js","@ember/-internals/glimmer/tests/integration/event-dispatcher-test.js","@ember/-internals/glimmer/tests/integration/helpers/-class-test.js","@ember/-internals/glimmer/tests/integration/helpers/closure-action-test.js","@ember/-internals/glimmer/tests/integration/helpers/concat-test.js","@ember/-internals/glimmer/tests/integration/helpers/custom-helper-test.js","@ember/-internals/glimmer/tests/integration/helpers/element-action-test.js","@ember/-internals/glimmer/tests/integration/helpers/get-test.js","@ember/-internals/glimmer/tests/integration/helpers/hash-test.js","@ember/-internals/glimmer/tests/integration/helpers/if-unless-test.js","@ember/-internals/glimmer/tests/integration/helpers/input-test.js","@ember/-internals/glimmer/tests/integration/helpers/loc-test.js","@ember/-internals/glimmer/tests/integration/helpers/log-test.js","@ember/-internals/glimmer/tests/integration/helpers/mut-test.js","@ember/-internals/glimmer/tests/integration/helpers/partial-test.js","@ember/-internals/glimmer/tests/integration/helpers/readonly-test.js","@ember/-internals/glimmer/tests/integration/helpers/text-area-test.js","@ember/-internals/glimmer/tests/integration/helpers/unbound-test.js","@ember/-internals/glimmer/tests/integration/helpers/yield-test.js","@ember/-internals/glimmer/tests/integration/input-test.js","@ember/-internals/glimmer/tests/integration/mount-test.js","@ember/-internals/glimmer/tests/integration/outlet-test.js","@ember/-internals/glimmer/tests/integration/refinements-test.js","@ember/-internals/glimmer/tests/integration/render-settled-test.js","@ember/-internals/glimmer/tests/integration/svg-test.js","@ember/-internals/glimmer/tests/integration/syntax/each-in-test.js","@ember/-internals/glimmer/tests/integration/syntax/each-test.js","@ember/-internals/glimmer/tests/integration/syntax/experimental-syntax-test.js","@ember/-internals/glimmer/tests/integration/syntax/if-unless-test.js","@ember/-internals/glimmer/tests/integration/syntax/in-element-test.js","@ember/-internals/glimmer/tests/integration/syntax/let-test.js","@ember/-internals/glimmer/tests/integration/syntax/with-dynamic-var-test.js","@ember/-internals/glimmer/tests/integration/syntax/with-test.js","@ember/-internals/glimmer/tests/unit/outlet-test.js","@ember/-internals/glimmer/tests/unit/runtime-resolver-cache-test.js","@ember/-internals/glimmer/tests/unit/template-factory-test.js","@ember/-internals/glimmer/tests/unit/utils/debug-stack-test.js","@ember/-internals/glimmer/tests/utils/abstract-test-case.js","@ember/-internals/glimmer/tests/utils/helpers.js","@ember/-internals/glimmer/tests/utils/shared-conditional-tests.js","@ember/-internals/glimmer/tests/utils/string-test.js","@ember/-internals/glimmer/tests/utils/test-case.js","@ember/-internals/glimmer/tests/utils/test-helpers.js","@ember/-internals/meta/tests/listeners_test.js","@ember/-internals/meta/tests/meta_test.js","@ember/-internals/metal/tests/accessors/get_path_test.js","@ember/-internals/metal/tests/accessors/get_properties_test.js","@ember/-internals/metal/tests/accessors/get_test.js","@ember/-internals/metal/tests/accessors/mandatory_setters_test.js","@ember/-internals/metal/tests/accessors/set_path_test.js","@ember/-internals/metal/tests/accessors/set_test.js","@ember/-internals/metal/tests/alias_test.js","@ember/-internals/metal/tests/chains_test.js","@ember/-internals/metal/tests/computed_test.js","@ember/-internals/metal/tests/descriptor_test.js","@ember/-internals/metal/tests/events_test.js","@ember/-internals/metal/tests/expand_properties_test.js","@ember/-internals/metal/tests/injected_property_test.js","@ember/-internals/metal/tests/is_blank_test.js","@ember/-internals/metal/tests/is_empty_test.js","@ember/-internals/metal/tests/is_none_test.js","@ember/-internals/metal/tests/is_present_test.js","@ember/-internals/metal/tests/libraries_test.js","@ember/-internals/metal/tests/main_test.js","@ember/-internals/metal/tests/mixin/alias_method_test.js","@ember/-internals/metal/tests/mixin/apply_test.js","@ember/-internals/metal/tests/mixin/computed_test.js","@ember/-internals/metal/tests/mixin/concatenated_properties_test.js","@ember/-internals/metal/tests/mixin/detect_test.js","@ember/-internals/metal/tests/mixin/introspection_test.js","@ember/-internals/metal/tests/mixin/merged_properties_test.js","@ember/-internals/metal/tests/mixin/method_test.js","@ember/-internals/metal/tests/mixin/observer_test.js","@ember/-internals/metal/tests/mixin/reopen_test.js","@ember/-internals/metal/tests/mixin/without_test.js","@ember/-internals/metal/tests/namespace_search_test.js","@ember/-internals/metal/tests/observer_test.js","@ember/-internals/metal/tests/performance_test.js","@ember/-internals/metal/tests/properties_test.js","@ember/-internals/metal/tests/property_did_change_hook.js","@ember/-internals/metal/tests/property_events_test.js","@ember/-internals/metal/tests/set_properties_test.js","@ember/-internals/metal/tests/tracked/computed_test.js","@ember/-internals/metal/tests/tracked/get_test.js","@ember/-internals/metal/tests/tracked/set_test.js","@ember/-internals/metal/tests/tracked/support.js","@ember/-internals/metal/tests/tracked/validation_test.js","@ember/-internals/metal/tests/watching/is_watching_test.js","@ember/-internals/metal/tests/watching/unwatch_test.js","@ember/-internals/metal/tests/watching/watch_test.js","@ember/-internals/routing/tests/ext/controller_test.js","@ember/-internals/routing/tests/location/auto_location_test.js","@ember/-internals/routing/tests/location/hash_location_test.js","@ember/-internals/routing/tests/location/history_location_test.js","@ember/-internals/routing/tests/location/none_location_test.js","@ember/-internals/routing/tests/location/util_test.js","@ember/-internals/routing/tests/system/cache_test.js","@ember/-internals/routing/tests/system/controller_for_test.js","@ember/-internals/routing/tests/system/dsl_test.js","@ember/-internals/routing/tests/system/route_test.js","@ember/-internals/routing/tests/system/router_test.js","@ember/-internals/routing/tests/utils_test.js","@ember/-internals/runtime/tests/array/any-test.js","@ember/-internals/runtime/tests/array/compact-test.js","@ember/-internals/runtime/tests/array/every-test.js","@ember/-internals/runtime/tests/array/filter-test.js","@ember/-internals/runtime/tests/array/find-test.js","@ember/-internals/runtime/tests/array/firstObject-test.js","@ember/-internals/runtime/tests/array/forEach-test.js","@ember/-internals/runtime/tests/array/includes-test.js","@ember/-internals/runtime/tests/array/indexOf-test.js","@ember/-internals/runtime/tests/array/invoke-test.js","@ember/-internals/runtime/tests/array/isAny-test.js","@ember/-internals/runtime/tests/array/lastIndexOf-test.js","@ember/-internals/runtime/tests/array/lastObject-test.js","@ember/-internals/runtime/tests/array/map-test.js","@ember/-internals/runtime/tests/array/mapBy-test.js","@ember/-internals/runtime/tests/array/objectAt-test.js","@ember/-internals/runtime/tests/array/reduce-test.js","@ember/-internals/runtime/tests/array/reject-test.js","@ember/-internals/runtime/tests/array/sortBy-test.js","@ember/-internals/runtime/tests/array/toArray-test.js","@ember/-internals/runtime/tests/array/uniq-test.js","@ember/-internals/runtime/tests/array/uniqBy-test.js","@ember/-internals/runtime/tests/array/without-test.js","@ember/-internals/runtime/tests/copyable-array/copy-test.js","@ember/-internals/runtime/tests/core/compare_test.js","@ember/-internals/runtime/tests/core/copy_test.js","@ember/-internals/runtime/tests/core/isEqual_test.js","@ember/-internals/runtime/tests/core/is_array_test.js","@ember/-internals/runtime/tests/core/is_empty_test.js","@ember/-internals/runtime/tests/core/type_of_test.js","@ember/-internals/runtime/tests/ext/function_test.js","@ember/-internals/runtime/tests/ext/rsvp_test.js","@ember/-internals/runtime/tests/helpers/array.js","@ember/-internals/runtime/tests/inject_test.js","@ember/-internals/runtime/tests/legacy_1x/mixins/observable/chained_test.js","@ember/-internals/runtime/tests/legacy_1x/mixins/observable/observable_test.js","@ember/-internals/runtime/tests/legacy_1x/mixins/observable/propertyChanges_test.js","@ember/-internals/runtime/tests/legacy_1x/system/object/base_test.js","@ember/-internals/runtime/tests/legacy_1x/system/object/concatenated_test.js","@ember/-internals/runtime/tests/mixins/array_test.js","@ember/-internals/runtime/tests/mixins/comparable_test.js","@ember/-internals/runtime/tests/mixins/container_proxy_test.js","@ember/-internals/runtime/tests/mixins/enumerable_test.js","@ember/-internals/runtime/tests/mixins/evented_test.js","@ember/-internals/runtime/tests/mixins/mutable_enumerable_test.js","@ember/-internals/runtime/tests/mixins/observable_test.js","@ember/-internals/runtime/tests/mixins/promise_proxy_test.js","@ember/-internals/runtime/tests/mixins/target_action_support_test.js","@ember/-internals/runtime/tests/mutable-array/addObject-test.js","@ember/-internals/runtime/tests/mutable-array/clear-test.js","@ember/-internals/runtime/tests/mutable-array/insertAt-test.js","@ember/-internals/runtime/tests/mutable-array/popObject-test.js","@ember/-internals/runtime/tests/mutable-array/pushObject-test.js","@ember/-internals/runtime/tests/mutable-array/pushObjects-test.js","@ember/-internals/runtime/tests/mutable-array/removeAt-test.js","@ember/-internals/runtime/tests/mutable-array/removeObject-test.js","@ember/-internals/runtime/tests/mutable-array/removeObjects-test.js","@ember/-internals/runtime/tests/mutable-array/replace-test.js","@ember/-internals/runtime/tests/mutable-array/reverseObjects-test.js","@ember/-internals/runtime/tests/mutable-array/setObjects-test.js","@ember/-internals/runtime/tests/mutable-array/shiftObject-test.js","@ember/-internals/runtime/tests/mutable-array/unshiftObject-test.js","@ember/-internals/runtime/tests/mutable-array/unshiftObjects-test.js","@ember/-internals/runtime/tests/system/array_proxy/arranged_content_test.js","@ember/-internals/runtime/tests/system/array_proxy/array_observer_test.js","@ember/-internals/runtime/tests/system/array_proxy/content_change_test.js","@ember/-internals/runtime/tests/system/array_proxy/length_test.js","@ember/-internals/runtime/tests/system/array_proxy/watching_and_listening_test.js","@ember/-internals/runtime/tests/system/core_object_test.js","@ember/-internals/runtime/tests/system/namespace/base_test.js","@ember/-internals/runtime/tests/system/native_array/a_test.js","@ember/-internals/runtime/tests/system/native_array/copyable_suite_test.js","@ember/-internals/runtime/tests/system/native_array/replace_test.js","@ember/-internals/runtime/tests/system/object/computed_test.js","@ember/-internals/runtime/tests/system/object/create_test.js","@ember/-internals/runtime/tests/system/object/destroy_test.js","@ember/-internals/runtime/tests/system/object/detectInstance_test.js","@ember/-internals/runtime/tests/system/object/detect_test.js","@ember/-internals/runtime/tests/system/object/es-compatibility-test.js","@ember/-internals/runtime/tests/system/object/events_test.js","@ember/-internals/runtime/tests/system/object/extend_test.js","@ember/-internals/runtime/tests/system/object/observer_test.js","@ember/-internals/runtime/tests/system/object/reopenClass_test.js","@ember/-internals/runtime/tests/system/object/reopen_test.js","@ember/-internals/runtime/tests/system/object/strict-mode-test.js","@ember/-internals/runtime/tests/system/object/toString_test.js","@ember/-internals/runtime/tests/system/object_proxy_test.js","@ember/-internals/utils/tests/cache_test.js","@ember/-internals/utils/tests/can_invoke_test.js","@ember/-internals/utils/tests/checkHasSuper_test.js","@ember/-internals/utils/tests/generate_guid_test.js","@ember/-internals/utils/tests/guid_for_test.js","@ember/-internals/utils/tests/inspect_test.js","@ember/-internals/utils/tests/is_proxy_test.js","@ember/-internals/utils/tests/make_array_test.js","@ember/-internals/utils/tests/to-string-test.js","@ember/-internals/utils/tests/try_invoke_test.js","@ember/application/tests/application_instance_test.js","@ember/application/tests/application_test.js","@ember/application/tests/bootstrap-test.js","@ember/application/tests/dependency_injection/custom_resolver_test.js","@ember/application/tests/dependency_injection/default_resolver_test.js","@ember/application/tests/dependency_injection/normalization_test.js","@ember/application/tests/dependency_injection/to_string_test.js","@ember/application/tests/dependency_injection_test.js","@ember/application/tests/initializers_test.js","@ember/application/tests/instance_initializers_test.js","@ember/application/tests/lazy_load_test.js","@ember/application/tests/logging_test.js","@ember/application/tests/readiness_test.js","@ember/application/tests/reset_test.js","@ember/application/tests/visit_test.js","@ember/controller/tests/controller_test.js","@ember/debug/tests/handlers-test.js","@ember/debug/tests/main_test.js","@ember/engine/tests/engine_initializers_test.js","@ember/engine/tests/engine_instance_initializers_test.js","@ember/engine/tests/engine_instance_test.js","@ember/engine/tests/engine_parent_test.js","@ember/engine/tests/engine_test.js","@ember/error/tests/index_test.js","@ember/instrumentation/tests/index-test.js","@ember/map/tests/map_test.js","@ember/object/tests/computed/computed_macros_test.js","@ember/object/tests/computed/reduce_computed_macros_test.js","@ember/polyfills/tests/assign_test.js","@ember/polyfills/tests/merge_test.js","@ember/runloop/tests/debounce_test.js","@ember/runloop/tests/later_test.js","@ember/runloop/tests/next_test.js","@ember/runloop/tests/once_test.js","@ember/runloop/tests/onerror_test.js","@ember/runloop/tests/run_bind_test.js","@ember/runloop/tests/run_test.js","@ember/runloop/tests/schedule_test.js","@ember/runloop/tests/sync_test.js","@ember/runloop/tests/unwind_test.js","@ember/string/tests/camelize_test.js","@ember/string/tests/capitalize_test.js","@ember/string/tests/classify_test.js","@ember/string/tests/dasherize_test.js","@ember/string/tests/decamelize_test.js","@ember/string/tests/loc_test.js","@ember/string/tests/underscore_test.js","@ember/string/tests/w_test.js","ember-template-compiler/tests/plugins/assert-if-helper-without-arguments-test.js","ember-template-compiler/tests/plugins/assert-input-helper-without-block-test.js","ember-template-compiler/tests/plugins/assert-local-variable-shadowing-helper-invocation-test.js","ember-template-compiler/tests/plugins/assert-reserved-named-arguments-test.js","ember-template-compiler/tests/plugins/assert-splattribute-expression-test.js","ember-template-compiler/tests/plugins/deprecate-send-action-test.js","ember-template-compiler/tests/plugins/transform-component-invocation-test.js","ember-template-compiler/tests/plugins/transform-inline-link-to-test.js","ember-template-compiler/tests/plugins/transform-input-type-syntax-test.js","ember-template-compiler/tests/system/bootstrap-test.js","ember-template-compiler/tests/system/compile_options_test.js","ember-template-compiler/tests/system/dasherize-component-name-test.js","ember-testing/tests/acceptance_test.js","ember-testing/tests/adapters/adapter_test.js","ember-testing/tests/adapters/qunit_test.js","ember-testing/tests/adapters_test.js","ember-testing/tests/ext/rsvp_test.js","ember-testing/tests/helper_registration_test.js","ember-testing/tests/helpers_test.js","ember-testing/tests/integration_test.js","ember-testing/tests/reexports_test.js","ember-testing/tests/test/waiters-test.js","ember/tests/application_lifecycle_test.js","ember/tests/component_context_test.js","ember/tests/component_registration_test.js","ember/tests/controller_test.js","ember/tests/error_handler_test.js","ember/tests/helpers/helper_registration_test.js","ember/tests/helpers/link_to_test.js","ember/tests/helpers/link_to_test/link_to_transitioning_classes_test.js","ember/tests/helpers/link_to_test/link_to_with_query_params_test.js","ember/tests/homepage_example_test.js","ember/tests/integration/multiple-app-test.js","ember/tests/production_build_test.js","ember/tests/reexports_test.js","ember/tests/routing/decoupled_basic_test.js","ember/tests/routing/deprecated_handler_infos_test.js","ember/tests/routing/deprecated_transition_state_test.js","ember/tests/routing/query_params_test.js","ember/tests/routing/query_params_test/model_dependent_state_with_query_params_test.js","ember/tests/routing/query_params_test/overlapping_query_params_test.js","ember/tests/routing/query_params_test/query_param_async_get_handler_test.js","ember/tests/routing/query_params_test/query_params_paramless_link_to_test.js","ember/tests/routing/query_params_test/shared_state_test.js","ember/tests/routing/router_map_test.js","ember/tests/routing/router_service_test/basic_test.js","ember/tests/routing/router_service_test/currenturl_lifecycle_test.js","ember/tests/routing/router_service_test/events_test.js","ember/tests/routing/router_service_test/isActive_test.js","ember/tests/routing/router_service_test/recognize_test.js","ember/tests/routing/router_service_test/replaceWith_test.js","ember/tests/routing/router_service_test/transitionTo_test.js","ember/tests/routing/router_service_test/urlFor_test.js","ember/tests/routing/substates_test.js","ember/tests/routing/toplevel_dom_test.js","ember/tests/service_injection_test.js","ember/tests/view_instrumentation_test.js","internal-test-helpers/index.js","internal-test-helpers/lib/apply-mixins.js","internal-test-helpers/lib/browser-detect.js","internal-test-helpers/lib/build-owner.js","internal-test-helpers/lib/confirm-export.js","internal-test-helpers/lib/ember-dev/assertion.js","internal-test-helpers/lib/ember-dev/containers.js","internal-test-helpers/lib/ember-dev/debug.js","internal-test-helpers/lib/ember-dev/deprecation.js","internal-test-helpers/lib/ember-dev/index.js","internal-test-helpers/lib/ember-dev/method-call-tracker.js","internal-test-helpers/lib/ember-dev/namespaces.js","internal-test-helpers/lib/ember-dev/run-loop.js","internal-test-helpers/lib/ember-dev/setup-qunit.js","internal-test-helpers/lib/ember-dev/utils.js","internal-test-helpers/lib/ember-dev/warning.js","internal-test-helpers/lib/equal-inner-html.js","internal-test-helpers/lib/equal-tokens.js","internal-test-helpers/lib/factory.js","internal-test-helpers/lib/get-all-property-names.js","internal-test-helpers/lib/get-text-of.js","internal-test-helpers/lib/matchers.js","internal-test-helpers/lib/module-for.js","internal-test-helpers/lib/registry-check.js","internal-test-helpers/lib/run.js","internal-test-helpers/lib/strip.js","internal-test-helpers/lib/system/synthetic-events.js","internal-test-helpers/lib/test-cases/abstract-application.js","internal-test-helpers/lib/test-cases/abstract-rendering.js","internal-test-helpers/lib/test-cases/abstract.js","internal-test-helpers/lib/test-cases/application.js","internal-test-helpers/lib/test-cases/autoboot-application.js","internal-test-helpers/lib/test-cases/default-resolver-application.js","internal-test-helpers/lib/test-cases/node-query.js","internal-test-helpers/lib/test-cases/query-param.js","internal-test-helpers/lib/test-cases/rendering.js","internal-test-helpers/lib/test-cases/router.js","internal-test-helpers/lib/test-cases/test-resolver-application.js","internal-test-helpers/lib/test-resolver.js","internal-test-helpers/tests/index-test.js","node-module.js"],"sourcesContent":["/*!\n * @overview Ember - JavaScript Application Framework\n * @copyright Copyright 2011-2018 Tilde Inc. and contributors\n * Portions Copyright 2006-2011 Strobe Inc.\n * Portions Copyright 2008-2011 Apple Inc. All rights reserved.\n * @license Licensed under MIT license\n * See https://raw.github.com/emberjs/ember.js/master/LICENSE\n * @version 3.6.0\n */\n","/*globals process */\nvar enifed, requireModule, Ember;\n\n// Used in @ember/-internals/environment/lib/global.js\nmainContext = this; // eslint-disable-line no-undef\n\n(function() {\n function missingModule(name, referrerName) {\n if (referrerName) {\n throw new Error('Could not find module ' + name + ' required by: ' + referrerName);\n } else {\n throw new Error('Could not find module ' + name);\n }\n }\n\n function internalRequire(_name, referrerName) {\n var name = _name;\n var mod = registry[name];\n\n if (!mod) {\n name = name + '/index';\n mod = registry[name];\n }\n\n var exports = seen[name];\n\n if (exports !== undefined) {\n return exports;\n }\n\n exports = seen[name] = {};\n\n if (!mod) {\n missingModule(_name, referrerName);\n }\n\n var deps = mod.deps;\n var callback = mod.callback;\n var reified = new Array(deps.length);\n\n for (var i = 0; i < deps.length; i++) {\n if (deps[i] === 'exports') {\n reified[i] = exports;\n } else if (deps[i] === 'require') {\n reified[i] = requireModule;\n } else {\n reified[i] = internalRequire(deps[i], name);\n }\n }\n\n callback.apply(this, reified);\n\n return exports;\n }\n\n var isNode =\n typeof window === 'undefined' &&\n typeof process !== 'undefined' &&\n {}.toString.call(process) === '[object process]';\n\n if (!isNode) {\n Ember = this.Ember = this.Ember || {};\n }\n\n if (typeof Ember === 'undefined') {\n Ember = {};\n }\n\n if (typeof Ember.__loader === 'undefined') {\n var registry = Object.create(null);\n var seen = Object.create(null);\n\n enifed = function(name, deps, callback) {\n var value = {};\n\n if (!callback) {\n value.deps = [];\n value.callback = deps;\n } else {\n value.deps = deps;\n value.callback = callback;\n }\n\n registry[name] = value;\n };\n\n requireModule = function(name) {\n return internalRequire(name, null);\n };\n\n // setup `require` module\n requireModule['default'] = requireModule;\n\n requireModule.has = function registryHas(moduleName) {\n return !!registry[moduleName] || !!registry[moduleName + '/index'];\n };\n\n requireModule._eak_seen = registry;\n\n Ember.__loader = {\n define: enifed,\n require: requireModule,\n registry: registry,\n };\n } else {\n enifed = Ember.__loader.define;\n requireModule = Ember.__loader.require;\n }\n})();\n","enifed('@ember/-internals/container/tests/container_test', ['@ember/-internals/owner', '@ember/polyfills', '@ember/-internals/container', 'internal-test-helpers'], function (_owner, _polyfills, _container, _internalTestHelpers) {\n 'use strict';\n\n (0, _internalTestHelpers.moduleFor)('Container', class extends _internalTestHelpers.AbstractTestCase {\n ['@test A registered factory returns the same instance each time'](assert) {\n let registry = new _container.Registry();\n let container = registry.container();\n let PostController = (0, _internalTestHelpers.factory)();\n\n registry.register('controller:post', PostController);\n\n let postController = container.lookup('controller:post');\n\n assert.ok(postController instanceof PostController, 'The lookup is an instance of the factory');\n\n assert.equal(postController, container.lookup('controller:post'));\n }\n\n ['@test uses create time injections if factory has no extend'](assert) {\n let registry = new _container.Registry();\n let container = registry.container();\n let AppleController = (0, _internalTestHelpers.factory)();\n let PostController = (0, _internalTestHelpers.factory)();\n\n PostController.extend = undefined; // remove extend\n\n registry.register('controller:apple', AppleController);\n registry.register('controller:post', PostController);\n registry.injection('controller:post', 'apple', 'controller:apple');\n\n let postController = container.lookup('controller:post');\n\n assert.ok(postController.apple instanceof AppleController, 'instance receives an apple of instance AppleController');\n }\n\n ['@test A registered factory returns a fresh instance if singleton: false is passed as an option'](assert) {\n let registry = new _container.Registry();\n let container = registry.container();\n let PostController = (0, _internalTestHelpers.factory)();\n\n registry.register('controller:post', PostController);\n\n let postController1 = container.lookup('controller:post');\n let postController2 = container.lookup('controller:post', {\n singleton: false\n });\n let postController3 = container.lookup('controller:post', {\n singleton: false\n });\n let postController4 = container.lookup('controller:post');\n\n assert.equal(postController1.toString(), postController4.toString(), 'Singleton factories looked up normally return the same value');\n assert.notEqual(postController1.toString(), postController2.toString(), 'Singleton factories are not equal to factories looked up with singleton: false');\n assert.notEqual(postController2.toString(), postController3.toString(), 'Two factories looked up with singleton: false are not equal');\n assert.notEqual(postController3.toString(), postController4.toString(), 'A singleton factory looked up after a factory called with singleton: false is not equal');\n\n assert.ok(postController1 instanceof PostController, 'All instances are instances of the registered factory');\n assert.ok(postController2 instanceof PostController, 'All instances are instances of the registered factory');\n assert.ok(postController3 instanceof PostController, 'All instances are instances of the registered factory');\n assert.ok(postController4 instanceof PostController, 'All instances are instances of the registered factory');\n }\n\n [\"@test A factory type with a registered injection's instances receive that injection\"](assert) {\n let registry = new _container.Registry();\n let container = registry.container();\n let PostController = (0, _internalTestHelpers.factory)();\n let Store = (0, _internalTestHelpers.factory)();\n\n registry.register('controller:post', PostController);\n registry.register('store:main', Store);\n\n registry.typeInjection('controller', 'store', 'store:main');\n\n let postController = container.lookup('controller:post');\n let store = container.lookup('store:main');\n\n assert.equal(postController.store, store);\n }\n\n ['@test An individual factory with a registered injection receives the injection'](assert) {\n let registry = new _container.Registry();\n let container = registry.container();\n let PostController = (0, _internalTestHelpers.factory)();\n let Store = (0, _internalTestHelpers.factory)();\n\n registry.register('controller:post', PostController);\n registry.register('store:main', Store);\n\n registry.injection('controller:post', 'store', 'store:main');\n\n let postController = container.lookup('controller:post');\n let store = container.lookup('store:main');\n\n assert.equal(postController.store, store, 'has the correct store injected');\n }\n\n ['@test A factory with both type and individual injections'](assert) {\n let registry = new _container.Registry();\n let container = registry.container();\n let PostController = (0, _internalTestHelpers.factory)();\n let Store = (0, _internalTestHelpers.factory)();\n let Router = (0, _internalTestHelpers.factory)();\n\n registry.register('controller:post', PostController);\n registry.register('store:main', Store);\n registry.register('router:main', Router);\n\n registry.injection('controller:post', 'store', 'store:main');\n registry.typeInjection('controller', 'router', 'router:main');\n\n let postController = container.lookup('controller:post');\n let store = container.lookup('store:main');\n let router = container.lookup('router:main');\n\n assert.equal(postController.store, store);\n assert.equal(postController.router, router);\n }\n\n ['@test A non-singleton instance is never cached'](assert) {\n let registry = new _container.Registry();\n let container = registry.container();\n let PostView = (0, _internalTestHelpers.factory)();\n\n registry.register('view:post', PostView, { singleton: false });\n\n let postView1 = container.lookup('view:post');\n let postView2 = container.lookup('view:post');\n\n assert.ok(postView1 !== postView2, 'Non-singletons are not cached');\n }\n\n ['@test A non-instantiated property is not instantiated'](assert) {\n let registry = new _container.Registry();\n let container = registry.container();\n\n let template = function () {};\n registry.register('template:foo', template, { instantiate: false });\n assert.equal(container.lookup('template:foo'), template);\n }\n\n ['@test A failed lookup returns undefined'](assert) {\n let registry = new _container.Registry();\n let container = registry.container();\n\n assert.equal(container.lookup('doesnot:exist'), undefined);\n }\n\n ['@test An invalid factory throws an error'](assert) {\n let registry = new _container.Registry();\n let container = registry.container();\n\n registry.register('controller:foo', {});\n\n assert.throws(() => {\n container.lookup('controller:foo');\n }, /Failed to create an instance of \\'controller:foo\\'/);\n }\n\n ['@test Injecting a failed lookup raises an error'](assert) {\n let registry = new _container.Registry();\n let container = registry.container();\n\n let fooInstance = {};\n let fooFactory = {};\n\n let Foo = {\n create() {\n return fooInstance;\n },\n extend() {\n return fooFactory;\n }\n };\n\n registry.register('model:foo', Foo);\n registry.injection('model:foo', 'store', 'store:main');\n\n assert.throws(() => {\n container.lookup('model:foo');\n });\n }\n\n ['@test Injecting a falsy value does not raise an error'](assert) {\n let registry = new _container.Registry();\n let container = registry.container();\n let ApplicationController = (0, _internalTestHelpers.factory)();\n\n registry.register('controller:application', ApplicationController);\n registry.register('user:current', null, { instantiate: false });\n registry.injection('controller:application', 'currentUser', 'user:current');\n\n assert.strictEqual(container.lookup('controller:application').currentUser, null);\n }\n\n ['@test The container returns same value each time even if the value is falsy'](assert) {\n let registry = new _container.Registry();\n let container = registry.container();\n\n registry.register('falsy:value', null, { instantiate: false });\n\n assert.strictEqual(container.lookup('falsy:value'), container.lookup('falsy:value'));\n }\n\n ['@test Destroying the container destroys any cached singletons'](assert) {\n let registry = new _container.Registry();\n let container = registry.container();\n let PostController = (0, _internalTestHelpers.factory)();\n let PostView = (0, _internalTestHelpers.factory)();\n let template = function () {};\n\n registry.register('controller:post', PostController);\n registry.register('view:post', PostView, { singleton: false });\n registry.register('template:post', template, { instantiate: false });\n\n registry.injection('controller:post', 'postView', 'view:post');\n\n let postController = container.lookup('controller:post');\n let postView = postController.postView;\n\n assert.ok(postView instanceof PostView, 'The non-singleton was injected');\n\n container.destroy();\n\n assert.ok(postController.isDestroyed, 'Singletons are destroyed');\n assert.ok(!postView.isDestroyed, 'Non-singletons are not destroyed');\n }\n\n ['@test The container can use a registry hook to resolve factories lazily'](assert) {\n let registry = new _container.Registry();\n let container = registry.container();\n let PostController = (0, _internalTestHelpers.factory)();\n\n registry.resolver = {\n resolve(fullName) {\n if (fullName === 'controller:post') {\n return PostController;\n }\n }\n };\n\n let postController = container.lookup('controller:post');\n\n assert.ok(postController instanceof PostController, 'The correct factory was provided');\n }\n\n ['@test The container normalizes names before resolving'](assert) {\n let registry = new _container.Registry();\n let container = registry.container();\n let PostController = (0, _internalTestHelpers.factory)();\n\n registry.normalizeFullName = function () {\n return 'controller:post';\n };\n\n registry.register('controller:post', PostController);\n let postController = container.lookup('controller:normalized');\n\n assert.ok(postController instanceof PostController, 'Normalizes the name before resolving');\n }\n\n ['@test The container normalizes names when looking factory up'](assert) {\n let registry = new _container.Registry();\n let container = registry.container();\n let PostController = (0, _internalTestHelpers.factory)();\n\n registry.normalizeFullName = function () {\n return 'controller:post';\n };\n\n registry.register('controller:post', PostController);\n let fact = container.factoryFor('controller:normalized');\n\n let factInstance = fact.create();\n assert.ok(factInstance instanceof PostController, 'Normalizes the name');\n }\n\n ['@test Options can be registered that should be applied to a given factory'](assert) {\n let registry = new _container.Registry();\n let container = registry.container();\n let PostView = (0, _internalTestHelpers.factory)();\n\n registry.resolver = {\n resolve(fullName) {\n if (fullName === 'view:post') {\n return PostView;\n }\n }\n };\n\n registry.options('view:post', { instantiate: true, singleton: false });\n\n let postView1 = container.lookup('view:post');\n let postView2 = container.lookup('view:post');\n\n assert.ok(postView1 instanceof PostView, 'The correct factory was provided');\n assert.ok(postView2 instanceof PostView, 'The correct factory was provided');\n\n assert.ok(postView1 !== postView2, 'The two lookups are different');\n }\n\n ['@test Options can be registered that should be applied to all factories for a given type'](assert) {\n let registry = new _container.Registry();\n let container = registry.container();\n let PostView = (0, _internalTestHelpers.factory)();\n\n registry.resolver = {\n resolve(fullName) {\n if (fullName === 'view:post') {\n return PostView;\n }\n }\n };\n\n registry.optionsForType('view', { singleton: false });\n\n let postView1 = container.lookup('view:post');\n let postView2 = container.lookup('view:post');\n\n assert.ok(postView1 instanceof PostView, 'The correct factory was provided');\n assert.ok(postView2 instanceof PostView, 'The correct factory was provided');\n\n assert.ok(postView1 !== postView2, 'The two lookups are different');\n }\n\n ['@test An injected non-singleton instance is never cached'](assert) {\n let registry = new _container.Registry();\n let container = registry.container();\n let PostView = (0, _internalTestHelpers.factory)();\n let PostViewHelper = (0, _internalTestHelpers.factory)();\n\n registry.register('view:post', PostView, { singleton: false });\n registry.register('view_helper:post', PostViewHelper, {\n singleton: false\n });\n registry.injection('view:post', 'viewHelper', 'view_helper:post');\n\n let postView1 = container.lookup('view:post');\n let postView2 = container.lookup('view:post');\n\n assert.ok(postView1.viewHelper !== postView2.viewHelper, 'Injected non-singletons are not cached');\n }\n\n ['@test Factory resolves are cached'](assert) {\n let registry = new _container.Registry();\n let container = registry.container();\n let PostController = (0, _internalTestHelpers.factory)();\n let resolveWasCalled = [];\n registry.resolve = function (fullName) {\n resolveWasCalled.push(fullName);\n return PostController;\n };\n\n assert.deepEqual(resolveWasCalled, []);\n container.factoryFor('controller:post');\n assert.deepEqual(resolveWasCalled, ['controller:post']);\n\n container.factoryFor('controller:post');\n assert.deepEqual(resolveWasCalled, ['controller:post']);\n }\n\n ['@test factory for non extendables (MODEL) resolves are cached'](assert) {\n let registry = new _container.Registry();\n let container = registry.container();\n let PostController = (0, _internalTestHelpers.factory)();\n let resolveWasCalled = [];\n registry.resolve = function (fullName) {\n resolveWasCalled.push(fullName);\n return PostController;\n };\n\n assert.deepEqual(resolveWasCalled, []);\n container.factoryFor('model:post');\n assert.deepEqual(resolveWasCalled, ['model:post']);\n\n container.factoryFor('model:post');\n assert.deepEqual(resolveWasCalled, ['model:post']);\n }\n\n ['@test factory for non extendables resolves are cached'](assert) {\n let registry = new _container.Registry();\n let container = registry.container();\n let PostController = {};\n let resolveWasCalled = [];\n\n registry.resolve = function (fullName) {\n resolveWasCalled.push(fullName);\n return PostController;\n };\n\n assert.deepEqual(resolveWasCalled, []);\n container.factoryFor('foo:post');\n assert.deepEqual(resolveWasCalled, ['foo:post']);\n\n container.factoryFor('foo:post');\n assert.deepEqual(resolveWasCalled, ['foo:post']);\n }\n\n [`@test A factory's lazy injections are validated when first instantiated`](assert) {\n let registry = new _container.Registry();\n let container = registry.container();\n let Apple = (0, _internalTestHelpers.factory)();\n let Orange = (0, _internalTestHelpers.factory)();\n\n Apple.reopenClass({\n _lazyInjections() {\n return [{ specifier: 'orange:main' }, { specifier: 'banana:main' }];\n }\n });\n\n registry.register('apple:main', Apple);\n registry.register('orange:main', Orange);\n\n assert.throws(() => {\n container.lookup('apple:main');\n }, /Attempting to inject an unknown injection: 'banana:main'/);\n }\n\n ['@test Lazy injection validations are cached'](assert) {\n assert.expect(1);\n\n let registry = new _container.Registry();\n let container = registry.container();\n let Apple = (0, _internalTestHelpers.factory)();\n let Orange = (0, _internalTestHelpers.factory)();\n\n Apple.reopenClass({\n _lazyInjections: () => {\n assert.ok(true, 'should call lazy injection method');\n return [{ specifier: 'orange:main' }];\n }\n });\n\n registry.register('apple:main', Apple);\n registry.register('orange:main', Orange);\n\n container.lookup('apple:main');\n container.lookup('apple:main');\n }\n\n ['@test An object with its owner pre-set should be returned from ownerInjection'](assert) {\n let owner = {};\n let registry = new _container.Registry();\n let container = registry.container({ owner });\n\n let result = container.ownerInjection();\n\n assert.equal(result[_owner.OWNER], owner, 'owner is properly included');\n }\n\n ['@test lookup passes options through to expandlocallookup'](assert) {\n let registry = new _container.Registry();\n let container = registry.container();\n let PostController = (0, _internalTestHelpers.factory)();\n\n registry.register('controller:post', PostController);\n registry.expandLocalLookup = (fullName, options) => {\n assert.ok(true, 'expandLocalLookup was called');\n assert.equal(fullName, 'foo:bar');\n assert.deepEqual(options, { source: 'baz:qux' });\n\n return 'controller:post';\n };\n\n let PostControllerLookupResult = container.lookup('foo:bar', {\n source: 'baz:qux'\n });\n\n assert.ok(PostControllerLookupResult instanceof PostController);\n }\n\n ['@test #factoryFor class is registered class'](assert) {\n let registry = new _container.Registry();\n let container = registry.container();\n\n let Component = (0, _internalTestHelpers.factory)();\n registry.register('component:foo-bar', Component);\n\n let factoryManager = container.factoryFor('component:foo-bar');\n assert.deepEqual(factoryManager.class, Component, 'No double extend');\n }\n\n ['@test #factoryFor must supply a fullname']() {\n let registry = new _container.Registry();\n let container = registry.container();\n expectAssertion(() => {\n container.factoryFor('chad-bar');\n }, /fullName must be a proper full name/);\n }\n\n ['@test #factoryFor returns a factory manager'](assert) {\n let registry = new _container.Registry();\n let container = registry.container();\n\n let Component = (0, _internalTestHelpers.factory)();\n registry.register('component:foo-bar', Component);\n\n let factoryManager = container.factoryFor('component:foo-bar');\n assert.ok(factoryManager.create);\n assert.ok(factoryManager.class);\n }\n\n ['@test #factoryFor returns a cached factory manager for the same type'](assert) {\n let registry = new _container.Registry();\n let container = registry.container();\n\n let Component = (0, _internalTestHelpers.factory)();\n registry.register('component:foo-bar', Component);\n registry.register('component:baz-bar', Component);\n\n let factoryManager1 = container.factoryFor('component:foo-bar');\n let factoryManager2 = container.factoryFor('component:foo-bar');\n let factoryManager3 = container.factoryFor('component:baz-bar');\n\n assert.equal(factoryManager1, factoryManager2, 'cache hit');\n assert.notEqual(factoryManager1, factoryManager3, 'cache miss');\n }\n\n ['@test #factoryFor class returns the factory function'](assert) {\n let registry = new _container.Registry();\n let container = registry.container();\n\n let Component = (0, _internalTestHelpers.factory)();\n registry.register('component:foo-bar', Component);\n\n let factoryManager = container.factoryFor('component:foo-bar');\n assert.deepEqual(factoryManager.class, Component, 'No double extend');\n }\n\n ['@test #factoryFor instance have a common parent'](assert) {\n let registry = new _container.Registry();\n let container = registry.container();\n\n let Component = (0, _internalTestHelpers.factory)();\n registry.register('component:foo-bar', Component);\n\n let factoryManager1 = container.factoryFor('component:foo-bar');\n let factoryManager2 = container.factoryFor('component:foo-bar');\n let instance1 = factoryManager1.create({ foo: 'foo' });\n let instance2 = factoryManager2.create({ bar: 'bar' });\n\n assert.deepEqual(instance1.constructor, instance2.constructor);\n }\n\n ['@test can properly reset cache'](assert) {\n let registry = new _container.Registry();\n let container = registry.container();\n\n let Component = (0, _internalTestHelpers.factory)();\n registry.register('component:foo-bar', Component);\n\n let factory1 = container.factoryFor('component:foo-bar');\n let factory2 = container.factoryFor('component:foo-bar');\n\n let instance1 = container.lookup('component:foo-bar');\n let instance2 = container.lookup('component:foo-bar');\n\n assert.equal(instance1, instance2);\n assert.equal(factory1, factory2);\n\n container.reset();\n\n let factory3 = container.factoryFor('component:foo-bar');\n let instance3 = container.lookup('component:foo-bar');\n\n assert.notEqual(instance1, instance3);\n assert.notEqual(factory1, factory3);\n }\n\n ['@test #factoryFor created instances come with instance injections'](assert) {\n let registry = new _container.Registry();\n let container = registry.container();\n\n let Component = (0, _internalTestHelpers.factory)();\n let Ajax = (0, _internalTestHelpers.factory)();\n registry.register('component:foo-bar', Component);\n registry.register('util:ajax', Ajax);\n registry.injection('component:foo-bar', 'ajax', 'util:ajax');\n\n let componentFactory = container.factoryFor('component:foo-bar');\n let component = componentFactory.create();\n\n assert.ok(component.ajax);\n assert.ok(component.ajax instanceof Ajax);\n }\n\n ['@test #factoryFor options passed to create clobber injections'](assert) {\n let registry = new _container.Registry();\n let container = registry.container();\n\n let Component = (0, _internalTestHelpers.factory)();\n let Ajax = (0, _internalTestHelpers.factory)();\n registry.register('component:foo-bar', Component);\n registry.register('util:ajax', Ajax);\n registry.injection('component:foo-bar', 'ajax', 'util:ajax');\n\n let componentFactory = container.factoryFor('component:foo-bar');\n let instrance = componentFactory.create({ ajax: 'fetch' });\n\n assert.equal(instrance.ajax, 'fetch');\n }\n\n ['@test #factoryFor does not add properties to the object being instantiated when _initFactory is present'](assert) {\n let registry = new _container.Registry();\n let container = registry.container();\n\n class Component {\n static _initFactory() {}\n static create(options) {\n let instance = new this();\n (0, _polyfills.assign)(instance, options);\n return instance;\n }\n }\n registry.register('component:foo-bar', Component);\n\n let componentFactory = container.factoryFor('component:foo-bar');\n let instance = componentFactory.create();\n\n // note: _guid and isDestroyed are being set in the `factory` constructor\n // not via registry/container shenanigans\n assert.deepEqual(Object.keys(instance), []);\n }\n\n [`@test assert when calling lookup after destroy on a container`](assert) {\n let registry = new _container.Registry();\n let container = registry.container();\n let Component = (0, _internalTestHelpers.factory)();\n registry.register('component:foo-bar', Component);\n let instance = container.lookup('component:foo-bar');\n assert.ok(instance, 'precond lookup successful');\n\n this.runTask(() => {\n container.destroy();\n container.finalizeDestroy();\n });\n\n expectAssertion(() => {\n container.lookup('component:foo-bar');\n });\n }\n\n [`@test assert when calling factoryFor after destroy on a container`](assert) {\n let registry = new _container.Registry();\n let container = registry.container();\n let Component = (0, _internalTestHelpers.factory)();\n registry.register('component:foo-bar', Component);\n let instance = container.factoryFor('component:foo-bar');\n assert.ok(instance, 'precond lookup successful');\n\n this.runTask(() => {\n container.destroy();\n container.finalizeDestroy();\n });\n\n expectAssertion(() => {\n container.factoryFor('component:foo-bar');\n });\n }\n\n // this is skipped until templates and the glimmer environment do not require `OWNER` to be\n // passed in as constructor args\n ['@skip #factoryFor does not add properties to the object being instantiated'](assert) {\n let registry = new _container.Registry();\n let container = registry.container();\n\n class Component {\n static create(options) {\n let instance = new this();\n (0, _polyfills.assign)(instance, options);\n return instance;\n }\n }\n registry.register('component:foo-bar', Component);\n\n let componentFactory = container.factoryFor('component:foo-bar');\n let instance = componentFactory.create();\n\n // note: _guid and isDestroyed are being set in the `factory` constructor\n // not via registry/container shenanigans\n assert.deepEqual(Object.keys(instance), []);\n }\n });\n\n if (false /* EMBER_MODULE_UNIFICATION */) {\n (0, _internalTestHelpers.moduleFor)('Container module unification', class extends _internalTestHelpers.AbstractTestCase {\n ['@test The container can expand and resolve a source to factoryFor'](assert) {\n let PrivateComponent = (0, _internalTestHelpers.factory)();\n let lookup = 'component:my-input';\n let expectedSource = 'template:routes/application';\n let registry = new _container.Registry();\n let resolveCount = 0;\n let expandedKey = 'boom, special expanded key';\n registry.expandLocalLookup = (specifier, options) => {\n this.assert.strictEqual(specifier, lookup, 'specifier is expanded');\n this.assert.strictEqual(options.source, expectedSource, 'source is expanded');\n return expandedKey;\n };\n registry.resolve = function (fullName) {\n resolveCount++;\n if (fullName === expandedKey) {\n return PrivateComponent;\n }\n };\n\n let container = registry.container();\n\n assert.strictEqual(container.factoryFor(lookup, { source: expectedSource }).class, PrivateComponent, 'The correct factory was provided');\n assert.strictEqual(container.factoryFor(lookup, { source: expectedSource }).class, PrivateComponent, 'The correct factory was provided again');\n assert.equal(resolveCount, 1, 'resolve called only once and a cached factory was returned the second time');\n }\n\n ['@test The container can expand and resolve a source to lookup']() {\n let PrivateComponent = (0, _internalTestHelpers.factory)();\n let lookup = 'component:my-input';\n let expectedSource = 'template:routes/application';\n let registry = new _container.Registry();\n let expandedKey = 'boom, special expanded key';\n registry.expandLocalLookup = (specifier, options) => {\n this.assert.strictEqual(specifier, lookup, 'specifier is expanded');\n this.assert.strictEqual(options.source, expectedSource, 'source is expanded');\n return expandedKey;\n };\n registry.resolve = function (fullName) {\n if (fullName === expandedKey) {\n return PrivateComponent;\n }\n };\n\n let container = registry.container();\n\n let result = container.lookup(lookup, { source: expectedSource });\n this.assert.ok(result instanceof PrivateComponent, 'The correct factory was provided');\n\n this.assert.ok(container.cache[expandedKey] instanceof PrivateComponent, 'The correct factory was stored in the cache with the correct key which includes the source.');\n }\n\n ['@test The container can expand and resolve a namespace to factoryFor'](assert) {\n let PrivateComponent = (0, _internalTestHelpers.factory)();\n let lookup = 'component:my-input';\n let expectedNamespace = 'my-addon';\n let registry = new _container.Registry();\n let resolveCount = 0;\n let expandedKey = 'boom, special expanded key';\n registry.expandLocalLookup = (specifier, options) => {\n this.assert.strictEqual(specifier, lookup, 'specifier is expanded');\n this.assert.strictEqual(options.namespace, expectedNamespace, 'namespace is expanded');\n return expandedKey;\n };\n registry.resolve = function (fullName) {\n resolveCount++;\n if (fullName === expandedKey) {\n return PrivateComponent;\n }\n };\n\n let container = registry.container();\n\n assert.strictEqual(container.factoryFor(lookup, { namespace: expectedNamespace }).class, PrivateComponent, 'The correct factory was provided');\n assert.strictEqual(container.factoryFor(lookup, { namespace: expectedNamespace }).class, PrivateComponent, 'The correct factory was provided again');\n assert.equal(resolveCount, 1, 'resolve called only once and a cached factory was returned the second time');\n }\n\n ['@test The container can expand and resolve a namespace to lookup']() {\n let PrivateComponent = (0, _internalTestHelpers.factory)();\n let lookup = 'component:my-input';\n let expectedNamespace = 'my-addon';\n let registry = new _container.Registry();\n let expandedKey = 'boom, special expanded key';\n registry.expandLocalLookup = (specifier, options) => {\n this.assert.strictEqual(specifier, lookup, 'specifier is expanded');\n this.assert.strictEqual(options.namespace, expectedNamespace, 'namespace is expanded');\n return expandedKey;\n };\n registry.resolve = function (fullName) {\n if (fullName === expandedKey) {\n return PrivateComponent;\n }\n };\n\n let container = registry.container();\n\n let result = container.lookup(lookup, { namespace: expectedNamespace });\n this.assert.ok(result instanceof PrivateComponent, 'The correct factory was provided');\n\n this.assert.ok(container.cache[expandedKey] instanceof PrivateComponent, 'The correct factory was stored in the cache with the correct key which includes the source.');\n }\n });\n }\n});","enifed('@ember/-internals/container/tests/owner_test', ['@ember/-internals/owner', 'internal-test-helpers'], function (_owner, _internalTestHelpers) {\n 'use strict';\n\n (0, _internalTestHelpers.moduleFor)('Owner', class extends _internalTestHelpers.AbstractTestCase {\n ['@test An owner can be set with `setOwner` and retrieved with `getOwner`'](assert) {\n let owner = {};\n let obj = {};\n\n assert.strictEqual((0, _owner.getOwner)(obj), undefined, 'owner has not been set');\n\n (0, _owner.setOwner)(obj, owner);\n\n assert.strictEqual((0, _owner.getOwner)(obj), owner, 'owner has been set');\n\n assert.strictEqual(obj[_owner.OWNER], owner, 'owner has been set to the OWNER symbol');\n }\n });\n});","enifed('@ember/-internals/container/tests/registry_test', ['@ember/-internals/container', 'internal-test-helpers'], function (_container, _internalTestHelpers) {\n 'use strict';\n\n (0, _internalTestHelpers.moduleFor)('Registry', class extends _internalTestHelpers.AbstractTestCase {\n ['@test A registered factory is returned from resolve'](assert) {\n let registry = new _container.Registry();\n let PostController = (0, _internalTestHelpers.factory)();\n\n registry.register('controller:post', PostController);\n\n let PostControllerFactory = registry.resolve('controller:post');\n\n assert.ok(PostControllerFactory, 'factory is returned');\n assert.ok(PostControllerFactory.create() instanceof PostController, 'The return of factory.create is an instance of PostController');\n }\n\n ['@test The registered factory returned from resolve is the same factory each time'](assert) {\n let registry = new _container.Registry();\n let PostController = (0, _internalTestHelpers.factory)();\n\n registry.register('controller:post', PostController);\n\n assert.deepEqual(registry.resolve('controller:post'), registry.resolve('controller:post'), 'The return of resolve is always the same');\n }\n\n ['@test The registered value returned from resolve is the same value each time even if the value is falsy'](assert) {\n let registry = new _container.Registry();\n\n registry.register('falsy:value', null, { instantiate: false });\n\n assert.strictEqual(registry.resolve('falsy:value'), registry.resolve('falsy:value'), 'The return of resolve is always the same');\n }\n\n ['@test The value returned from resolver is the same value as the original value even if the value is falsy'](assert) {\n let resolver = {\n resolve(fullName) {\n if (fullName === 'falsy:value') {\n return null;\n }\n }\n };\n let registry = new _container.Registry({ resolver });\n\n assert.strictEqual(registry.resolve('falsy:value'), null);\n }\n\n ['@test A registered factory returns true for `has` if an item is registered'](assert) {\n let registry = new _container.Registry();\n let PostController = (0, _internalTestHelpers.factory)();\n\n registry.register('controller:post', PostController);\n\n assert.equal(registry.has('controller:post'), true, 'The `has` method returned true for registered factories');\n assert.equal(registry.has('controller:posts'), false, 'The `has` method returned false for unregistered factories');\n }\n\n ['@test Throw exception when trying to inject `type:thing` on all type(s)']() {\n let registry = new _container.Registry();\n let PostController = (0, _internalTestHelpers.factory)();\n\n registry.register('controller:post', PostController);\n\n expectAssertion(() => {\n registry.typeInjection('controller', 'injected', 'controller:post');\n }, /Cannot inject a 'controller:post' on other controller\\(s\\)\\./);\n }\n\n ['@test The registry can take a hook to resolve factories lazily'](assert) {\n let PostController = (0, _internalTestHelpers.factory)();\n let resolver = {\n resolve(fullName) {\n if (fullName === 'controller:post') {\n return PostController;\n }\n }\n };\n let registry = new _container.Registry({ resolver });\n\n assert.strictEqual(registry.resolve('controller:post'), PostController, 'The correct factory was provided');\n }\n\n ['@test The registry respects the resolver hook for `has`'](assert) {\n let PostController = (0, _internalTestHelpers.factory)();\n let resolver = {\n resolve(fullName) {\n if (fullName === 'controller:post') {\n return PostController;\n }\n }\n };\n let registry = new _container.Registry({ resolver });\n\n assert.ok(registry.has('controller:post'), 'the `has` method uses the resolver hook');\n }\n\n ['@test The registry normalizes names when resolving'](assert) {\n let registry = new _container.Registry();\n let PostController = (0, _internalTestHelpers.factory)();\n\n registry.normalizeFullName = function () {\n return 'controller:post';\n };\n\n registry.register('controller:post', PostController);\n let type = registry.resolve('controller:normalized');\n\n assert.strictEqual(type, PostController, 'Normalizes the name when resolving');\n }\n\n ['@test The registry normalizes names when checking if the factory is registered'](assert) {\n let registry = new _container.Registry();\n let PostController = (0, _internalTestHelpers.factory)();\n\n registry.normalizeFullName = function (fullName) {\n return fullName === 'controller:normalized' ? 'controller:post' : fullName;\n };\n\n registry.register('controller:post', PostController);\n let isPresent = registry.has('controller:normalized');\n\n assert.equal(isPresent, true, 'Normalizes the name when checking if the factory or instance is present');\n }\n\n ['@test The registry normalizes names when injecting'](assert) {\n let registry = new _container.Registry();\n let PostController = (0, _internalTestHelpers.factory)();\n let user = { name: 'Stef' };\n\n registry.normalize = function () {\n return 'controller:post';\n };\n\n registry.register('controller:post', PostController);\n registry.register('user:post', user, { instantiate: false });\n registry.injection('controller:post', 'user', 'controller:normalized');\n\n assert.deepEqual(registry.resolve('controller:post'), user, 'Normalizes the name when injecting');\n }\n\n ['@test cannot register an `undefined` factory'](assert) {\n let registry = new _container.Registry();\n\n assert.throws(() => {\n registry.register('controller:apple', undefined);\n }, '');\n }\n\n ['@test can re-register a factory'](assert) {\n let registry = new _container.Registry();\n let FirstApple = (0, _internalTestHelpers.factory)('first');\n let SecondApple = (0, _internalTestHelpers.factory)('second');\n\n registry.register('controller:apple', FirstApple);\n registry.register('controller:apple', SecondApple);\n\n assert.ok(registry.resolve('controller:apple').create() instanceof SecondApple);\n }\n\n ['@test cannot re-register a factory if it has been resolved'](assert) {\n let registry = new _container.Registry();\n let FirstApple = (0, _internalTestHelpers.factory)('first');\n let SecondApple = (0, _internalTestHelpers.factory)('second');\n\n registry.register('controller:apple', FirstApple);\n assert.strictEqual(registry.resolve('controller:apple'), FirstApple);\n\n expectAssertion(function () {\n registry.register('controller:apple', SecondApple);\n }, /Cannot re-register: 'controller:apple', as it has already been resolved\\./);\n\n assert.strictEqual(registry.resolve('controller:apple'), FirstApple);\n }\n\n ['@test registry.has should not accidentally cause injections on that factory to be run. (Mitigate merely on observing)'](assert) {\n assert.expect(1);\n\n let registry = new _container.Registry();\n let FirstApple = (0, _internalTestHelpers.factory)('first');\n let SecondApple = (0, _internalTestHelpers.factory)('second');\n\n SecondApple.extend = function () {\n assert.ok(false, 'should not extend or touch the injected model, merely to inspect existence of another');\n };\n\n registry.register('controller:apple', FirstApple);\n registry.register('controller:second-apple', SecondApple);\n registry.injection('controller:apple', 'badApple', 'controller:second-apple');\n\n assert.ok(registry.has('controller:apple'));\n }\n\n ['@test registry.has should not error for invalid fullNames'](assert) {\n let registry = new _container.Registry();\n\n assert.ok(!registry.has('foo:bar:baz'));\n }\n\n ['@test once resolved, always return the same result'](assert) {\n let registry = new _container.Registry();\n\n registry.resolver = {\n resolve() {\n return 'bar';\n }\n };\n\n let Bar = registry.resolve('models:bar');\n\n registry.resolver = {\n resolve() {\n return 'not bar';\n }\n };\n\n assert.equal(registry.resolve('models:bar'), Bar);\n }\n\n ['@test factory resolves are cached'](assert) {\n let registry = new _container.Registry();\n let PostController = (0, _internalTestHelpers.factory)();\n let resolveWasCalled = [];\n\n registry.resolver = {\n resolve(fullName) {\n resolveWasCalled.push(fullName);\n return PostController;\n }\n };\n\n assert.deepEqual(resolveWasCalled, []);\n registry.resolve('controller:post');\n assert.deepEqual(resolveWasCalled, ['controller:post']);\n\n registry.resolve('controller:post');\n assert.deepEqual(resolveWasCalled, ['controller:post']);\n }\n\n ['@test factory for non extendables (MODEL) resolves are cached'](assert) {\n let registry = new _container.Registry();\n let PostController = (0, _internalTestHelpers.factory)();\n let resolveWasCalled = [];\n\n registry.resolver = {\n resolve(fullName) {\n resolveWasCalled.push(fullName);\n return PostController;\n }\n };\n\n assert.deepEqual(resolveWasCalled, []);\n registry.resolve('model:post');\n assert.deepEqual(resolveWasCalled, ['model:post']);\n\n registry.resolve('model:post');\n assert.deepEqual(resolveWasCalled, ['model:post']);\n }\n\n ['@test factory for non extendables resolves are cached'](assert) {\n let registry = new _container.Registry();\n let PostController = {};\n let resolveWasCalled = [];\n\n registry.resolver = {\n resolve(fullName) {\n resolveWasCalled.push(fullName);\n return PostController;\n }\n };\n\n assert.deepEqual(resolveWasCalled, []);\n registry.resolve('foo:post');\n assert.deepEqual(resolveWasCalled, ['foo:post']);\n\n registry.resolve('foo:post');\n assert.deepEqual(resolveWasCalled, ['foo:post']);\n }\n\n ['@test registry.container creates a container'](assert) {\n let registry = new _container.Registry();\n let PostController = (0, _internalTestHelpers.factory)();\n registry.register('controller:post', PostController);\n\n let container = registry.container();\n let postController = container.lookup('controller:post');\n\n assert.ok(postController instanceof PostController, 'The lookup is an instance of the registered factory');\n }\n\n ['@test `describe` will be handled by the resolver, then by the fallback registry, if available'](assert) {\n let fallback = {\n describe(fullName) {\n return `${fullName}-fallback`;\n }\n };\n\n let resolver = {\n lookupDescription(fullName) {\n return `${fullName}-resolver`;\n }\n };\n\n let registry = new _container.Registry({ fallback, resolver });\n\n assert.equal(registry.describe('controller:post'), 'controller:post-resolver', '`describe` handled by the resolver first.');\n\n registry.resolver = null;\n\n assert.equal(registry.describe('controller:post'), 'controller:post-fallback', '`describe` handled by fallback registry next.');\n\n registry.fallback = null;\n\n assert.equal(registry.describe('controller:post'), 'controller:post', '`describe` by default returns argument.');\n }\n\n ['@test `normalizeFullName` will be handled by the resolver, then by the fallback registry, if available'](assert) {\n let fallback = {\n normalizeFullName(fullName) {\n return `${fullName}-fallback`;\n }\n };\n\n let resolver = {\n normalize(fullName) {\n return `${fullName}-resolver`;\n }\n };\n\n let registry = new _container.Registry({ fallback, resolver });\n\n assert.equal(registry.normalizeFullName('controller:post'), 'controller:post-resolver', '`normalizeFullName` handled by the resolver first.');\n\n registry.resolver = null;\n\n assert.equal(registry.normalizeFullName('controller:post'), 'controller:post-fallback', '`normalizeFullName` handled by fallback registry next.');\n\n registry.fallback = null;\n\n assert.equal(registry.normalizeFullName('controller:post'), 'controller:post', '`normalizeFullName` by default returns argument.');\n }\n\n ['@test `makeToString` will be handled by the resolver, then by the fallback registry, if available'](assert) {\n let fallback = {\n makeToString(fullName) {\n return `${fullName}-fallback`;\n }\n };\n\n let resolver = {\n makeToString(fullName) {\n return `${fullName}-resolver`;\n }\n };\n\n let registry = new _container.Registry({ fallback, resolver });\n\n assert.equal(registry.makeToString('controller:post'), 'controller:post-resolver', '`makeToString` handled by the resolver first.');\n\n registry.resolver = null;\n\n assert.equal(registry.makeToString('controller:post'), 'controller:post-fallback', '`makeToString` handled by fallback registry next.');\n\n registry.fallback = null;\n\n assert.equal(registry.makeToString('controller:post'), 'controller:post', '`makeToString` by default returns argument.');\n }\n\n ['@test `resolve` can be handled by a fallback registry'](assert) {\n let fallback = new _container.Registry();\n\n let registry = new _container.Registry({ fallback: fallback });\n let PostController = (0, _internalTestHelpers.factory)();\n\n fallback.register('controller:post', PostController);\n\n let PostControllerFactory = registry.resolve('controller:post');\n\n assert.ok(PostControllerFactory, 'factory is returned');\n assert.ok(PostControllerFactory.create() instanceof PostController, 'The return of factory.create is an instance of PostController');\n }\n\n ['@test `has` can be handled by a fallback registry'](assert) {\n let fallback = new _container.Registry();\n\n let registry = new _container.Registry({ fallback: fallback });\n let PostController = (0, _internalTestHelpers.factory)();\n\n fallback.register('controller:post', PostController);\n\n assert.equal(registry.has('controller:post'), true, 'Fallback registry is checked for registration');\n }\n\n ['@test `getInjections` includes injections from a fallback registry'](assert) {\n let fallback = new _container.Registry();\n let registry = new _container.Registry({ fallback: fallback });\n\n assert.strictEqual(registry.getInjections('model:user'), undefined, 'No injections in the primary registry');\n\n fallback.injection('model:user', 'post', 'model:post');\n\n assert.equal(registry.getInjections('model:user').length, 1, 'Injections from the fallback registry are merged');\n }\n\n ['@test `getTypeInjections` includes type injections from a fallback registry'](assert) {\n let fallback = new _container.Registry();\n let registry = new _container.Registry({ fallback: fallback });\n\n assert.strictEqual(registry.getTypeInjections('model'), undefined, 'No injections in the primary registry');\n\n fallback.injection('model', 'source', 'source:main');\n\n assert.equal(registry.getTypeInjections('model').length, 1, 'Injections from the fallback registry are merged');\n }\n\n ['@test `knownForType` contains keys for each item of a given type'](assert) {\n let registry = new _container.Registry();\n\n registry.register('foo:bar-baz', 'baz');\n registry.register('foo:qux-fez', 'fez');\n\n let found = registry.knownForType('foo');\n\n assert.deepEqual(found, {\n 'foo:bar-baz': true,\n 'foo:qux-fez': true\n });\n }\n\n ['@test `knownForType` includes fallback registry results'](assert) {\n let fallback = new _container.Registry();\n let registry = new _container.Registry({ fallback: fallback });\n\n registry.register('foo:bar-baz', 'baz');\n registry.register('foo:qux-fez', 'fez');\n fallback.register('foo:zurp-zorp', 'zorp');\n\n let found = registry.knownForType('foo');\n\n assert.deepEqual(found, {\n 'foo:bar-baz': true,\n 'foo:qux-fez': true,\n 'foo:zurp-zorp': true\n });\n }\n\n ['@test `knownForType` is called on the resolver if present'](assert) {\n assert.expect(3);\n\n let resolver = {\n knownForType(type) {\n assert.ok(true, 'knownForType called on the resolver');\n assert.equal(type, 'foo', 'the type was passed through');\n\n return { 'foo:yorp': true };\n }\n };\n\n let registry = new _container.Registry({\n resolver\n });\n registry.register('foo:bar-baz', 'baz');\n\n let found = registry.knownForType('foo');\n\n assert.deepEqual(found, {\n 'foo:yorp': true,\n 'foo:bar-baz': true\n });\n }\n\n ['@test resolver.expandLocalLookup is not required'](assert) {\n let registry = new _container.Registry({\n resolver: {}\n });\n\n let result = registry.expandLocalLookup('foo:bar', {\n source: 'baz:qux'\n });\n\n assert.equal(result, null);\n }\n\n ['@test expandLocalLookup is called on the resolver if present'](assert) {\n assert.expect(4);\n\n let resolver = {\n expandLocalLookup: (targetFullName, sourceFullName) => {\n assert.ok(true, 'expandLocalLookup is called on the resolver');\n assert.equal(targetFullName, 'foo:bar', 'the targetFullName was passed through');\n assert.equal(sourceFullName, 'baz:qux', 'the sourceFullName was passed through');\n\n return 'foo:qux/bar';\n }\n };\n\n let registry = new _container.Registry({\n resolver\n });\n\n let result = registry.expandLocalLookup('foo:bar', {\n source: 'baz:qux'\n });\n\n assert.equal(result, 'foo:qux/bar');\n }\n\n ['@test `expandLocalLookup` is handled by the resolver, then by the fallback registry, if available'](assert) {\n assert.expect(9);\n\n let fallbackResolver = {\n expandLocalLookup: (targetFullName, sourceFullName) => {\n assert.ok(true, 'expandLocalLookup is called on the fallback resolver');\n assert.equal(targetFullName, 'foo:bar', 'the targetFullName was passed through');\n assert.equal(sourceFullName, 'baz:qux', 'the sourceFullName was passed through');\n\n return 'foo:qux/bar-fallback';\n }\n };\n\n let resolver = {\n expandLocalLookup: (targetFullName, sourceFullName) => {\n assert.ok(true, 'expandLocalLookup is called on the resolver');\n assert.equal(targetFullName, 'foo:bar', 'the targetFullName was passed through');\n assert.equal(sourceFullName, 'baz:qux', 'the sourceFullName was passed through');\n\n return 'foo:qux/bar-resolver';\n }\n };\n\n let fallbackRegistry = new _container.Registry({\n resolver: fallbackResolver\n });\n\n let registry = new _container.Registry({\n fallback: fallbackRegistry,\n resolver\n });\n\n let result = registry.expandLocalLookup('foo:bar', {\n source: 'baz:qux'\n });\n\n assert.equal(result, 'foo:qux/bar-resolver', 'handled by the resolver');\n\n registry.resolver = null;\n\n result = registry.expandLocalLookup('foo:bar', {\n source: 'baz:qux'\n });\n\n assert.equal(result, 'foo:qux/bar-fallback', 'handled by the fallback registry');\n\n registry.fallback = null;\n\n result = registry.expandLocalLookup('foo:bar', {\n source: 'baz:qux'\n });\n\n assert.equal(result, null, 'null is returned by default when no resolver or fallback registry is present');\n }\n\n ['@test resolver.expandLocalLookup result is cached'](assert) {\n assert.expect(3);\n let result;\n\n let resolver = {\n expandLocalLookup: () => {\n assert.ok(true, 'expandLocalLookup is called on the resolver');\n\n return 'foo:qux/bar';\n }\n };\n\n let registry = new _container.Registry({\n resolver\n });\n\n result = registry.expandLocalLookup('foo:bar', {\n source: 'baz:qux'\n });\n\n assert.equal(result, 'foo:qux/bar');\n\n result = registry.expandLocalLookup('foo:bar', {\n source: 'baz:qux'\n });\n\n assert.equal(result, 'foo:qux/bar');\n }\n\n ['@test resolver.expandLocalLookup cache is busted when any unregister is called'](assert) {\n assert.expect(4);\n let result;\n\n let resolver = {\n expandLocalLookup: () => {\n assert.ok(true, 'expandLocalLookup is called on the resolver');\n\n return 'foo:qux/bar';\n }\n };\n\n let registry = new _container.Registry({\n resolver\n });\n\n result = registry.expandLocalLookup('foo:bar', {\n source: 'baz:qux'\n });\n\n assert.equal(result, 'foo:qux/bar');\n\n registry.unregister('foo:bar');\n\n result = registry.expandLocalLookup('foo:bar', {\n source: 'baz:qux'\n });\n\n assert.equal(result, 'foo:qux/bar');\n }\n\n ['@test resolve calls expandLocallookup when it receives options.source'](assert) {\n assert.expect(3);\n\n let resolver = {\n resolve() {},\n expandLocalLookup: (targetFullName, sourceFullName) => {\n assert.ok(true, 'expandLocalLookup is called on the resolver');\n assert.equal(targetFullName, 'foo:bar', 'the targetFullName was passed through');\n assert.equal(sourceFullName, 'baz:qux', 'the sourceFullName was passed through');\n\n return 'foo:qux/bar';\n }\n };\n\n let registry = new _container.Registry({\n resolver\n });\n\n registry.resolve('foo:bar', {\n source: 'baz:qux'\n });\n }\n\n ['@test has uses expandLocalLookup'](assert) {\n assert.expect(5);\n let resolvedFullNames = [];\n let result;\n\n let resolver = {\n resolve(name) {\n resolvedFullNames.push(name);\n return 'yippie!';\n },\n\n expandLocalLookup: targetFullName => {\n assert.ok(true, 'expandLocalLookup is called on the resolver');\n\n if (targetFullName === 'foo:bar') {\n return 'foo:qux/bar';\n } else {\n return null;\n }\n }\n };\n\n let registry = new _container.Registry({\n resolver\n });\n\n result = registry.has('foo:bar', {\n source: 'baz:qux'\n });\n\n assert.ok(result, 'found foo:bar/qux');\n\n result = registry.has('foo:baz', {\n source: 'baz:qux'\n });\n\n assert.ok(!result, 'foo:baz/qux not found');\n\n assert.deepEqual(['foo:qux/bar'], resolvedFullNames);\n }\n });\n\n (0, _internalTestHelpers.moduleFor)('Registry privatize', class extends _internalTestHelpers.AbstractTestCase {\n ['@test valid format'](assert) {\n let privatized = (0, _container.privatize)(['secret:factory']);\n let matched = privatized.match(/^([^:]+):([^:]+)-(\\d+)$/);\n\n assert.ok(matched, 'privatized format was recognized');\n assert.equal(matched[1], 'secret');\n assert.equal(matched[2], 'factory');\n assert.ok(/^\\d+$/.test(matched[3]));\n }\n });\n\n if (false /* EMBER_MODULE_UNIFICATION */) {\n (0, _internalTestHelpers.moduleFor)('Registry module unification', class extends _internalTestHelpers.AbstractTestCase {\n ['@test The registry can pass a source to the resolver'](assert) {\n let PrivateComponent = (0, _internalTestHelpers.factory)();\n let type = 'component';\n let name = 'my-input';\n let specifier = `${type}:${name}`;\n let source = 'template:routes/application';\n\n let resolver = new _internalTestHelpers.ModuleBasedTestResolver();\n resolver.add({ specifier, source }, PrivateComponent);\n let registry = new _container.Registry({ resolver });\n\n assert.strictEqual(registry.resolve(specifier), undefined, 'Not returned when specifier not scoped');\n assert.strictEqual(registry.resolve(specifier, { source }), PrivateComponent, 'The correct factory was provided');\n assert.strictEqual(registry.resolve(specifier, { source }), PrivateComponent, 'The correct factory was provided again');\n }\n\n ['@test The registry can pass a namespace to the resolver'](assert) {\n let PrivateComponent = (0, _internalTestHelpers.factory)();\n let type = 'component';\n let name = 'my-input';\n let specifier = `${type}:${name}`;\n let source = 'template:routes/application';\n let namespace = 'my-addon';\n\n let resolver = new _internalTestHelpers.ModuleBasedTestResolver();\n resolver.add({ specifier, source, namespace }, PrivateComponent);\n let registry = new _container.Registry({ resolver });\n\n assert.strictEqual(registry.resolve(specifier), undefined, 'Not returned when specifier not scoped');\n assert.strictEqual(registry.resolve(specifier, { source }), undefined, 'Not returned when specifier is missing namespace');\n assert.strictEqual(registry.resolve(specifier, { source, namespace }), PrivateComponent, 'The correct factory was provided');\n assert.strictEqual(registry.resolve(specifier, { source, namespace }), PrivateComponent, 'The correct factory was provided again');\n }\n });\n }\n});","enifed('@ember/-internals/extension-support/tests/container_debug_adapter_test', ['internal-test-helpers', '@ember/polyfills', '@ember/runloop', '@ember/controller', '@ember/debug', '@ember/-internals/extension-support/index'], function (_internalTestHelpers, _polyfills, _runloop, _controller, _debug) {\n 'use strict';\n\n const originalDebug = (0, _debug.getDebugFunction)('debug'); // Must be required to export Ember.ContainerDebugAdapter.\n\n\n (0, _internalTestHelpers.moduleFor)('Container Debug Adapter', class extends _internalTestHelpers.ApplicationTestCase {\n constructor() {\n (0, _debug.setDebugFunction)('debug', () => {});\n super();\n this.adapter = this.application.__deprecatedInstance__.lookup('container-debug-adapter:main');\n }\n\n get applicationOptions() {\n return (0, _polyfills.assign)(super.applicationOptions, {\n autoboot: true\n });\n }\n\n teardown() {\n (0, _debug.setDebugFunction)('debug', originalDebug);\n (0, _runloop.run)(() => {\n this.adapter.destroy();\n });\n\n super.teardown();\n }\n\n ['@test default ContainerDebugAdapter cannot catalog certain entries by type'](assert) {\n assert.equal(this.adapter.canCatalogEntriesByType('model'), false, 'canCatalogEntriesByType should return false for model');\n assert.equal(this.adapter.canCatalogEntriesByType('template'), false, 'canCatalogEntriesByType should return false for template');\n }\n\n ['@test default ContainerDebugAdapter can catalog typical entries by type'](assert) {\n assert.equal(this.adapter.canCatalogEntriesByType('controller'), true, 'canCatalogEntriesByType should return true for controller');\n assert.equal(this.adapter.canCatalogEntriesByType('route'), true, 'canCatalogEntriesByType should return true for route');\n assert.equal(this.adapter.canCatalogEntriesByType('view'), true, 'canCatalogEntriesByType should return true for view');\n }\n\n ['@test default ContainerDebugAdapter catalogs controller entries'](assert) {\n this.application.PostController = _controller.default.extend();\n let controllerClasses = this.adapter.catalogEntriesByType('controller');\n\n assert.equal(controllerClasses.length, 1, 'found 1 class');\n assert.equal(controllerClasses[0], 'post', 'found the right class');\n }\n });\n});","enifed('@ember/-internals/extension-support/tests/data_adapter_test', ['@ember/runloop', '@ember/-internals/metal', '@ember/-internals/runtime', '@ember/-internals/extension-support/lib/data_adapter', 'internal-test-helpers'], function (_runloop, _metal, _runtime, _data_adapter, _internalTestHelpers) {\n 'use strict';\n\n let adapter;\n const Model = _runtime.Object.extend();\n\n const PostClass = Model.extend();\n\n const DataAdapter = _data_adapter.default.extend({\n detect(klass) {\n return klass !== Model && Model.detect(klass);\n },\n init() {\n this._super(...arguments);\n this.set('containerDebugAdapter', {\n canCatalogEntriesByType() {\n return true;\n },\n catalogEntriesByType() {\n return (0, _runtime.A)(['post']);\n }\n });\n }\n });\n\n (0, _internalTestHelpers.moduleFor)('Data Adapter', class extends _internalTestHelpers.ApplicationTestCase {\n teardown() {\n super.teardown();\n adapter = undefined;\n }\n\n ['@test Model types added'](assert) {\n this.add('data-adapter:main', DataAdapter.extend({\n getRecords() {\n return (0, _runtime.A)([1, 2, 3]);\n },\n columnsForType() {\n return [{ name: 'title', desc: 'Title' }];\n }\n }));\n this.add('model:post', PostClass);\n\n return this.visit('/').then(() => {\n let adapter = this.applicationInstance.lookup('data-adapter:main');\n\n function modelTypesAdded(types) {\n assert.equal(types.length, 1);\n let postType = types[0];\n assert.equal(postType.name, 'post', 'Correctly sets the name');\n assert.equal(postType.count, 3, 'Correctly sets the record count');\n assert.strictEqual(postType.object, PostClass, 'Correctly sets the object');\n assert.deepEqual(postType.columns, [{ name: 'title', desc: 'Title' }], 'Correctly sets the columns');\n }\n\n adapter.watchModelTypes(modelTypesAdded);\n });\n }\n\n ['@test getRecords gets a model name as second argument'](assert) {\n this.add('data-adapter:main', DataAdapter.extend({\n getRecords(klass, name) {\n assert.equal(name, 'post');\n return (0, _runtime.A)();\n }\n }));\n this.add('model:post', PostClass);\n\n return this.visit('/').then(() => {\n adapter = this.applicationInstance.lookup('data-adapter:main');\n adapter.watchModelTypes(function () {});\n });\n }\n\n ['@test Model types added with custom container-debug-adapter'](assert) {\n let StubContainerDebugAdapter = _runtime.Object.extend({\n canCatalogEntriesByType() {\n return true;\n },\n catalogEntriesByType() {\n return (0, _runtime.A)(['post']);\n }\n });\n this.add('container-debug-adapter:main', StubContainerDebugAdapter);\n this.add('data-adapter:main', DataAdapter.extend({\n getRecords() {\n return (0, _runtime.A)([1, 2, 3]);\n },\n columnsForType() {\n return [{ name: 'title', desc: 'Title' }];\n }\n }));\n this.add('model:post', PostClass);\n\n return this.visit('/').then(() => {\n let adapter = this.applicationInstance.lookup('data-adapter:main');\n\n function modelTypesAdded(types) {\n assert.equal(types.length, 1);\n let postType = types[0];\n assert.equal(postType.name, 'post', 'Correctly sets the name');\n assert.equal(postType.count, 3, 'Correctly sets the record count');\n assert.strictEqual(postType.object, PostClass, 'Correctly sets the object');\n assert.deepEqual(postType.columns, [{ name: 'title', desc: 'Title' }], 'Correctly sets the columns');\n }\n\n adapter.watchModelTypes(modelTypesAdded);\n });\n }\n\n ['@test Model Types Updated'](assert) {\n let records = (0, _runtime.A)([1, 2, 3]);\n this.add('data-adapter:main', DataAdapter.extend({\n getRecords() {\n return records;\n }\n }));\n this.add('model:post', PostClass);\n\n return this.visit('/').then(() => {\n adapter = this.applicationInstance.lookup('data-adapter:main');\n\n function modelTypesAdded() {\n (0, _runloop.run)(() => {\n records.pushObject(4);\n });\n }\n\n function modelTypesUpdated(types) {\n let postType = types[0];\n assert.equal(postType.count, 4, 'Correctly updates the count');\n }\n\n adapter.watchModelTypes(modelTypesAdded, modelTypesUpdated);\n });\n }\n\n ['@test Model Types Updated but Unchanged Do not Trigger Callbacks'](assert) {\n assert.expect(0);\n let records = (0, _runtime.A)([1, 2, 3]);\n this.add('data-adapter:main', DataAdapter.extend({\n getRecords() {\n return records;\n }\n }));\n this.add('model:post', PostClass);\n\n return this.visit('/').then(() => {\n adapter = this.applicationInstance.lookup('data-adapter:main');\n\n function modelTypesAdded() {\n (0, _runloop.run)(() => {\n records.arrayContentDidChange(0, 0, 0);\n });\n }\n\n function modelTypesUpdated() {\n assert.ok(false, \"modelTypesUpdated should not be triggered if the array didn't change\");\n }\n\n adapter.watchModelTypes(modelTypesAdded, modelTypesUpdated);\n });\n }\n\n ['@test Records Added'](assert) {\n let countAdded = 1;\n let post = PostClass.create();\n let recordList = (0, _runtime.A)([post]);\n\n this.add('data-adapter:main', DataAdapter.extend({\n getRecords() {\n return recordList;\n },\n getRecordColor() {\n return 'blue';\n },\n getRecordColumnValues() {\n return { title: 'Post ' + countAdded };\n },\n getRecordKeywords() {\n return ['Post ' + countAdded];\n }\n }));\n this.add('model:post', PostClass);\n\n return this.visit('/').then(() => {\n adapter = this.applicationInstance.lookup('data-adapter:main');\n\n function recordsAdded(records) {\n let record = records[0];\n assert.equal(record.color, 'blue', 'Sets the color correctly');\n assert.deepEqual(record.columnValues, { title: 'Post ' + countAdded }, 'Sets the column values correctly');\n assert.deepEqual(record.searchKeywords, ['Post ' + countAdded], 'Sets search keywords correctly');\n assert.strictEqual(record.object, post, 'Sets the object to the record instance');\n }\n\n adapter.watchRecords('post', recordsAdded);\n countAdded++;\n post = PostClass.create();\n recordList.pushObject(post);\n });\n }\n\n ['@test Observes and releases a record correctly'](assert) {\n let updatesCalled = 0;\n let post = PostClass.create({ title: 'Post' });\n let recordList = (0, _runtime.A)([post]);\n\n this.add('data-adapter:main', DataAdapter.extend({\n getRecords() {\n return recordList;\n },\n observeRecord(record, recordUpdated) {\n let self = this;\n function callback() {\n recordUpdated(self.wrapRecord(record));\n }\n (0, _metal.addObserver)(record, 'title', callback);\n return function () {\n (0, _metal.removeObserver)(record, 'title', callback);\n };\n },\n getRecordColumnValues(record) {\n return { title: (0, _metal.get)(record, 'title') };\n }\n }));\n this.add('model:post', PostClass);\n\n return this.visit('/').then(() => {\n adapter = this.applicationInstance.lookup('data-adapter:main');\n\n function recordsAdded() {\n (0, _metal.set)(post, 'title', 'Post Modified');\n }\n\n function recordsUpdated(records) {\n updatesCalled++;\n assert.equal(records[0].columnValues.title, 'Post Modified');\n }\n\n let release = adapter.watchRecords('post', recordsAdded, recordsUpdated);\n release();\n (0, _metal.set)(post, 'title', 'New Title');\n assert.equal(updatesCalled, 1, 'Release function removes observers');\n });\n }\n\n ['@test _nameToClass does not error when not found'](assert) {\n this.add('data-adapter:main', DataAdapter);\n\n return this.visit('/').then(() => {\n adapter = this.applicationInstance.lookup('data-adapter:main');\n\n let klass = adapter._nameToClass('foo');\n\n assert.equal(klass, undefined, 'returns undefined');\n });\n }\n });\n});","enifed('@ember/-internals/glimmer/tests/integration/application/actions-test', ['@ember/controller', '@ember/-internals/glimmer/tests/utils/test-case', '@ember/-internals/glimmer/tests/utils/helpers', '@ember/debug'], function (_controller, _testCase, _helpers, _debug) {\n 'use strict';\n\n const originalDebug = (0, _debug.getDebugFunction)('debug');\n const noop = function () {};\n\n (0, _testCase.moduleFor)('Application test: actions', class extends _testCase.ApplicationTest {\n constructor() {\n (0, _debug.setDebugFunction)('debug', noop);\n super(...arguments);\n }\n\n teardown() {\n (0, _debug.setDebugFunction)('debug', originalDebug);\n }\n\n ['@test actions in top level template application template target application controller'](assert) {\n assert.expect(1);\n\n this.add('controller:application', _controller.default.extend({\n actions: {\n handleIt() {\n assert.ok(true, 'controller received action properly');\n }\n }\n }));\n\n this.addTemplate('application', '');\n\n return this.visit('/').then(() => {\n this.runTask(() => this.$('#handle-it').click());\n });\n }\n\n ['@test actions in nested outlet template target their controller'](assert) {\n assert.expect(1);\n\n this.add('controller:application', _controller.default.extend({\n actions: {\n handleIt() {\n assert.ok(false, 'application controller should not have received action!');\n }\n }\n }));\n\n this.add('controller:index', _controller.default.extend({\n actions: {\n handleIt() {\n assert.ok(true, 'controller received action properly');\n }\n }\n }));\n\n this.addTemplate('index', '');\n\n return this.visit('/').then(() => {\n this.runTask(() => this.$('#handle-it').click());\n });\n }\n });\n\n (0, _testCase.moduleFor)('Rendering test: non-interactive actions', class extends _testCase.RenderingTest {\n getBootOptions() {\n return { isInteractive: false };\n }\n\n [`@test doesn't attatch actions`](assert) {\n this.registerComponent('foo-bar', {\n ComponentClass: _helpers.Component.extend({\n actions: {\n fire() {\n assert.ok(false);\n }\n }\n }),\n template: ``\n });\n\n this.render('{{foo-bar tagName=\"\"}}');\n\n this.assertHTML('');\n\n this.$('button').click();\n }\n });\n});","enifed('@ember/-internals/glimmer/tests/integration/application/engine-test', ['@ember/-internals/glimmer/tests/utils/test-case', '@ember/-internals/glimmer/tests/utils/abstract-test-case', '@ember/-internals/glimmer/tests/utils/helpers', '@ember/controller', '@ember/-internals/runtime', '@ember/-internals/glimmer', '@ember/engine', '@ember/-internals/routing', '@ember/runloop'], function (_testCase, _abstractTestCase, _helpers, _controller, _runtime, _glimmer, _engine, _routing, _runloop) {\n 'use strict';\n\n (0, _testCase.moduleFor)('Application test: engine rendering', class extends _testCase.ApplicationTest {\n get routerOptions() {\n return {\n location: 'none',\n setupRouter() {\n this._super(...arguments);\n let getRoute = this._routerMicrolib.getRoute;\n this._enginePromises = Object.create(null);\n this._resolvedEngines = Object.create(null);\n\n this._routerMicrolib.getRoute = name => {\n let engineInfo = this._engineInfoByRoute[name];\n if (!engineInfo) {\n return getRoute(name);\n }\n\n let engineName = engineInfo.name;\n if (this._resolvedEngines[engineName]) {\n return getRoute(name);\n }\n\n let enginePromise = this._enginePromises[engineName];\n\n if (!enginePromise) {\n enginePromise = new _runtime.RSVP.Promise(resolve => {\n setTimeout(() => {\n this._resolvedEngines[engineName] = true;\n\n resolve();\n }, 1);\n });\n this._enginePromises[engineName] = enginePromise;\n }\n\n return enginePromise.then(() => getRoute(name));\n };\n }\n };\n }\n\n setupAppAndRoutableEngine(hooks = []) {\n let self = this;\n\n this.addTemplate('application', 'Application{{outlet}}');\n\n this.router.map(function () {\n this.mount('blog');\n });\n this.add('route-map:blog', function () {\n this.route('post', function () {\n this.route('comments');\n this.route('likes');\n });\n this.route('category', { path: 'category/:id' });\n this.route('author', { path: 'author/:id' });\n });\n this.add('route:application', _routing.Route.extend({\n model() {\n hooks.push('application - application');\n }\n }));\n\n this.add('engine:blog', _engine.default.extend({\n init() {\n this._super(...arguments);\n this.register('controller:application', _controller.default.extend({\n queryParams: ['lang'],\n lang: ''\n }));\n this.register('controller:category', _controller.default.extend({\n queryParams: ['type']\n }));\n this.register('controller:authorKtrl', _controller.default.extend({\n queryParams: ['official']\n }));\n this.register('template:application', (0, _helpers.compile)('Engine{{lang}}{{outlet}}'));\n this.register('route:application', _routing.Route.extend({\n model() {\n hooks.push('engine - application');\n }\n }));\n this.register('route:author', _routing.Route.extend({\n controllerName: 'authorKtrl'\n }));\n\n if (self._additionalEngineRegistrations) {\n self._additionalEngineRegistrations.call(this);\n }\n }\n }));\n }\n\n setupAppAndRoutelessEngine(hooks) {\n this.setupRoutelessEngine(hooks);\n\n this.add('engine:chat-engine', _engine.default.extend({\n init() {\n this._super(...arguments);\n this.register('template:application', (0, _helpers.compile)('Engine'));\n this.register('controller:application', _controller.default.extend({\n init() {\n this._super(...arguments);\n hooks.push('engine - application');\n }\n }));\n }\n }));\n }\n\n setupAppAndRoutableEngineWithPartial(hooks) {\n this.addTemplate('application', 'Application{{outlet}}');\n\n this.router.map(function () {\n this.mount('blog');\n });\n this.add('route-map:blog', function () {});\n this.add('route:application', _routing.Route.extend({\n model() {\n hooks.push('application - application');\n }\n }));\n\n this.add('engine:blog', _engine.default.extend({\n init() {\n this._super(...arguments);\n this.register('template:foo', (0, _helpers.compile)('foo partial'));\n this.register('template:application', (0, _helpers.compile)('Engine{{outlet}} {{partial \"foo\"}}'));\n this.register('route:application', _routing.Route.extend({\n model() {\n hooks.push('engine - application');\n }\n }));\n }\n }));\n }\n\n setupRoutelessEngine(hooks) {\n this.addTemplate('application', 'Application{{mount \"chat-engine\"}}');\n this.add('route:application', _routing.Route.extend({\n model() {\n hooks.push('application - application');\n }\n }));\n }\n\n setupAppAndRoutlessEngineWithPartial(hooks) {\n this.setupRoutelessEngine(hooks);\n\n this.add('engine:chat-engine', _engine.default.extend({\n init() {\n this._super(...arguments);\n this.register('template:foo', (0, _helpers.compile)('foo partial'));\n this.register('template:application', (0, _helpers.compile)('Engine {{partial \"foo\"}}'));\n this.register('controller:application', _controller.default.extend({\n init() {\n this._super(...arguments);\n hooks.push('engine - application');\n }\n }));\n }\n }));\n }\n\n additionalEngineRegistrations(callback) {\n this._additionalEngineRegistrations = callback;\n }\n\n setupEngineWithAttrs() {\n this.addTemplate('application', 'Application{{mount \"chat-engine\"}}');\n\n this.add('engine:chat-engine', _engine.default.extend({\n init() {\n this._super(...arguments);\n this.register('template:components/foo-bar', (0, _helpers.compile)(`{{partial \"troll\"}}`));\n this.register('template:troll', (0, _helpers.compile)('{{attrs.wat}}'));\n this.register('controller:application', _controller.default.extend({\n contextType: 'Engine'\n }));\n this.register('template:application', (0, _helpers.compile)('Engine {{foo-bar wat=contextType}}'));\n }\n }));\n }\n\n stringsEndWith(str, suffix) {\n return str.indexOf(suffix, str.length - suffix.length) !== -1;\n }\n\n ['@test attrs in an engine']() {\n this.setupEngineWithAttrs([]);\n\n return this.visit('/').then(() => {\n this.assertText('ApplicationEngine Engine');\n });\n }\n\n ['@test sharing a template between engine and application has separate refinements']() {\n this.assert.expect(1);\n\n let sharedTemplate = (0, _helpers.compile)(_abstractTestCase.strip`\n
'\n });\n\n this.render('{{x-outer}}');\n\n assert.equal(this.$('#inner-value').text(), '1', 'initial render of inner');\n assert.equal(this.$('#middle-value').text(), '', 'initial render of middle (observers do not run during init)');\n\n this.runTask(() => this.rerender());\n\n assert.equal(this.$('#inner-value').text(), '1', 'initial render of inner');\n assert.equal(this.$('#middle-value').text(), '', 'initial render of middle (observers do not run during init)');\n\n let expectedBacktrackingMessage = /modified \"value\" twice on <.+?> in a single render\\. It was rendered in \"component:x-middle\" and modified in \"component:x-inner\"/;\n\n expectAssertion(() => {\n this.runTask(() => outer.set('value', 2));\n }, expectedBacktrackingMessage);\n }\n\n [\"@test when a shared dependency is changed during children's rendering\"]() {\n this.registerComponent('x-outer', {\n ComponentClass: _helpers.Component.extend({\n value: 1,\n wrapper: _runtime.Object.create({ content: null })\n }),\n template: '
`\n });\n\n this.render(`{{hi-mom}}`);\n\n let { parentElement, firstNode, lastNode } = (0, _views.getViewBounds)(component);\n\n assert.equal(parentElement, this.element, 'a regular component should have the right parentElement');\n assert.equal(firstNode, component.element, 'a regular component should have a single node that is its element');\n assert.equal(lastNode, component.element, 'a regular component should have a single node that is its element');\n }\n\n ['@test getViewBounds on a tagless component'](assert) {\n let component;\n this.registerComponent('hi-mom', {\n ComponentClass: _helpers.Component.extend({\n tagName: '',\n init() {\n this._super(...arguments);\n component = this;\n }\n }),\n template: `Hi,mom!`\n });\n\n this.render(`{{hi-mom}}`);\n\n let { parentElement, firstNode, lastNode } = (0, _views.getViewBounds)(component);\n\n assert.equal(parentElement, this.element, 'a tagless component should have the right parentElement');\n assert.equal(firstNode, this.$('#start-node')[0], 'a tagless component should have a range enclosing all of its nodes');\n assert.equal(lastNode, this.$('#before-end-node')[0].nextSibling, 'a tagless component should have a range enclosing all of its nodes');\n }\n\n ['@test getViewClientRects'](assert) {\n if (!hasGetClientRects || !ClientRectListCtor) {\n assert.ok(true, 'The test environment does not support the DOM API required to run this test.');\n return;\n }\n\n let component;\n this.registerComponent('hi-mom', {\n ComponentClass: _helpers.Component.extend({\n init() {\n this._super(...arguments);\n component = this;\n }\n }),\n template: `
Hi, mom!
`\n });\n\n this.render(`{{hi-mom}}`);\n\n assert.ok((0, _views.getViewClientRects)(component) instanceof ClientRectListCtor);\n }\n\n ['@test getViewBoundingClientRect'](assert) {\n if (!hasGetBoundingClientRect || !ClientRectCtor) {\n assert.ok(true, 'The test environment does not support the DOM API required to run this test.');\n return;\n }\n\n let component;\n this.registerComponent('hi-mom', {\n ComponentClass: _helpers.Component.extend({\n init() {\n this._super(...arguments);\n component = this;\n }\n }),\n template: `
Hi, mom!
`\n });\n\n this.render(`{{hi-mom}}`);\n\n assert.ok((0, _views.getViewBoundingClientRect)(component) instanceof ClientRectCtor);\n }\n });\n});","enifed('@ember/-internals/glimmer/tests/integration/components/web-component-fallback-test', ['@ember/-internals/glimmer/tests/utils/test-case', '@ember/-internals/metal'], function (_testCase, _metal) {\n 'use strict';\n\n (0, _testCase.moduleFor)('Components test: web component fallback', class extends _testCase.RenderingTest {\n ['@test custom elements are rendered']() {\n let template = `hello`;\n\n this.render(template);\n\n this.assertHTML(template);\n\n this.assertStableRerender();\n }\n\n ['@test custom elements can have bound attributes']() {\n let template = `hello`;\n\n this.render(template, { name: 'Robert' });\n\n this.assertHTML(`hello`);\n\n this.assertStableRerender();\n\n this.runTask(() => (0, _metal.set)(this.context, 'name', 'Kris'));\n\n this.assertHTML(`hello`);\n\n this.runTask(() => (0, _metal.set)(this.context, 'name', 'Robert'));\n\n this.assertHTML(`hello`);\n }\n });\n});","enifed('@ember/-internals/glimmer/tests/integration/components/will-destroy-element-hook-test', ['@ember/-internals/metal', '@ember/-internals/glimmer/tests/utils/helpers', '@ember/-internals/glimmer/tests/utils/test-case'], function (_metal, _helpers, _testCase) {\n 'use strict';\n\n (0, _testCase.moduleFor)('Component willDestroyElement hook', class extends _testCase.RenderingTest {\n ['@test it calls willDestroyElement when removed by if'](assert) {\n let didInsertElementCount = 0;\n let willDestroyElementCount = 0;\n let FooBarComponent = _helpers.Component.extend({\n didInsertElement() {\n didInsertElementCount++;\n assert.notEqual(this.element.parentNode, null, 'precond component is in DOM');\n },\n willDestroyElement() {\n willDestroyElementCount++;\n assert.notEqual(this.element.parentNode, null, 'has not been removed from DOM yet');\n }\n });\n\n this.registerComponent('foo-bar', {\n ComponentClass: FooBarComponent,\n template: 'hello'\n });\n\n this.render('{{#if switch}}{{foo-bar}}{{/if}}', { switch: true });\n\n assert.equal(didInsertElementCount, 1, 'didInsertElement was called once');\n\n this.assertComponentElement(this.firstChild, { content: 'hello' });\n\n this.runTask(() => (0, _metal.set)(this.context, 'switch', false));\n\n assert.equal(willDestroyElementCount, 1, 'willDestroyElement was called once');\n\n this.assertText('');\n }\n });\n});","enifed('@ember/-internals/glimmer/tests/integration/content-test', ['@ember/-internals/glimmer/tests/utils/test-case', '@ember/-internals/glimmer/tests/utils/abstract-test-case', '@ember/-internals/metal', '@ember/debug', '@ember/object/computed', '@ember/-internals/runtime', '@ember/-internals/glimmer/tests/utils/test-helpers', '@ember/-internals/views', '@ember/-internals/glimmer/tests/utils/helpers'], function (_testCase, _abstractTestCase, _metal, _debug, _computed, _runtime, _testHelpers, _views, _helpers) {\n 'use strict';\n\n (0, _testCase.moduleFor)('Static content tests', class extends _testCase.RenderingTest {\n ['@test it can render a static text node']() {\n this.render('hello');\n let text1 = this.assertTextNode(this.firstChild, 'hello');\n\n this.runTask(() => this.rerender());\n\n let text2 = this.assertTextNode(this.firstChild, 'hello');\n\n this.assertSameNode(text1, text2);\n }\n\n ['@test it can render a static element']() {\n this.render('
hello
');\n let p1 = this.assertElement(this.firstChild, { tagName: 'p' });\n let text1 = this.assertTextNode(this.firstChild.firstChild, 'hello');\n\n this.runTask(() => this.rerender());\n\n let p2 = this.assertElement(this.firstChild, { tagName: 'p' });\n let text2 = this.assertTextNode(this.firstChild.firstChild, 'hello');\n\n this.assertSameNode(p1, p2);\n this.assertSameNode(text1, text2);\n }\n\n ['@test it can render a static template']() {\n let template = `\n
{{/with}}'\n });\n\n this.render('{{#kiwi-comp}}{{item}}{{/kiwi-comp}}', { item: 'Outer' });\n this.assertText('InnerOuter');\n\n this.assertStableRerender();\n\n this.runTask(() => (0, _metal.set)(this.context, 'item', 'Otherworld'));\n this.assertText('InnerOtherworld');\n\n this.runTask(() => (0, _metal.set)(this.context, 'item', 'Outer'));\n this.assertText('InnerOuter');\n }\n\n ['@test can bind a block param to a component and use it in yield']() {\n this.registerComponent('kiwi-comp', {\n template: '
{{content}}
{{yield}}
'\n });\n\n this.render('{{#with boundText as |item|}}{{#kiwi-comp content=item}}{{item}}{{/kiwi-comp}}{{/with}}', { boundText: 'Outer' });\n this.assertText('OuterOuter');\n\n this.assertStableRerender();\n\n this.runTask(() => (0, _metal.set)(this.context, 'boundText', 'Update'));\n this.assertText('UpdateUpdate');\n\n this.runTask(() => (0, _metal.set)(this.context, 'boundText', 'Outer'));\n this.assertText('OuterOuter');\n }\n\n // INUR not need with no data update\n ['@test yield should not introduce a view'](assert) {\n let ParentCompComponent = _helpers.Component.extend({ isParentComponent: true });\n\n let ChildCompComponent = _helpers.Component.extend({\n didReceiveAttrs() {\n this._super();\n let parentView = this.get('parentView');\n\n assert.ok(parentView.get('isParentComponent'));\n }\n });\n\n this.registerComponent('parent-comp', {\n ComponentClass: ParentCompComponent,\n template: '{{yield}}'\n });\n this.registerComponent('child-comp', {\n ComponentClass: ChildCompComponent\n });\n\n this.render('{{#parent-comp}}{{child-comp}}{{/parent-comp}}');\n }\n\n ['@test yield with nested components (#3220)']() {\n this.registerComponent('inner-component', { template: '{{yield}}' });\n this.registerComponent('outer-component', {\n template: '{{#inner-component}}{{yield}}{{/inner-component}}'\n });\n\n this.render('{{#outer-component}}Hello {{boundText}}{{/outer-component}}', {\n boundText: 'world'\n });\n this.assertText('Hello world');\n\n this.assertStableRerender();\n\n this.runTask(() => (0, _metal.set)(this.context, 'boundText', 'update'));\n this.assertText('Hello update');\n\n this.runTask(() => (0, _metal.set)(this.context, 'boundText', 'world'));\n this.assertText('Hello world');\n }\n });\n});","enifed('@ember/-internals/glimmer/tests/integration/input-test', ['@ember/-internals/glimmer/tests/utils/test-case', '@ember/-internals/metal'], function (_testCase, _metal) {\n 'use strict';\n\n (0, _testCase.moduleFor)('Input element tests', class extends _testCase.RenderingTest {\n runAttributeTest(attributeName, values) {\n let template = ``;\n this.render(template, { value: values[0] });\n this.assertAttributeHasValue(attributeName, values[0], `${attributeName} is set on initial render`);\n\n this.runTask(() => this.rerender());\n this.assertAttributeHasValue(attributeName, values[0], `${attributeName} is set on noop rerender`);\n\n this.setComponentValue(values[1]);\n this.assertAttributeHasValue(attributeName, values[1], `${attributeName} is set on rerender`);\n\n this.setComponentValue(values[0]);\n this.assertAttributeHasValue(attributeName, values[0], `${attributeName} can be set back to the initial value`);\n }\n\n runPropertyTest(propertyName, values) {\n let attributeName = propertyName;\n let template = ``;\n this.render(template, { value: values[0] });\n this.assertPropertyHasValue(propertyName, values[0], `${propertyName} is set on initial render`);\n\n this.runTask(() => this.rerender());\n this.assertPropertyHasValue(propertyName, values[0], `${propertyName} is set on noop rerender`);\n\n this.setComponentValue(values[1]);\n this.assertPropertyHasValue(propertyName, values[1], `${propertyName} is set on rerender`);\n\n this.setComponentValue(values[0]);\n this.assertPropertyHasValue(propertyName, values[0], `${propertyName} can be set back to the initial value`);\n }\n\n runFalsyValueProperty(values) {\n let value = 'value';\n let template = ``;\n this.render(template, { value: values[0] });\n this.assertPropertyHasValue(value, '', `${value} is set on initial render`);\n\n this.runTask(() => this.rerender());\n this.assertPropertyHasValue(value, '', `${value} is set on noop rerender`);\n this.setComponentValue(values[1]);\n\n this.assertPropertyHasValue(value, values[1], `${value} is set on rerender`);\n\n this.setComponentValue(values[0]);\n this.assertPropertyHasValue(value, '', `${value} can be set back to the initial value`);\n }\n\n ['@test input disabled attribute']() {\n let model = { model: { value: false } };\n\n this.render(``, model);\n\n this.assert.equal(this.$inputElement().prop('disabled'), false);\n\n this.runTask(() => this.rerender());\n\n this.assert.equal(this.$inputElement().prop('disabled'), false);\n\n this.runTask(() => this.context.set('model.value', true));\n\n this.assert.equal(this.$inputElement().prop('disabled'), true);\n this.assertHTML(''); // Note the DOM output is \n\n this.runTask(() => this.context.set('model.value', 'wat'));\n\n this.assert.equal(this.$inputElement().prop('disabled'), true);\n this.assertHTML(''); // Note the DOM output is \n\n this.runTask(() => this.context.set('model', { value: false }));\n\n this.assert.equal(this.$inputElement().prop('disabled'), false);\n this.assertHTML('');\n }\n\n ['@test input value attribute']() {\n this.runPropertyTest('value', ['foo', 'bar']);\n }\n\n ['@test input placeholder attribute']() {\n this.runAttributeTest('placeholder', ['foo', 'bar']);\n }\n\n ['@test input name attribute']() {\n this.runAttributeTest('name', ['nam', 'name']);\n }\n\n ['@test input maxlength attribute']() {\n this.runAttributeTest('maxlength', [2, 3]);\n }\n\n ['@test input size attribute']() {\n this.runAttributeTest('size', [2, 3]);\n }\n\n ['@test input tabindex attribute']() {\n this.runAttributeTest('tabindex', [2, 3]);\n }\n\n ['@test null input value']() {\n this.runFalsyValueProperty([null, 'hello']);\n }\n\n ['@test undefined input value']() {\n this.runFalsyValueProperty([undefined, 'hello']);\n }\n\n ['@test undefined `toString` method as input value']() {\n this.runFalsyValueProperty([Object.create(null), 'hello']);\n }\n\n ['@test cursor position is not lost when updating content']() {\n let template = ``;\n this.render(template, { value: 'hola' });\n\n this.setDOMValue('hello');\n this.setSelectionRange(1, 3);\n\n this.setComponentValue('hello');\n\n this.assertSelectionRange(1, 3);\n\n // Note: We should eventually get around to testing reseting, however\n // browsers handle `selectionStart` and `selectionEnd` differently\n // when are synthetically testing movement of the cursor.\n }\n\n ['@test input can be updated multiple times']() {\n let template = ``;\n this.render(template, { value: 'hola' });\n\n this.assertValue('hola', 'Value is initialised');\n\n this.setComponentValue('');\n this.assertValue('', 'Value is set in the DOM');\n\n this.setDOMValue('hola');\n this.setComponentValue('hola');\n this.assertValue('hola', 'Value is updated the first time');\n\n this.setComponentValue('');\n this.assertValue('', 'Value is updated the second time');\n }\n\n ['@test DOM is SSOT if value is set']() {\n let template = ``;\n this.render(template, { value: 'hola' });\n\n this.assertValue('hola', 'Value is initialised');\n\n this.setComponentValue('hello');\n\n this.assertValue('hello', 'Value is initialised');\n\n this.setDOMValue('hola');\n\n this.assertValue('hola', 'DOM is used');\n\n this.setComponentValue('bye');\n\n this.assertValue('bye', 'Value is used');\n\n // Simulates setting the input to the same value as it already is which won't cause a rerender\n\n this.setDOMValue('hola');\n\n this.assertValue('hola', 'DOM is used');\n\n this.setComponentValue('hola');\n\n this.assertValue('hola', 'Value is used');\n }\n\n // private helpers and assertions\n setDOMValue(value) {\n this.inputElement().value = value;\n }\n\n setComponentValue(value) {\n this.runTask(() => (0, _metal.set)(this.context, 'value', value));\n }\n\n setSelectionRange(start, end) {\n this.inputElement().selectionStart = start;\n this.inputElement().selectionEnd = end;\n }\n\n inputElement() {\n return this.$inputElement()[0];\n }\n\n $inputElement() {\n return this.$('input');\n }\n\n assertValue(value, message) {\n this.assertPropertyHasValue('value', value, message);\n }\n\n assertAttributeHasValue(attribute, value, message) {\n this.assert.equal(this.$inputElement().attr(attribute), value, `${attribute} ${message}`);\n }\n\n assertPropertyHasValue(property, value, message) {\n this.assert.equal(this.$inputElement().prop(property), value, `${property} ${message}`);\n }\n\n assertSelectionRange(start, end) {\n this.assert.equal(this.inputElement().selectionStart, start);\n this.assert.equal(this.inputElement().selectionEnd, end);\n }\n });\n});","enifed('@ember/-internals/glimmer/tests/integration/mount-test', ['@ember/-internals/owner', '@ember/-internals/glimmer/tests/utils/test-case', '@ember/-internals/glimmer/tests/utils/helpers', '@ember/controller', '@ember/-internals/metal', '@ember/engine'], function (_owner, _testCase, _helpers, _controller, _metal, _engine) {\n 'use strict';\n\n if (true /* EMBER_ENGINES_MOUNT_PARAMS */) {\n (0, _testCase.moduleFor)('{{mount}} single param assertion', class extends _testCase.RenderingTest {\n ['@test it asserts that only a single param is passed']() {\n expectAssertion(() => {\n this.render('{{mount \"chat\" \"foo\"}}');\n }, /You can only pass a single positional argument to the {{mount}} helper, e.g. {{mount \"chat-engine\"}}./i);\n }\n });\n } else {\n (0, _testCase.moduleFor)('{{mount}} single param assertion', class extends _testCase.RenderingTest {\n ['@test it asserts that only a single param is passed']() {\n expectAssertion(() => {\n this.render('{{mount \"chat\" \"foo\"}}');\n }, /You can only pass a single argument to the {{mount}} helper, e.g. {{mount \"chat-engine\"}}./i);\n }\n });\n }\n\n (0, _testCase.moduleFor)('{{mount}} assertions', class extends _testCase.RenderingTest {\n ['@test it asserts when an invalid engine name is provided']() {\n expectAssertion(() => {\n this.render('{{mount engineName}}', { engineName: {} });\n }, /Invalid engine name '\\[object Object\\]' specified, engine name must be either a string, null or undefined./i);\n }\n\n ['@test it asserts that the specified engine is registered']() {\n expectAssertion(() => {\n this.render('{{mount \"chat\"}}');\n }, /You used `{{mount 'chat'}}`, but the engine 'chat' can not be found./i);\n }\n });\n\n (0, _testCase.moduleFor)('{{mount}} test', class extends _testCase.ApplicationTest {\n constructor() {\n super(...arguments);\n\n let engineRegistrations = this.engineRegistrations = {};\n\n this.add('engine:chat', _engine.default.extend({\n router: null,\n\n init() {\n this._super(...arguments);\n\n Object.keys(engineRegistrations).forEach(fullName => {\n this.register(fullName, engineRegistrations[fullName]);\n });\n }\n }));\n\n this.addTemplate('index', '{{mount \"chat\"}}');\n }\n\n ['@test it boots an engine, instantiates its application controller, and renders its application template'](assert) {\n this.engineRegistrations['template:application'] = (0, _helpers.compile)('
Chat here, {{username}}
', { moduleName: 'my-app/templates/application.hbs' });\n\n let controller;\n\n this.engineRegistrations['controller:application'] = _controller.default.extend({\n username: 'dgeb',\n\n init() {\n this._super();\n controller = this;\n }\n });\n\n return this.visit('/').then(() => {\n assert.ok(controller, \"engine's application controller has been instantiated\");\n\n let engineInstance = (0, _owner.getOwner)(controller);\n assert.strictEqual((0, _engine.getEngineParent)(engineInstance), this.applicationInstance, 'engine instance has the application instance as its parent');\n\n this.assertInnerHTML('
\n `);\n }).then(() => {\n // The last set is localized to the `page` object, so we do not expect Glimmer\n // to re-iterate the list\n this.assertNoMutation();\n });\n }\n });\n }\n});","enifed('@ember/-internals/glimmer/tests/integration/syntax/experimental-syntax-test', ['@ember/-internals/glimmer/tests/utils/test-case', '@ember/-internals/glimmer/tests/utils/abstract-test-case', '@ember/-internals/glimmer'], function (_testCase, _abstractTestCase, _glimmer) {\n 'use strict';\n\n (0, _testCase.moduleFor)('registerMacros', class extends _testCase.RenderingTest {\n constructor() {\n let originalMacros = _glimmer._experimentalMacros.slice();\n\n (0, _glimmer._registerMacros)(blocks => {\n blocks.add('-let', (params, hash, _default, inverse, builder) => {\n builder.compileParams(params);\n builder.invokeStaticBlock(_default, params.length);\n });\n });\n\n super(...arguments);\n this.originalMacros = originalMacros;\n }\n\n teardown() {\n _glimmer._experimentalMacros.length = 0;\n this.originalMacros.forEach(macro => _glimmer._experimentalMacros.push(macro));\n\n super.teardown();\n }\n\n ['@test allows registering custom syntax via private API']() {\n this.render(_abstractTestCase.strip`\n {{#-let obj as |bar|}}\n {{bar}}\n {{/-let}}\n `, { obj: 'hello world!' });\n\n this.assertText('hello world!');\n }\n });\n});","enifed('@ember/-internals/glimmer/tests/integration/syntax/if-unless-test', ['@ember/-internals/glimmer/tests/utils/helpers', '@ember/-internals/runtime', '@ember/-internals/metal', '@ember/-internals/glimmer/tests/utils/abstract-test-case', '@ember/-internals/glimmer/tests/utils/test-case', '@ember/-internals/glimmer/tests/utils/shared-conditional-tests'], function (_helpers, _runtime, _metal, _abstractTestCase, _testCase, _sharedConditionalTests) {\n 'use strict';\n\n (0, _testCase.moduleFor)('Syntax test: {{#if}} with inverse', class extends _sharedConditionalTests.IfUnlessWithSyntaxTest {\n templateFor({ cond, truthy, falsy }) {\n return `{{#if ${cond}}}${truthy}{{else}}${falsy}{{/if}}`;\n }\n });\n\n (0, _testCase.moduleFor)('Syntax test: {{#unless}} with inverse', class extends _sharedConditionalTests.IfUnlessWithSyntaxTest {\n templateFor({ cond, truthy, falsy }) {\n return `{{#unless ${cond}}}${falsy}{{else}}${truthy}{{/unless}}`;\n }\n });\n\n (0, _testCase.moduleFor)('Syntax test: {{#if}} and {{#unless}} without inverse', class extends _sharedConditionalTests.IfUnlessWithSyntaxTest {\n templateFor({ cond, truthy, falsy }) {\n return `{{#if ${cond}}}${truthy}{{/if}}{{#unless ${cond}}}${falsy}{{/unless}}`;\n }\n });\n\n (0, _testCase.moduleFor)('Syntax test: {{#if}}', class extends _testCase.RenderingTest {\n ['@test using `if` with an `{{each}}` destroys components when transitioning to and from inverse (GH #12267)'](assert) {\n let destroyedChildrenCount = 0;\n\n this.registerComponent('foo-bar', {\n template: '{{number}}',\n ComponentClass: _helpers.Component.extend({\n willDestroy() {\n this._super();\n destroyedChildrenCount++;\n }\n })\n });\n\n this.render(_abstractTestCase.strip`\n {{#if cond}}\n {{#each numbers as |number|}}\n {{foo-bar number=number}}\n {{/each}}\n {{else}}\n Nothing Here!\n {{/if}}`, { cond: true, numbers: (0, _runtime.A)([1, 2, 3]) });\n\n this.assertText('123');\n\n this.runTask(() => this.rerender());\n\n this.assertText('123');\n\n this.runTask(() => (0, _metal.set)(this.context, 'cond', false));\n\n this.assertText('Nothing Here!');\n assert.equal(destroyedChildrenCount, 3, 'the children were properly destroyed');\n\n this.runTask(() => (0, _metal.set)(this.context, 'cond', true));\n\n this.assertText('123');\n }\n\n ['@test looking up `undefined` property defaults to false']() {\n this.render(_abstractTestCase.strip`\n {{#if foo.bar.baz}}\n Here!\n {{else}}\n Nothing Here!\n {{/if}}`, { foo: {} });\n\n this.assertText('Nothing Here!');\n\n this.runTask(() => this.rerender());\n\n this.assertText('Nothing Here!');\n\n this.runTask(() => (0, _metal.set)(this.context, 'foo', { bar: { baz: true } }));\n\n this.assertText('Here!');\n\n this.runTask(() => (0, _metal.set)(this.context, 'foo', {}));\n\n this.assertText('Nothing Here!');\n }\n });\n});","enifed('@ember/-internals/glimmer/tests/integration/syntax/in-element-test', ['@ember/-internals/glimmer/tests/utils/test-case', '@ember/-internals/glimmer/tests/utils/test-helpers', '@ember/-internals/glimmer/tests/utils/abstract-test-case', '@ember/-internals/glimmer', '@ember/-internals/metal'], function (_testCase, _testHelpers, _abstractTestCase, _glimmer, _metal) {\n 'use strict';\n\n (0, _testCase.moduleFor)('{{-in-element}}', class extends _testCase.RenderingTest {\n ['@test using {{#in-element whatever}} asserts']() {\n // the in-element keyword is not yet public API this test should be removed\n // once https://github.com/emberjs/rfcs/pull/287 lands and is enabled\n\n let el = document.createElement('div');\n expectAssertion(() => {\n this.render(_abstractTestCase.strip`{{#in-element el}}{{/in-element}}`, { el });\n }, /The {{in-element}} helper cannot be used. \\('-top-level' @ L1:C0\\)/);\n }\n\n ['@test allows rendering into an external element']() {\n let someElement = document.createElement('div');\n\n this.render(_abstractTestCase.strip`\n {{#-in-element someElement}}\n {{text}}\n {{/-in-element}}\n `, {\n someElement,\n text: 'Whoop!'\n });\n\n (0, _testHelpers.equalTokens)(this.element, '');\n (0, _testHelpers.equalTokens)(someElement, 'Whoop!');\n\n this.assertStableRerender();\n\n this.runTask(() => (0, _metal.set)(this.context, 'text', 'Huzzah!!'));\n\n (0, _testHelpers.equalTokens)(this.element, '');\n (0, _testHelpers.equalTokens)(someElement, 'Huzzah!!');\n\n this.runTask(() => (0, _metal.set)(this.context, 'text', 'Whoop!'));\n\n (0, _testHelpers.equalTokens)(this.element, '');\n (0, _testHelpers.equalTokens)(someElement, 'Whoop!');\n }\n\n ['@test components are cleaned up properly'](assert) {\n let hooks = [];\n\n let someElement = document.createElement('div');\n\n this.registerComponent('modal-display', {\n ComponentClass: _glimmer.Component.extend({\n didInsertElement() {\n hooks.push('didInsertElement');\n },\n\n willDestroyElement() {\n hooks.push('willDestroyElement');\n }\n }),\n\n template: `{{text}}`\n });\n\n this.render(_abstractTestCase.strip`\n {{#if showModal}}\n {{#-in-element someElement}}\n {{modal-display text=text}}\n {{/-in-element}}\n {{/if}}\n `, {\n someElement,\n text: 'Whoop!',\n showModal: false\n });\n\n (0, _testHelpers.equalTokens)(this.element, '');\n (0, _testHelpers.equalTokens)(someElement, '');\n\n this.assertStableRerender();\n\n this.runTask(() => (0, _metal.set)(this.context, 'showModal', true));\n\n (0, _testHelpers.equalTokens)(this.element, '');\n this.assertComponentElement(someElement.firstChild, {\n content: 'Whoop!'\n });\n\n this.runTask(() => (0, _metal.set)(this.context, 'text', 'Huzzah!'));\n\n (0, _testHelpers.equalTokens)(this.element, '');\n this.assertComponentElement(someElement.firstChild, {\n content: 'Huzzah!'\n });\n\n this.runTask(() => (0, _metal.set)(this.context, 'text', 'Whoop!'));\n\n (0, _testHelpers.equalTokens)(this.element, '');\n this.assertComponentElement(someElement.firstChild, {\n content: 'Whoop!'\n });\n\n this.runTask(() => (0, _metal.set)(this.context, 'showModal', false));\n\n (0, _testHelpers.equalTokens)(this.element, '');\n (0, _testHelpers.equalTokens)(someElement, '');\n\n assert.deepEqual(hooks, ['didInsertElement', 'willDestroyElement']);\n }\n });\n});","enifed('@ember/-internals/glimmer/tests/integration/syntax/let-test', ['@ember/-internals/metal', '@ember/-internals/runtime', '@ember/-internals/glimmer/tests/utils/test-case', '@ember/-internals/glimmer/tests/utils/abstract-test-case'], function (_metal, _runtime, _testCase, _abstractTestCase) {\n 'use strict';\n\n if (true /* EMBER_TEMPLATE_BLOCK_LET_HELPER */) {\n (0, _testCase.moduleFor)('Syntax test: {{#let as}}', class extends _testCase.RenderingTest {\n templateFor({ cond, truthy, falsy }) {\n return `{{#let ${cond} as |test|}}${truthy}{{else}}${falsy}{{/let}}`;\n }\n\n ['@test it renders the block if `undefined` is passed as an argument']() {\n this.render(_abstractTestCase.strip`\n {{#let foo.bar.baz as |thing|}}\n value: \"{{thing}}\"\n {{/let}}`, { foo: {} });\n\n this.assertText('value: \"\"');\n\n this.runTask(() => this.rerender());\n\n this.assertText('value: \"\"');\n\n this.runTask(() => (0, _metal.set)(this.context, 'foo', { bar: { baz: 'Here!' } }));\n\n this.assertText('value: \"Here!\"');\n\n this.runTask(() => (0, _metal.set)(this.context, 'foo', {}));\n\n this.assertText('value: \"\"');\n }\n\n ['@test it renders the block if arguments are falsey']() {\n this.render(`{{#let cond1 cond2 as |cond|}}value: \"{{cond1}}\"{{/let}}`, {\n cond1: false\n });\n\n this.assertText('value: \"false\"');\n\n this.runTask(() => this.rerender());\n\n this.assertText('value: \"false\"');\n\n this.runTask(() => (0, _metal.set)(this.context, 'cond1', ''));\n\n this.assertText('value: \"\"');\n\n this.runTask(() => (0, _metal.set)(this.context, 'cond1', 0));\n\n this.assertText('value: \"0\"');\n }\n\n ['@test it yields multiple arguments in order']() {\n this.render(`{{#let foo bar baz.name as |a b c|}}{{a}} {{b}} {{c}}{{/let}}`, {\n foo: 'Señor Engineer',\n bar: '',\n baz: { name: 'Dale' }\n });\n\n this.assertText('Señor Engineer Dale');\n\n this.runTask(() => (0, _metal.set)(this.context, 'bar', 'Tom'));\n\n this.assertText('Señor Engineer Tom Dale');\n }\n\n ['@test can access alias and original scope']() {\n this.render(`{{#let person as |tom|}}{{title}}: {{tom.name}}{{/let}}`, {\n title: 'Señor Engineer',\n person: { name: 'Tom Dale' }\n });\n\n this.assertText('Señor Engineer: Tom Dale');\n\n this.runTask(() => this.rerender());\n\n this.assertText('Señor Engineer: Tom Dale');\n\n this.runTask(() => {\n (0, _metal.set)(this.context, 'person.name', 'Yehuda Katz');\n (0, _metal.set)(this.context, 'title', 'Principal Engineer');\n });\n\n this.assertText('Principal Engineer: Yehuda Katz');\n\n this.runTask(() => {\n (0, _metal.set)(this.context, 'person', { name: 'Tom Dale' });\n (0, _metal.set)(this.context, 'title', 'Señor Engineer');\n });\n\n this.assertText('Señor Engineer: Tom Dale');\n }\n\n ['@test the scoped variable is not available outside the {{#let}} block.']() {\n this.render(`{{name}}-{{#let other as |name|}}{{name}}{{/let}}-{{name}}`, {\n name: 'Stef',\n other: 'Yehuda'\n });\n\n this.assertText('Stef-Yehuda-Stef');\n\n this.runTask(() => this.rerender());\n\n this.assertText('Stef-Yehuda-Stef');\n\n this.runTask(() => (0, _metal.set)(this.context, 'other', 'Chad'));\n\n this.assertText('Stef-Chad-Stef');\n\n this.runTask(() => (0, _metal.set)(this.context, 'name', 'Tom'));\n\n this.assertText('Tom-Chad-Tom');\n\n this.runTask(() => {\n (0, _metal.set)(this.context, 'name', 'Stef');\n (0, _metal.set)(this.context, 'other', 'Yehuda');\n });\n\n this.assertText('Stef-Yehuda-Stef');\n }\n\n ['@test can access alias of a proxy']() {\n this.render(`{{#let proxy as |person|}}{{person.name}}{{/let}}`, {\n proxy: _runtime.ObjectProxy.create({ content: { name: 'Tom Dale' } })\n });\n\n this.assertText('Tom Dale');\n\n this.runTask(() => this.rerender());\n\n this.assertText('Tom Dale');\n\n this.runTask(() => (0, _metal.set)(this.context, 'proxy.name', 'Yehuda Katz'));\n\n this.assertText('Yehuda Katz');\n\n this.runTask(() => (0, _metal.set)(this.context, 'proxy.content', { name: 'Godfrey Chan' }));\n\n this.assertText('Godfrey Chan');\n\n this.runTask(() => (0, _metal.set)(this.context, 'proxy.content.name', 'Stefan Penner'));\n\n this.assertText('Stefan Penner');\n\n this.runTask(() => (0, _metal.set)(this.context, 'proxy.content', null));\n\n this.assertText('');\n\n this.runTask(() => (0, _metal.set)(this.context, 'proxy', _runtime.ObjectProxy.create({ content: { name: 'Tom Dale' } })));\n\n this.assertText('Tom Dale');\n }\n\n ['@test can access alias of an array']() {\n this.render(`{{#let arrayThing as |words|}}{{#each words as |word|}}{{word}}{{/each}}{{/let}}`, {\n arrayThing: (0, _runtime.A)(['Hello', ' ', 'world'])\n });\n\n this.assertText('Hello world');\n\n this.runTask(() => this.rerender());\n\n this.assertText('Hello world');\n\n this.runTask(() => {\n let array = (0, _metal.get)(this.context, 'arrayThing');\n array.replace(0, 1, ['Goodbye']);\n (0, _runtime.removeAt)(array, 1);\n array.insertAt(1, ', ');\n array.pushObject('!');\n });\n\n this.assertText('Goodbye, world!');\n\n this.runTask(() => (0, _metal.set)(this.context, 'arrayThing', ['Hello', ' ', 'world']));\n\n this.assertText('Hello world');\n }\n\n ['@test `attrs` can be used as a block param [GH#14678]']() {\n this.render('{{#let hash as |attrs|}}[{{hash.foo}}-{{attrs.foo}}]{{/let}}', {\n hash: { foo: 'foo' }\n });\n\n this.assertText('[foo-foo]');\n\n this.runTask(() => this.rerender());\n\n this.assertText('[foo-foo]');\n\n this.runTask(() => this.context.set('hash.foo', 'FOO'));\n\n this.assertText('[FOO-FOO]');\n\n this.runTask(() => this.context.set('hash.foo', 'foo'));\n\n this.assertText('[foo-foo]');\n }\n });\n\n (0, _testCase.moduleFor)('Syntax test: Multiple {{#let as}} helpers', class extends _testCase.RenderingTest {\n ['@test re-using the same variable with different {{#let}} blocks does not override each other']() {\n this.render(`Admin: {{#let admin as |person|}}{{person.name}}{{/let}} User: {{#let user as |person|}}{{person.name}}{{/let}}`, {\n admin: { name: 'Tom Dale' },\n user: { name: 'Yehuda Katz' }\n });\n\n this.assertText('Admin: Tom Dale User: Yehuda Katz');\n\n this.runTask(() => this.rerender());\n\n this.assertText('Admin: Tom Dale User: Yehuda Katz');\n\n this.runTask(() => {\n (0, _metal.set)(this.context, 'admin.name', 'Godfrey Chan');\n (0, _metal.set)(this.context, 'user.name', 'Stefan Penner');\n });\n\n this.assertText('Admin: Godfrey Chan User: Stefan Penner');\n\n this.runTask(() => {\n (0, _metal.set)(this.context, 'admin', { name: 'Tom Dale' });\n (0, _metal.set)(this.context, 'user', { name: 'Yehuda Katz' });\n });\n\n this.assertText('Admin: Tom Dale User: Yehuda Katz');\n }\n\n ['@test the scoped variable is not available outside the {{#let}} block']() {\n this.render(`{{ring}}-{{#let first as |ring|}}{{ring}}-{{#let fifth as |ring|}}{{ring}}-{{#let ninth as |ring|}}{{ring}}-{{/let}}{{ring}}-{{/let}}{{ring}}-{{/let}}{{ring}}`, {\n ring: 'Greed',\n first: 'Limbo',\n fifth: 'Wrath',\n ninth: 'Treachery'\n });\n\n this.assertText('Greed-Limbo-Wrath-Treachery-Wrath-Limbo-Greed');\n\n this.runTask(() => this.rerender());\n\n this.assertText('Greed-Limbo-Wrath-Treachery-Wrath-Limbo-Greed');\n\n this.runTask(() => {\n (0, _metal.set)(this.context, 'ring', 'O');\n (0, _metal.set)(this.context, 'fifth', 'D');\n });\n\n this.assertText('O-Limbo-D-Treachery-D-Limbo-O');\n\n this.runTask(() => {\n (0, _metal.set)(this.context, 'first', 'I');\n (0, _metal.set)(this.context, 'ninth', 'K');\n });\n\n this.assertText('O-I-D-K-D-I-O');\n\n this.runTask(() => {\n (0, _metal.set)(this.context, 'ring', 'Greed');\n (0, _metal.set)(this.context, 'first', 'Limbo');\n (0, _metal.set)(this.context, 'fifth', 'Wrath');\n (0, _metal.set)(this.context, 'ninth', 'Treachery');\n });\n\n this.assertText('Greed-Limbo-Wrath-Treachery-Wrath-Limbo-Greed');\n }\n\n ['@test it should support {{#let name as |foo|}}, then {{#let foo as |bar|}}']() {\n this.render(`{{#let name as |foo|}}{{#let foo as |bar|}}{{bar}}{{/let}}{{/let}}`, {\n name: 'caterpillar'\n });\n\n this.assertText('caterpillar');\n\n this.runTask(() => this.rerender());\n\n this.assertText('caterpillar');\n\n this.runTask(() => (0, _metal.set)(this.context, 'name', 'butterfly'));\n\n this.assertText('butterfly');\n\n this.runTask(() => (0, _metal.set)(this.context, 'name', 'caterpillar'));\n\n this.assertText('caterpillar');\n }\n\n ['@test updating the context should update the alias']() {\n this.render(`{{#let this as |person|}}{{person.name}}{{/let}}`, {\n name: 'Los Pivots'\n });\n\n this.assertText('Los Pivots');\n\n this.runTask(() => this.rerender());\n\n this.assertText('Los Pivots');\n\n this.runTask(() => (0, _metal.set)(this.context, 'name', \"l'Pivots\"));\n\n this.assertText(\"l'Pivots\");\n\n this.runTask(() => (0, _metal.set)(this.context, 'name', 'Los Pivots'));\n\n this.assertText('Los Pivots');\n }\n\n ['@test nested {{#let}} blocks should have access to root context']() {\n this.render(_abstractTestCase.strip`\n {{name}}\n {{#let committer1.name as |name|}}\n [{{name}}\n {{#let committer2.name as |name|}}\n [{{name}}]\n {{/let}}\n {{name}}]\n {{/let}}\n {{name}}\n {{#let committer2.name as |name|}}\n [{{name}}\n {{#let committer1.name as |name|}}\n [{{name}}]\n {{/let}}\n {{name}}]\n {{/let}}\n {{name}}\n `, {\n name: 'ebryn',\n committer1: { name: 'trek' },\n committer2: { name: 'machty' }\n });\n\n this.assertText('ebryn[trek[machty]trek]ebryn[machty[trek]machty]ebryn');\n\n this.runTask(() => this.rerender());\n\n this.assertText('ebryn[trek[machty]trek]ebryn[machty[trek]machty]ebryn');\n\n this.runTask(() => (0, _metal.set)(this.context, 'name', 'chancancode'));\n\n this.assertText('chancancode[trek[machty]trek]chancancode[machty[trek]machty]chancancode');\n\n this.runTask(() => (0, _metal.set)(this.context, 'committer1', { name: 'krisselden' }));\n\n this.assertText('chancancode[krisselden[machty]krisselden]chancancode[machty[krisselden]machty]chancancode');\n\n this.runTask(() => {\n (0, _metal.set)(this.context, 'committer1.name', 'wycats');\n (0, _metal.set)(this.context, 'committer2', { name: 'rwjblue' });\n });\n\n this.assertText('chancancode[wycats[rwjblue]wycats]chancancode[rwjblue[wycats]rwjblue]chancancode');\n\n this.runTask(() => {\n (0, _metal.set)(this.context, 'name', 'ebryn');\n (0, _metal.set)(this.context, 'committer1', { name: 'trek' });\n (0, _metal.set)(this.context, 'committer2', { name: 'machty' });\n });\n\n this.assertText('ebryn[trek[machty]trek]ebryn[machty[trek]machty]ebryn');\n }\n });\n }\n});","enifed('@ember/-internals/glimmer/tests/integration/syntax/with-dynamic-var-test', ['@ember/-internals/glimmer/tests/utils/test-case', '@ember/-internals/glimmer/tests/utils/abstract-test-case'], function (_testCase, _abstractTestCase) {\n 'use strict';\n\n (0, _testCase.moduleFor)('{{-with-dynamic-var}}', class extends _testCase.RenderingTest {\n ['@test does not allow setting values other than outletState']() {\n expectAssertion(() => {\n this.render(_abstractTestCase.strip`\n {{#-with-dynamic-vars foo=\"bar\"}}\n {{-get-dynamic-var 'foo'}}\n {{/-with-dynamic-vars}}\n `);\n }, /Using `-with-dynamic-scope` is only supported for `outletState` \\(you used `foo`\\)./);\n }\n\n ['@test allows setting/getting outletState']() {\n // this is simply asserting that we can write and read outletState\n // the actual value being used here is not what is used in real life\n // feel free to change the value being set and asserted as needed\n this.render(_abstractTestCase.strip`\n {{#-with-dynamic-vars outletState=\"bar\"}}\n {{-get-dynamic-var 'outletState'}}\n {{/-with-dynamic-vars}}\n `);\n\n this.assertText('bar');\n }\n\n ['@test does not allow setting values other than outletState']() {\n expectAssertion(() => {\n this.render(`{{-get-dynamic-var 'foo'}}`);\n }, /Using `-get-dynamic-scope` is only supported for `outletState` \\(you used `foo`\\)./);\n }\n });\n});","enifed('@ember/-internals/glimmer/tests/integration/syntax/with-test', ['@ember/-internals/metal', '@ember/-internals/runtime', '@ember/-internals/glimmer/tests/utils/test-case', '@ember/-internals/glimmer/tests/utils/shared-conditional-tests', '@ember/-internals/glimmer/tests/utils/abstract-test-case'], function (_metal, _runtime, _testCase, _sharedConditionalTests, _abstractTestCase) {\n 'use strict';\n\n (0, _testCase.moduleFor)('Syntax test: {{#with}}', class extends _sharedConditionalTests.IfUnlessWithSyntaxTest {\n templateFor({ cond, truthy, falsy }) {\n return `{{#with ${cond}}}${truthy}{{else}}${falsy}{{/with}}`;\n }\n });\n\n (0, _testCase.moduleFor)('Syntax test: {{#with as}}', class extends _sharedConditionalTests.IfUnlessWithSyntaxTest {\n templateFor({ cond, truthy, falsy }) {\n return `{{#with ${cond} as |test|}}${truthy}{{else}}${falsy}{{/with}}`;\n }\n\n ['@test keying off of `undefined` does not render']() {\n this.render(_abstractTestCase.strip`\n {{#with foo.bar.baz as |thing|}}\n {{thing}}\n {{/with}}`, { foo: {} });\n\n this.assertText('');\n\n this.runTask(() => this.rerender());\n\n this.assertText('');\n\n this.runTask(() => (0, _metal.set)(this.context, 'foo', { bar: { baz: 'Here!' } }));\n\n this.assertText('Here!');\n\n this.runTask(() => (0, _metal.set)(this.context, 'foo', {}));\n\n this.assertText('');\n }\n\n ['@test it renders and hides the given block based on the conditional']() {\n this.render(`{{#with cond1 as |cond|}}{{cond.greeting}}{{else}}False{{/with}}`, {\n cond1: { greeting: 'Hello' }\n });\n\n this.assertText('Hello');\n\n this.runTask(() => this.rerender());\n\n this.assertText('Hello');\n\n this.runTask(() => (0, _metal.set)(this.context, 'cond1.greeting', 'Hello world'));\n\n this.assertText('Hello world');\n\n this.runTask(() => (0, _metal.set)(this.context, 'cond1', false));\n\n this.assertText('False');\n\n this.runTask(() => (0, _metal.set)(this.context, 'cond1', { greeting: 'Hello' }));\n\n this.assertText('Hello');\n }\n\n ['@test can access alias and original scope']() {\n this.render(`{{#with person as |tom|}}{{title}}: {{tom.name}}{{/with}}`, {\n title: 'Señor Engineer',\n person: { name: 'Tom Dale' }\n });\n\n this.assertText('Señor Engineer: Tom Dale');\n\n this.runTask(() => this.rerender());\n\n this.assertText('Señor Engineer: Tom Dale');\n\n this.runTask(() => {\n (0, _metal.set)(this.context, 'person.name', 'Yehuda Katz');\n (0, _metal.set)(this.context, 'title', 'Principal Engineer');\n });\n\n this.assertText('Principal Engineer: Yehuda Katz');\n\n this.runTask(() => {\n (0, _metal.set)(this.context, 'person', { name: 'Tom Dale' });\n (0, _metal.set)(this.context, 'title', 'Señor Engineer');\n });\n\n this.assertText('Señor Engineer: Tom Dale');\n }\n\n ['@test the scoped variable is not available outside the {{#with}} block.']() {\n this.render(`{{name}}-{{#with other as |name|}}{{name}}{{/with}}-{{name}}`, {\n name: 'Stef',\n other: 'Yehuda'\n });\n\n this.assertText('Stef-Yehuda-Stef');\n\n this.runTask(() => this.rerender());\n\n this.assertText('Stef-Yehuda-Stef');\n\n this.runTask(() => (0, _metal.set)(this.context, 'other', 'Chad'));\n\n this.assertText('Stef-Chad-Stef');\n\n this.runTask(() => (0, _metal.set)(this.context, 'name', 'Tom'));\n\n this.assertText('Tom-Chad-Tom');\n\n this.runTask(() => {\n (0, _metal.set)(this.context, 'name', 'Stef');\n (0, _metal.set)(this.context, 'other', 'Yehuda');\n });\n\n this.assertText('Stef-Yehuda-Stef');\n }\n\n ['@test inverse template is displayed with context']() {\n this.render(`{{#with falsyThing as |thing|}}Has Thing{{else}}No Thing {{otherThing}}{{/with}}`, {\n falsyThing: null,\n otherThing: 'bar'\n });\n\n this.assertText('No Thing bar');\n\n this.runTask(() => this.rerender());\n\n this.assertText('No Thing bar');\n\n this.runTask(() => (0, _metal.set)(this.context, 'otherThing', 'biz'));\n\n this.assertText('No Thing biz');\n\n this.runTask(() => (0, _metal.set)(this.context, 'falsyThing', true));\n\n this.assertText('Has Thing');\n\n this.runTask(() => (0, _metal.set)(this.context, 'otherThing', 'baz'));\n\n this.assertText('Has Thing');\n\n this.runTask(() => {\n (0, _metal.set)(this.context, 'otherThing', 'bar');\n (0, _metal.set)(this.context, 'falsyThing', null);\n });\n\n this.assertText('No Thing bar');\n }\n\n ['@test can access alias of a proxy']() {\n this.render(`{{#with proxy as |person|}}{{person.name}}{{/with}}`, {\n proxy: _runtime.ObjectProxy.create({ content: { name: 'Tom Dale' } })\n });\n\n this.assertText('Tom Dale');\n\n this.runTask(() => this.rerender());\n\n this.assertText('Tom Dale');\n\n this.runTask(() => (0, _metal.set)(this.context, 'proxy.name', 'Yehuda Katz'));\n\n this.assertText('Yehuda Katz');\n\n this.runTask(() => (0, _metal.set)(this.context, 'proxy.content', { name: 'Godfrey Chan' }));\n\n this.assertText('Godfrey Chan');\n\n this.runTask(() => (0, _metal.set)(this.context, 'proxy.content.name', 'Stefan Penner'));\n\n this.assertText('Stefan Penner');\n\n this.runTask(() => (0, _metal.set)(this.context, 'proxy.content', null));\n\n this.assertText('');\n\n this.runTask(() => (0, _metal.set)(this.context, 'proxy', _runtime.ObjectProxy.create({ content: { name: 'Tom Dale' } })));\n\n this.assertText('Tom Dale');\n }\n\n ['@test can access alias of an array']() {\n this.render(`{{#with arrayThing as |words|}}{{#each words as |word|}}{{word}}{{/each}}{{/with}}`, {\n arrayThing: (0, _runtime.A)(['Hello', ' ', 'world'])\n });\n\n this.assertText('Hello world');\n\n this.runTask(() => this.rerender());\n\n this.assertText('Hello world');\n\n this.runTask(() => {\n let array = (0, _metal.get)(this.context, 'arrayThing');\n array.replace(0, 1, ['Goodbye']);\n (0, _runtime.removeAt)(array, 1);\n array.insertAt(1, ', ');\n array.pushObject('!');\n });\n\n this.assertText('Goodbye, world!');\n\n this.runTask(() => (0, _metal.set)(this.context, 'arrayThing', ['Hello', ' ', 'world']));\n\n this.assertText('Hello world');\n }\n\n ['@test `attrs` can be used as a block param [GH#14678]']() {\n this.render('{{#with hash as |attrs|}}[{{hash.foo}}-{{attrs.foo}}]{{/with}}', {\n hash: { foo: 'foo' }\n });\n\n this.assertText('[foo-foo]');\n\n this.runTask(() => this.rerender());\n\n this.assertText('[foo-foo]');\n\n this.runTask(() => this.context.set('hash.foo', 'FOO'));\n\n this.assertText('[FOO-FOO]');\n\n this.runTask(() => this.context.set('hash.foo', 'foo'));\n\n this.assertText('[foo-foo]');\n }\n });\n\n (0, _testCase.moduleFor)('Syntax test: Multiple {{#with as}} helpers', class extends _testCase.RenderingTest {\n ['@test re-using the same variable with different {{#with}} blocks does not override each other']() {\n this.render(`Admin: {{#with admin as |person|}}{{person.name}}{{/with}} User: {{#with user as |person|}}{{person.name}}{{/with}}`, {\n admin: { name: 'Tom Dale' },\n user: { name: 'Yehuda Katz' }\n });\n\n this.assertText('Admin: Tom Dale User: Yehuda Katz');\n\n this.runTask(() => this.rerender());\n\n this.assertText('Admin: Tom Dale User: Yehuda Katz');\n\n this.runTask(() => {\n (0, _metal.set)(this.context, 'admin.name', 'Godfrey Chan');\n (0, _metal.set)(this.context, 'user.name', 'Stefan Penner');\n });\n\n this.assertText('Admin: Godfrey Chan User: Stefan Penner');\n\n this.runTask(() => {\n (0, _metal.set)(this.context, 'admin', { name: 'Tom Dale' });\n (0, _metal.set)(this.context, 'user', { name: 'Yehuda Katz' });\n });\n\n this.assertText('Admin: Tom Dale User: Yehuda Katz');\n }\n\n ['@test the scoped variable is not available outside the {{#with}} block']() {\n this.render(`{{ring}}-{{#with first as |ring|}}{{ring}}-{{#with fifth as |ring|}}{{ring}}-{{#with ninth as |ring|}}{{ring}}-{{/with}}{{ring}}-{{/with}}{{ring}}-{{/with}}{{ring}}`, {\n ring: 'Greed',\n first: 'Limbo',\n fifth: 'Wrath',\n ninth: 'Treachery'\n });\n\n this.assertText('Greed-Limbo-Wrath-Treachery-Wrath-Limbo-Greed');\n\n this.runTask(() => this.rerender());\n\n this.assertText('Greed-Limbo-Wrath-Treachery-Wrath-Limbo-Greed');\n\n this.runTask(() => {\n (0, _metal.set)(this.context, 'ring', 'O');\n (0, _metal.set)(this.context, 'fifth', 'D');\n });\n\n this.assertText('O-Limbo-D-Treachery-D-Limbo-O');\n\n this.runTask(() => {\n (0, _metal.set)(this.context, 'first', 'I');\n (0, _metal.set)(this.context, 'ninth', 'K');\n });\n\n this.assertText('O-I-D-K-D-I-O');\n\n this.runTask(() => {\n (0, _metal.set)(this.context, 'ring', 'Greed');\n (0, _metal.set)(this.context, 'first', 'Limbo');\n (0, _metal.set)(this.context, 'fifth', 'Wrath');\n (0, _metal.set)(this.context, 'ninth', 'Treachery');\n });\n\n this.assertText('Greed-Limbo-Wrath-Treachery-Wrath-Limbo-Greed');\n }\n\n ['@test it should support {{#with name as |foo|}}, then {{#with foo as |bar|}}']() {\n this.render(`{{#with name as |foo|}}{{#with foo as |bar|}}{{bar}}{{/with}}{{/with}}`, {\n name: 'caterpillar'\n });\n\n this.assertText('caterpillar');\n\n this.runTask(() => this.rerender());\n\n this.assertText('caterpillar');\n\n this.runTask(() => (0, _metal.set)(this.context, 'name', 'butterfly'));\n\n this.assertText('butterfly');\n\n this.runTask(() => (0, _metal.set)(this.context, 'name', 'caterpillar'));\n\n this.assertText('caterpillar');\n }\n\n ['@test updating the context should update the alias']() {\n this.render(`{{#with this as |person|}}{{person.name}}{{/with}}`, {\n name: 'Los Pivots'\n });\n\n this.assertText('Los Pivots');\n\n this.runTask(() => this.rerender());\n\n this.assertText('Los Pivots');\n\n this.runTask(() => (0, _metal.set)(this.context, 'name', \"l'Pivots\"));\n\n this.assertText(\"l'Pivots\");\n\n this.runTask(() => (0, _metal.set)(this.context, 'name', 'Los Pivots'));\n\n this.assertText('Los Pivots');\n }\n\n ['@test nested {{#with}} blocks should have access to root context']() {\n this.render(_abstractTestCase.strip`\n {{name}}\n {{#with committer1.name as |name|}}\n [{{name}}\n {{#with committer2.name as |name|}}\n [{{name}}]\n {{/with}}\n {{name}}]\n {{/with}}\n {{name}}\n {{#with committer2.name as |name|}}\n [{{name}}\n {{#with committer1.name as |name|}}\n [{{name}}]\n {{/with}}\n {{name}}]\n {{/with}}\n {{name}}\n `, {\n name: 'ebryn',\n committer1: { name: 'trek' },\n committer2: { name: 'machty' }\n });\n\n this.assertText('ebryn[trek[machty]trek]ebryn[machty[trek]machty]ebryn');\n\n this.runTask(() => this.rerender());\n\n this.assertText('ebryn[trek[machty]trek]ebryn[machty[trek]machty]ebryn');\n\n this.runTask(() => (0, _metal.set)(this.context, 'name', 'chancancode'));\n\n this.assertText('chancancode[trek[machty]trek]chancancode[machty[trek]machty]chancancode');\n\n this.runTask(() => (0, _metal.set)(this.context, 'committer1', { name: 'krisselden' }));\n\n this.assertText('chancancode[krisselden[machty]krisselden]chancancode[machty[krisselden]machty]chancancode');\n\n this.runTask(() => {\n (0, _metal.set)(this.context, 'committer1.name', 'wycats');\n (0, _metal.set)(this.context, 'committer2', { name: 'rwjblue' });\n });\n\n this.assertText('chancancode[wycats[rwjblue]wycats]chancancode[rwjblue[wycats]rwjblue]chancancode');\n\n this.runTask(() => {\n (0, _metal.set)(this.context, 'name', 'ebryn');\n (0, _metal.set)(this.context, 'committer1', { name: 'trek' });\n (0, _metal.set)(this.context, 'committer2', { name: 'machty' });\n });\n\n this.assertText('ebryn[trek[machty]trek]ebryn[machty[trek]machty]ebryn');\n }\n });\n});","enifed('@ember/-internals/glimmer/tests/unit/outlet-test', ['@ember/-internals/glimmer', '@ember/runloop', 'internal-test-helpers'], function (_glimmer, _runloop, _internalTestHelpers) {\n 'use strict';\n\n (0, _internalTestHelpers.moduleFor)('Glimmer OutletView', class extends _internalTestHelpers.AbstractTestCase {\n ['@test render in the render queue'](assert) {\n let didAppendOutletView = 0;\n let expectedOutlet = '#foo.bar';\n\n let renderer = {\n appendOutletView(view, target) {\n didAppendOutletView++;\n assert.equal(view, outletView);\n assert.equal(target, expectedOutlet);\n }\n };\n\n let outletView = new _glimmer.OutletView({}, renderer);\n\n (0, _runloop.run)(() => {\n assert.equal(didAppendOutletView, 0, 'appendOutletView should not yet have been called (before appendTo)');\n outletView.appendTo(expectedOutlet);\n assert.equal(didAppendOutletView, 0, 'appendOutletView should not yet have been called (sync after appendTo)');\n\n (0, _runloop.schedule)('actions', () => assert.equal(didAppendOutletView, 0, 'appendOutletView should not yet have been called (in actions)'));\n (0, _runloop.schedule)('render', () => assert.equal(didAppendOutletView, 1, 'appendOutletView should be invoked in render'));\n });\n }\n });\n});","enifed('@ember/-internals/glimmer/tests/unit/runtime-resolver-cache-test', ['@ember/-internals/glimmer/tests/utils/test-case', '@ember/-internals/glimmer/tests/utils/helpers', '@ember/-internals/metal', 'internal-test-helpers'], function (_testCase, _helpers, _metal, _internalTestHelpers) {\n 'use strict';\n\n (0, _testCase.moduleFor)('ember-glimmer runtime resolver cache', class extends _testCase.RenderingTest {\n '@test a helper definition is only generated once'(assert) {\n this.registerHelper('foo-bar', () => 'foo-bar helper!');\n this.registerHelper('baz-qux', () => 'baz-qux helper!');\n\n // assert precondition\n let state = this.getCacheCounters();\n assert.deepEqual(state, {\n templateCacheHits: 0,\n templateCacheMisses: 0,\n componentDefinitionCount: 0,\n helperDefinitionCount: 0\n }, 'precondition');\n\n this.render(`\n {{~#if cond~}}\n {{foo-bar}}\n {{~else~}}\n {{baz-qux}}\n {{~/if}}`, {\n cond: true\n });\n\n this.assertText('foo-bar helper!');\n state = this.expectCacheChanges({ helperDefinitionCount: 1 }, state, 'calculate foo-bar helper only');\n\n // show component-two for the first time\n this.runTask(() => (0, _metal.set)(this.context, 'cond', false));\n\n this.assertText('baz-qux helper!');\n state = this.expectCacheChanges({\n helperDefinitionCount: 1\n }, state, 'calculate baz-qux helper, misses cache');\n\n // show foo-bar again\n this.runTask(() => (0, _metal.set)(this.context, 'cond', true));\n\n this.assertText('foo-bar helper!');\n state = this.expectCacheChanges({}, state, 'toggle back to foo-bar cache hit');\n\n // show baz-qux again\n this.runTask(() => (0, _metal.set)(this.context, 'cond', false));\n\n this.assertText('baz-qux helper!');\n state = this.expectCacheChanges({}, state, 'toggle back to baz-qux cache hit');\n }\n\n '@test a component definition is only generated once'(assert) {\n // static layout\n this.registerComponent('component-one', { template: 'One' });\n this.registerComponent('component-two', {\n ComponentClass: _helpers.Component.extend(),\n template: 'Two'\n });\n\n // assert precondition\n let state = this.getCacheCounters();\n assert.deepEqual(state, {\n templateCacheHits: 0,\n templateCacheMisses: 0,\n componentDefinitionCount: 0,\n helperDefinitionCount: 0\n }, 'precondition');\n\n // show component-one for the first time\n this.render(`{{component componentName}}`, {\n componentName: 'component-one'\n });\n\n this.assertText('One');\n state = this.expectCacheChanges({ componentDefinitionCount: 1 }, state, 'test case component and component-one no change');\n\n // show component-two for the first time\n this.runTask(() => (0, _metal.set)(this.context, 'componentName', 'component-two'));\n\n this.assertText('Two');\n state = this.expectCacheChanges({ componentDefinitionCount: 1 }, state, 'component-two first render');\n\n // show component-one again\n this.runTask(() => (0, _metal.set)(this.context, 'componentName', 'component-one'));\n\n this.assertText('One');\n state = this.expectCacheChanges({}, state, 'toggle back to component-one no change');\n\n // show component-two again\n this.runTask(() => (0, _metal.set)(this.context, 'componentName', 'component-two'));\n\n this.assertText('Two');\n state = this.expectCacheChanges({}, state, 'toggle back to component-two no change');\n }\n\n ['@test each template is only compiled once'](assert) {\n // static layout\n this.registerComponent('component-one', { template: 'One' });\n\n // test directly import template factory onto late bound layout\n let Two = _helpers.Component.extend({\n layout: this.compile('Two')\n });\n this.registerComponent('component-two', { ComponentClass: Two });\n\n // inject layout onto component, share layout with component-one\n this.registerComponent('root-component', { ComponentClass: _helpers.Component });\n this.owner.inject('component:root-component', 'layout', 'template:components/component-one');\n\n // template instance shared between to template managers\n let rootFactory = this.owner.factoryFor('component:root-component');\n\n // assert precondition\n let state = this.getCacheCounters();\n assert.deepEqual(state, {\n templateCacheHits: 0,\n templateCacheMisses: 0,\n componentDefinitionCount: 0,\n helperDefinitionCount: 0\n }, 'precondition');\n\n // show component-one for the first time\n this.render(`\n {{~#if cond~}}\n {{component-one}}\n {{~else~}}\n {{component-two}}\n {{~/if}}`, {\n cond: true\n });\n\n this.assertText('One');\n state = this.expectCacheChanges({ componentDefinitionCount: 1 }, state, 'test case component and component-one no change');\n\n // show component-two for the first time\n this.runTask(() => (0, _metal.set)(this.context, 'cond', false));\n\n this.assertText('Two');\n state = this.expectCacheChanges({\n templateCacheMisses: 1,\n componentDefinitionCount: 1\n }, state, 'component-two first render misses template cache');\n\n // show component-one again\n this.runTask(() => (0, _metal.set)(this.context, 'cond', true));\n\n this.assertText('One');\n state = this.expectCacheChanges({}, state, 'toggle back to component-one no change');\n\n // show component-two again\n this.runTask(() => (0, _metal.set)(this.context, 'cond', false));\n\n this.assertText('Two');\n state = this.expectCacheChanges({\n templateCacheHits: 1\n }, state, 'toggle back to component-two hits template cache');\n\n // render new root append\n let root = rootFactory.create();\n try {\n (0, _internalTestHelpers.runAppend)(root);\n this.assertText('TwoOne');\n // roots have different capabilities so this will hit\n state = this.expectCacheChanges({}, state, 'append root with component-one no change');\n\n // render new root append\n let root2 = rootFactory.create();\n try {\n (0, _internalTestHelpers.runAppend)(root2);\n this.assertText('TwoOneOne');\n state = this.expectCacheChanges({}, state, 'append another root no change');\n } finally {\n (0, _internalTestHelpers.runDestroy)(root2);\n }\n } finally {\n (0, _internalTestHelpers.runDestroy)(root);\n }\n }\n\n getCacheCounters() {\n let {\n templateCacheHits,\n templateCacheMisses,\n componentDefinitionCount,\n helperDefinitionCount\n } = this.runtimeResolver;\n\n return {\n templateCacheHits,\n templateCacheMisses,\n componentDefinitionCount,\n helperDefinitionCount\n };\n }\n\n expectCacheChanges(expected, lastState, message) {\n let state = this.getCacheCounters();\n let actual = diff(state, lastState);\n this.assert.deepEqual(actual, expected, message);\n return state;\n }\n });\n\n function diff(state, lastState) {\n let res = {};\n Object.keys(state).forEach(key => {\n let delta = state[key] - lastState[key];\n if (delta !== 0) {\n res[key] = state[key] - lastState[key];\n }\n });\n return res;\n }\n});","enifed('@ember/-internals/glimmer/tests/unit/template-factory-test', ['ember-template-compiler', '@ember/-internals/glimmer', '@ember/-internals/glimmer/tests/utils/test-case', '@ember/-internals/glimmer/tests/utils/helpers'], function (_emberTemplateCompiler, _glimmer, _testCase, _helpers) {\n 'use strict';\n\n (0, _testCase.moduleFor)('Template factory test', class extends _testCase.RenderingTest {\n ['@test the template factory returned from precompile is the same as compile'](assert) {\n let { owner } = this;\n let { runtimeResolver } = this;\n\n let templateStr = 'Hello {{name}}';\n let options = { moduleName: 'my-app/templates/some-module.hbs' };\n\n let spec = (0, _emberTemplateCompiler.precompile)(templateStr, options);\n let body = `exports.default = template(${spec});`;\n let module = new Function('exports', 'template', body);\n let exports = {};\n module(exports, _glimmer.template);\n let Precompiled = exports['default'];\n\n let Compiled = (0, _emberTemplateCompiler.compile)(templateStr, options);\n\n assert.equal(typeof Precompiled.create, 'function', 'precompiled is a factory');\n assert.ok(Precompiled.id, 'precompiled has id');\n\n assert.equal(typeof Compiled.create, 'function', 'compiled is a factory');\n assert.ok(Compiled.id, 'compiled has id');\n\n assert.equal(runtimeResolver.templateCacheMisses, 0, 'misses 0');\n assert.equal(runtimeResolver.templateCacheHits, 0, 'hits 0');\n\n let precompiled = runtimeResolver.createTemplate(Precompiled, owner);\n\n assert.equal(runtimeResolver.templateCacheMisses, 1, 'misses 1');\n assert.equal(runtimeResolver.templateCacheHits, 0, 'hits 0');\n\n let compiled = runtimeResolver.createTemplate(Compiled, owner);\n\n assert.equal(runtimeResolver.templateCacheMisses, 2, 'misses 2');\n assert.equal(runtimeResolver.templateCacheHits, 0, 'hits 0');\n\n assert.ok(typeof precompiled.spec !== 'string', 'Spec has been parsed');\n assert.ok(typeof compiled.spec !== 'string', 'Spec has been parsed');\n\n this.registerComponent('x-precompiled', {\n ComponentClass: _helpers.Component.extend({\n layout: Precompiled\n })\n });\n\n this.registerComponent('x-compiled', {\n ComponentClass: _helpers.Component.extend({\n layout: Compiled\n })\n });\n\n this.render('{{x-precompiled name=\"precompiled\"}} {{x-compiled name=\"compiled\"}}');\n\n assert.equal(runtimeResolver.templateCacheMisses, 2, 'misses 2');\n assert.equal(runtimeResolver.templateCacheHits, 2, 'hits 2');\n\n this.assertText('Hello precompiled Hello compiled');\n }\n });\n});","enifed('@ember/-internals/glimmer/tests/unit/utils/debug-stack-test', ['@ember/-internals/glimmer', 'internal-test-helpers'], function (_glimmer, _internalTestHelpers) {\n 'use strict';\n\n (0, _internalTestHelpers.moduleFor)('Glimmer DebugStack', class extends _internalTestHelpers.AbstractTestCase {\n ['@test pushing and popping'](assert) {\n if (true /* DEBUG */) {\n let stack = new _glimmer.DebugStack();\n\n assert.equal(stack.peek(), undefined);\n\n stack.push('template:application');\n\n assert.equal(stack.peek(), '\"template:application\"');\n\n stack.push('component:top-level-component');\n\n assert.equal(stack.peek(), '\"component:top-level-component\"');\n\n stack.pushEngine('engine:my-engine');\n stack.push('component:component-in-engine');\n\n assert.equal(stack.peek(), '\"component:component-in-engine\" (in \"engine:my-engine\")');\n\n stack.pop();\n stack.pop();\n let item = stack.pop();\n\n assert.equal(item, 'component:top-level-component');\n assert.equal(stack.peek(), '\"template:application\"');\n } else {\n assert.expect(0);\n }\n }\n });\n});","enifed('@ember/-internals/glimmer/tests/utils/abstract-test-case', ['exports', 'internal-test-helpers'], function (exports, _internalTestHelpers) {\n 'use strict';\n\n Object.defineProperty(exports, 'TestCase', {\n enumerable: true,\n get: function () {\n return _internalTestHelpers.AbstractTestCase;\n }\n });\n Object.defineProperty(exports, 'applyMixins', {\n enumerable: true,\n get: function () {\n return _internalTestHelpers.applyMixins;\n }\n });\n Object.defineProperty(exports, 'strip', {\n enumerable: true,\n get: function () {\n return _internalTestHelpers.strip;\n }\n });\n});","enifed('@ember/-internals/glimmer/tests/utils/helpers', ['exports', 'ember-template-compiler', '@ember/-internals/glimmer'], function (exports, _emberTemplateCompiler, _glimmer) {\n 'use strict';\n\n Object.defineProperty(exports, 'compile', {\n enumerable: true,\n get: function () {\n return _emberTemplateCompiler.compile;\n }\n });\n Object.defineProperty(exports, 'precompile', {\n enumerable: true,\n get: function () {\n return _emberTemplateCompiler.precompile;\n }\n });\n Object.defineProperty(exports, 'INVOKE', {\n enumerable: true,\n get: function () {\n return _glimmer.INVOKE;\n }\n });\n Object.defineProperty(exports, 'Helper', {\n enumerable: true,\n get: function () {\n return _glimmer.Helper;\n }\n });\n Object.defineProperty(exports, 'helper', {\n enumerable: true,\n get: function () {\n return _glimmer.helper;\n }\n });\n Object.defineProperty(exports, 'Component', {\n enumerable: true,\n get: function () {\n return _glimmer.Component;\n }\n });\n Object.defineProperty(exports, 'LinkComponent', {\n enumerable: true,\n get: function () {\n return _glimmer.LinkComponent;\n }\n });\n Object.defineProperty(exports, 'InteractiveRenderer', {\n enumerable: true,\n get: function () {\n return _glimmer.InteractiveRenderer;\n }\n });\n Object.defineProperty(exports, 'InertRenderer', {\n enumerable: true,\n get: function () {\n return _glimmer.InertRenderer;\n }\n });\n Object.defineProperty(exports, 'htmlSafe', {\n enumerable: true,\n get: function () {\n return _glimmer.htmlSafe;\n }\n });\n Object.defineProperty(exports, 'SafeString', {\n enumerable: true,\n get: function () {\n return _glimmer.SafeString;\n }\n });\n Object.defineProperty(exports, 'DOMChanges', {\n enumerable: true,\n get: function () {\n return _glimmer.DOMChanges;\n }\n });\n Object.defineProperty(exports, 'isHTMLSafe', {\n enumerable: true,\n get: function () {\n return _glimmer.isHTMLSafe;\n }\n });\n});","enifed('@ember/-internals/glimmer/tests/utils/shared-conditional-tests', ['exports', '@ember/polyfills', '@ember/-internals/glimmer/tests/utils/abstract-test-case', '@ember/-internals/glimmer/tests/utils/test-case', '@ember/-internals/metal', '@ember/-internals/runtime', '@ember/-internals/glimmer/tests/utils/helpers'], function (exports, _polyfills, _abstractTestCase, _testCase, _metal, _runtime, _helpers) {\n 'use strict';\n\n exports.IfUnlessWithSyntaxTest = exports.TogglingSyntaxConditionalsTest = exports.IfUnlessHelperTest = exports.TogglingHelperConditionalsTest = exports.TogglingConditionalsTest = exports.ArrayTestCases = exports.ObjectTestCases = exports.BasicConditionalsTest = exports.StableFalsyGenerator = exports.StableTruthyGenerator = exports.FalsyGenerator = exports.TruthyGenerator = undefined;\n\n\n class AbstractConditionalsTest extends _testCase.RenderingTest {\n get truthyValue() {\n return true;\n }\n\n get falsyValue() {\n return false;\n }\n\n wrapperFor(templates) {\n return templates.join('');\n }\n\n wrappedTemplateFor(options) {\n return this.wrapperFor([this.templateFor(options)]);\n }\n\n /* abstract */\n templateFor() /* { cond, truthy, falsy } */{\n // e.g. `{{#if ${cond}}}${truthy}{{else}}${falsy}{{/if}}`\n throw new Error('Not implemented: `templateFor`');\n }\n\n /* abstract */\n renderValues() /* ...values */{\n throw new Error('Not implemented: `renderValues`');\n }\n }\n\n class AbstractGenerator {\n constructor(cases) {\n this.cases = cases;\n }\n\n /* abstract */\n generate() /* value, idx */{\n throw new Error('Not implemented: `generate`');\n }\n }\n\n /*\n The test cases in this file generally follow the following pattern:\n \n 1. Render with [ truthy, ...(other truthy variations), falsy, ...(other falsy variations) ]\n 2. No-op rerender\n 3. Make all of them falsy (through interior mutation)\n 4. Make all of them truthy (through interior mutation, sometimes with some slight variations)\n 5. Reset them to their original values (through replacement)\n */\n\n class TruthyGenerator extends AbstractGenerator {\n generate(value, idx) {\n return {\n [`@test it should consider ${JSON.stringify(value)} truthy [${idx}]`]() {\n this.renderValues(value);\n\n this.assertText('T1');\n\n this.runTask(() => this.rerender());\n\n this.assertText('T1');\n\n this.runTask(() => (0, _metal.set)(this.context, 'cond1', this.falsyValue));\n\n this.assertText('F1');\n\n this.runTask(() => (0, _metal.set)(this.context, 'cond1', value));\n\n this.assertText('T1');\n }\n };\n }\n }\n\n exports.TruthyGenerator = TruthyGenerator;\n class FalsyGenerator extends AbstractGenerator {\n generate(value, idx) {\n return {\n [`@test it should consider ${JSON.stringify(value)} falsy [${idx}]`]() {\n this.renderValues(value);\n\n this.assertText('F1');\n\n this.runTask(() => this.rerender());\n\n this.assertText('F1');\n\n this.runTask(() => (0, _metal.set)(this.context, 'cond1', this.truthyValue));\n\n this.assertText('T1');\n\n this.runTask(() => (0, _metal.set)(this.context, 'cond1', value));\n\n this.assertText('F1');\n }\n };\n }\n }\n\n exports.FalsyGenerator = FalsyGenerator;\n class StableTruthyGenerator extends TruthyGenerator {\n generate(value, idx) {\n return (0, _polyfills.assign)(super.generate(value, idx), {\n [`@test it maintains DOM stability when condition changes from ${value} to another truthy value and back [${idx}]`]() {\n this.renderValues(value);\n\n this.assertText('T1');\n\n this.takeSnapshot();\n\n this.runTask(() => (0, _metal.set)(this.context, 'cond1', this.truthyValue));\n\n this.assertText('T1');\n\n this.assertInvariants();\n\n this.runTask(() => (0, _metal.set)(this.context, 'cond1', value));\n\n this.assertText('T1');\n\n this.assertInvariants();\n }\n });\n }\n }\n\n exports.StableTruthyGenerator = StableTruthyGenerator;\n class StableFalsyGenerator extends FalsyGenerator {\n generate(value, idx) {\n return (0, _polyfills.assign)(super.generate(value), {\n [`@test it maintains DOM stability when condition changes from ${value} to another falsy value and back [${idx}]`]() {\n this.renderValues(value);\n\n this.assertText('F1');\n\n this.takeSnapshot();\n\n this.runTask(() => (0, _metal.set)(this.context, 'cond1', this.falsyValue));\n\n this.assertText('F1');\n\n this.assertInvariants();\n\n this.runTask(() => (0, _metal.set)(this.context, 'cond1', value));\n\n this.assertText('F1');\n\n this.assertInvariants();\n }\n });\n }\n }\n\n exports.StableFalsyGenerator = StableFalsyGenerator;\n class ObjectProxyGenerator extends AbstractGenerator {\n generate(value, idx) {\n // This is inconsistent with our usual to-bool policy, but the current proxy implementation\n // simply uses !!content to determine truthiness\n if (value) {\n return {\n [`@test it should consider an object proxy with \\`${JSON.stringify(value)}\\` truthy [${idx}]`]() {\n this.renderValues(_runtime.ObjectProxy.create({ content: value }));\n\n this.assertText('T1');\n\n this.runTask(() => this.rerender());\n\n this.assertText('T1');\n\n this.runTask(() => (0, _metal.set)(this.context, 'cond1.content', this.falsyValue));\n\n this.assertText('F1');\n\n this.runTask(() => (0, _metal.set)(this.context, 'cond1', _runtime.ObjectProxy.create({ content: value })));\n\n this.assertText('T1');\n }\n };\n } else {\n return {\n [`@test it should consider an object proxy with \\`${JSON.stringify(value)}\\` falsy [${idx}]`]() {\n this.renderValues(_runtime.ObjectProxy.create({ content: value }));\n\n this.assertText('F1');\n\n this.runTask(() => this.rerender());\n\n this.assertText('F1');\n\n this.runTask(() => (0, _metal.set)(this.context, 'cond1.content', this.truthyValue));\n\n this.assertText('T1');\n\n this.runTask(() => (0, _metal.set)(this.context, 'cond1', _runtime.ObjectProxy.create({ content: value })));\n\n this.assertText('F1');\n }\n };\n }\n }\n }\n\n // Testing behaviors shared across all conditionals, i.e. {{#if}}, {{#unless}},\n // {{#with}}, {{#each}}, {{#each-in}}, (if) and (unless)\n class BasicConditionalsTest extends AbstractConditionalsTest {\n ['@test it renders the corresponding block based on the conditional']() {\n this.renderValues(this.truthyValue, this.falsyValue);\n\n this.assertText('T1F2');\n\n this.runTask(() => this.rerender());\n\n this.assertText('T1F2');\n\n this.runTask(() => (0, _metal.set)(this.context, 'cond1', this.falsyValue));\n\n this.assertText('F1F2');\n\n this.runTask(() => {\n (0, _metal.set)(this.context, 'cond1', this.truthyValue);\n (0, _metal.set)(this.context, 'cond2', this.truthyValue);\n });\n\n this.assertText('T1T2');\n\n this.runTask(() => {\n (0, _metal.set)(this.context, 'cond1', this.truthyValue);\n (0, _metal.set)(this.context, 'cond2', this.falsyValue);\n });\n\n this.assertText('T1F2');\n }\n }\n\n exports.BasicConditionalsTest = BasicConditionalsTest;\n // Testing behaviors related to ember objects, object proxies, etc\n const ObjectTestCases = exports.ObjectTestCases = {\n ['@test it considers object proxies without content falsy']() {\n this.renderValues(_runtime.ObjectProxy.create({ content: {} }), _runtime.ObjectProxy.create({ content: _runtime.Object.create() }), _runtime.ObjectProxy.create({ content: null }));\n\n this.assertText('T1T2F3');\n\n this.runTask(() => this.rerender());\n\n this.assertText('T1T2F3');\n\n this.runTask(() => {\n (0, _metal.set)(this.context, 'cond1.content', null);\n (0, _metal.set)(this.context, 'cond2.content', null);\n });\n\n this.assertText('F1F2F3');\n\n this.runTask(() => {\n (0, _metal.set)(this.context, 'cond1.content', _runtime.Object.create());\n (0, _metal.set)(this.context, 'cond2.content', {});\n (0, _metal.set)(this.context, 'cond3.content', { foo: 'bar' });\n });\n\n this.assertText('T1T2T3');\n\n this.runTask(() => {\n (0, _metal.set)(this.context, 'cond1', _runtime.ObjectProxy.create({ content: {} }));\n (0, _metal.set)(this.context, 'cond2', _runtime.ObjectProxy.create({ content: _runtime.Object.create() }));\n (0, _metal.set)(this.context, 'cond3', _runtime.ObjectProxy.create({ content: null }));\n });\n\n this.assertText('T1T2F3');\n }\n };\n\n // Testing behaviors related to arrays and array proxies\n const ArrayTestCases = exports.ArrayTestCases = {\n ['@test it considers empty arrays falsy']() {\n this.renderValues((0, _runtime.A)(['hello']), (0, _runtime.A)());\n\n this.assertText('T1F2');\n\n this.runTask(() => this.rerender());\n\n this.assertText('T1F2');\n\n this.runTask(() => (0, _runtime.removeAt)((0, _metal.get)(this.context, 'cond1'), 0));\n\n this.assertText('F1F2');\n\n this.runTask(() => {\n (0, _metal.get)(this.context, 'cond1').pushObject('hello');\n (0, _metal.get)(this.context, 'cond2').pushObjects([1]);\n });\n\n this.assertText('T1T2');\n\n this.runTask(() => {\n (0, _metal.set)(this.context, 'cond1', (0, _runtime.A)(['hello']));\n (0, _metal.set)(this.context, 'cond2', (0, _runtime.A)());\n });\n\n this.assertText('T1F2');\n },\n\n ['@test it considers array proxies without content falsy']() {\n this.renderValues(_runtime.ArrayProxy.create({ content: (0, _runtime.A)(['hello']) }), _runtime.ArrayProxy.create({ content: null }));\n\n this.assertText('T1F2');\n\n this.runTask(() => this.rerender());\n\n this.assertText('T1F2');\n\n this.runTask(() => {\n (0, _metal.set)(this.context, 'cond1.content', null);\n (0, _metal.set)(this.context, 'cond2.content', null);\n });\n\n this.assertText('F1F2');\n\n this.runTask(() => {\n (0, _metal.set)(this.context, 'cond1.content', (0, _runtime.A)(['hello']));\n (0, _metal.set)(this.context, 'cond2.content', (0, _runtime.A)([1]));\n });\n\n this.assertText('T1T2');\n\n this.runTask(() => {\n (0, _metal.set)(this.context, 'cond1', _runtime.ArrayProxy.create({ content: (0, _runtime.A)(['hello']) }));\n (0, _metal.set)(this.context, 'cond2', _runtime.ArrayProxy.create({ content: null }));\n });\n\n this.assertText('T1F2');\n },\n\n ['@test it considers array proxies with empty arrays falsy']() {\n this.renderValues(_runtime.ArrayProxy.create({ content: (0, _runtime.A)(['hello']) }), _runtime.ArrayProxy.create({ content: (0, _runtime.A)() }));\n\n this.assertText('T1F2');\n\n this.runTask(() => this.rerender());\n\n this.assertText('T1F2');\n\n this.runTask(() => (0, _runtime.removeAt)((0, _metal.get)(this.context, 'cond1.content'), 0));\n\n this.assertText('F1F2');\n\n this.runTask(() => {\n (0, _metal.get)(this.context, 'cond1.content').pushObject('hello');\n (0, _metal.get)(this.context, 'cond2.content').pushObjects([1]);\n });\n\n this.assertText('T1T2');\n\n this.runTask(() => {\n (0, _metal.set)(this.context, 'cond1', _runtime.ArrayProxy.create({ content: (0, _runtime.A)(['hello']) }));\n (0, _metal.set)(this.context, 'cond2', _runtime.ArrayProxy.create({ content: (0, _runtime.A)() }));\n });\n\n this.assertText('T1F2');\n }\n };\n\n const IfUnlessWithTestCases = [new StableTruthyGenerator([true, ' ', 'hello', 'false', 'null', 'undefined', 1, ['hello'], (0, _runtime.A)(['hello']), {}, { foo: 'bar' }, _runtime.Object.create(), _runtime.Object.create({ foo: 'bar' }), _runtime.ObjectProxy.create({ content: true }), Object, function () {},\n /*jshint -W053 */\n new String('hello'), new String(''), new Boolean(true), new Boolean(false),\n /*jshint +W053 */\n new Date()]), new StableFalsyGenerator([false, null, undefined, '', 0, [], (0, _runtime.A)(), _runtime.ObjectProxy.create({ content: undefined })]), new ObjectProxyGenerator([true, ' ', 'hello', 'false', 'null', 'undefined', 1, ['hello'], (0, _runtime.A)(['hello']), _runtime.ArrayProxy.create({ content: ['hello'] }), _runtime.ArrayProxy.create({ content: [] }), {}, { foo: 'bar' }, _runtime.Object.create(), _runtime.Object.create({ foo: 'bar' }), _runtime.ObjectProxy.create({ content: true }), _runtime.ObjectProxy.create({ content: undefined }),\n /*jshint -W053 */\n new String('hello'), new String(''), new Boolean(true), new Boolean(false),\n /*jshint +W053 */\n new Date(), false, null, undefined, '', 0, [], (0, _runtime.A)()]), ObjectTestCases, ArrayTestCases];\n\n // Testing behaviors shared across the \"toggling\" conditionals, i.e. {{#if}},\n // {{#unless}}, {{#with}}, {{#each}}, {{#each-in}}, (if) and (unless)\n class TogglingConditionalsTest extends BasicConditionalsTest {}\n\n exports.TogglingConditionalsTest = TogglingConditionalsTest;\n // Testing behaviors shared across the (if) and (unless) helpers\n class TogglingHelperConditionalsTest extends TogglingConditionalsTest {\n renderValues(...values) {\n let templates = [];\n let context = {};\n\n for (let i = 1; i <= values.length; i++) {\n templates.push(this.templateFor({ cond: `cond${i}`, truthy: `t${i}`, falsy: `f${i}` }));\n context[`t${i}`] = `T${i}`;\n context[`f${i}`] = `F${i}`;\n context[`cond${i}`] = values[i - 1];\n }\n\n let wrappedTemplate = this.wrapperFor(templates);\n this.render(wrappedTemplate, context);\n }\n\n ['@test it has access to the outer scope from both templates']() {\n let template = this.wrapperFor([this.templateFor({ cond: 'cond1', truthy: 'truthy', falsy: 'falsy' }), this.templateFor({ cond: 'cond2', truthy: 'truthy', falsy: 'falsy' })]);\n\n this.render(template, {\n cond1: this.truthyValue,\n cond2: this.falsyValue,\n truthy: 'YES',\n falsy: 'NO'\n });\n\n this.assertText('YESNO');\n\n this.runTask(() => this.rerender());\n\n this.assertText('YESNO');\n\n this.runTask(() => {\n (0, _metal.set)(this.context, 'truthy', 'YASS');\n (0, _metal.set)(this.context, 'falsy', 'NOPE');\n });\n\n this.assertText('YASSNOPE');\n\n this.runTask(() => {\n (0, _metal.set)(this.context, 'cond1', this.falsyValue);\n (0, _metal.set)(this.context, 'cond2', this.truthyValue);\n });\n\n this.assertText('NOPEYASS');\n\n this.runTask(() => {\n (0, _metal.set)(this.context, 'truthy', 'YES');\n (0, _metal.set)(this.context, 'falsy', 'NO');\n (0, _metal.set)(this.context, 'cond1', this.truthyValue);\n (0, _metal.set)(this.context, 'cond2', this.falsyValue);\n });\n\n this.assertText('YESNO');\n }\n\n ['@test it does not update when the unbound helper is used']() {\n let template = this.wrapperFor([this.templateFor({\n cond: '(unbound cond1)',\n truthy: '\"T1\"',\n falsy: '\"F1\"'\n }), this.templateFor({\n cond: '(unbound cond2)',\n truthy: '\"T2\"',\n falsy: '\"F2\"'\n })]);\n\n this.render(template, { cond1: this.truthyValue, cond2: this.falsyValue });\n\n this.assertText('T1F2');\n\n this.runTask(() => this.rerender());\n\n this.assertText('T1F2');\n\n this.runTask(() => (0, _metal.set)(this.context, 'cond1', this.falsyValue));\n\n this.assertText('T1F2');\n\n this.runTask(() => {\n (0, _metal.set)(this.context, 'cond1', this.truthyValue);\n (0, _metal.set)(this.context, 'cond2', this.truthyValue);\n });\n\n this.assertText('T1F2');\n\n this.runTask(() => {\n (0, _metal.set)(this.context, 'cond1', this.truthyValue);\n (0, _metal.set)(this.context, 'cond2', this.falsyValue);\n });\n\n this.assertText('T1F2');\n }\n\n ['@test evaluation should be lazy'](assert) {\n let truthyEvaluated;\n let falsyEvaluated;\n\n let withoutEvaluatingTruthy = callback => {\n truthyEvaluated = false;\n callback();\n assert.ok(!truthyEvaluated, 'x-truthy is not evaluated');\n };\n\n let withoutEvaluatingFalsy = callback => {\n falsyEvaluated = false;\n callback();\n assert.ok(!falsyEvaluated, 'x-falsy is not evaluated');\n };\n\n this.registerHelper('x-truthy', {\n compute() {\n truthyEvaluated = true;\n return 'T';\n }\n });\n\n this.registerHelper('x-falsy', {\n compute() {\n falsyEvaluated = true;\n return 'F';\n }\n });\n\n let template = this.wrappedTemplateFor({\n cond: 'cond',\n truthy: '(x-truthy)',\n falsy: '(x-falsy)'\n });\n\n withoutEvaluatingFalsy(() => this.render(template, { cond: this.truthyValue }));\n\n this.assertText('T');\n\n withoutEvaluatingFalsy(() => this.runTask(() => this.rerender()));\n\n this.assertText('T');\n\n withoutEvaluatingTruthy(() => this.runTask(() => (0, _metal.set)(this.context, 'cond', this.falsyValue)));\n\n this.assertText('F');\n\n withoutEvaluatingTruthy(() => this.runTask(() => this.rerender()));\n\n this.assertText('F');\n\n withoutEvaluatingFalsy(() => this.runTask(() => (0, _metal.set)(this.context, 'cond', this.truthyValue)));\n\n this.assertText('T');\n }\n }\n\n exports.TogglingHelperConditionalsTest = TogglingHelperConditionalsTest;\n class IfUnlessHelperTest extends TogglingHelperConditionalsTest {}\n\n exports.IfUnlessHelperTest = IfUnlessHelperTest;\n (0, _abstractTestCase.applyMixins)(IfUnlessHelperTest, ...IfUnlessWithTestCases);\n\n // Testing behaviors shared across the \"toggling\" syntatical constructs,\n // i.e. {{#if}}, {{#unless}}, {{#with}}, {{#each}} and {{#each-in}}\n class TogglingSyntaxConditionalsTest extends TogglingConditionalsTest {\n renderValues(...values) {\n let templates = [];\n let context = {};\n\n for (let i = 1; i <= values.length; i++) {\n templates.push(this.templateFor({\n cond: `cond${i}`,\n truthy: `{{t}}${i}`,\n falsy: `{{f}}${i}`\n }));\n context[`cond${i}`] = values[i - 1];\n }\n\n let wrappedTemplate = this.wrapperFor(templates);\n this.render(wrappedTemplate, (0, _polyfills.assign)({ t: 'T', f: 'F' }, context));\n }\n\n ['@test it does not update when the unbound helper is used']() {\n let template = `${this.templateFor({\n cond: '(unbound cond1)',\n truthy: 'T1',\n falsy: 'F1'\n })}${this.templateFor({\n cond: '(unbound cond2)',\n truthy: 'T2',\n falsy: 'F2'\n })}`;\n\n this.render(template, { cond1: this.truthyValue, cond2: this.falsyValue });\n\n this.assertText('T1F2');\n\n this.runTask(() => this.rerender());\n\n this.assertText('T1F2');\n\n this.runTask(() => (0, _metal.set)(this.context, 'cond1', this.falsyValue));\n\n this.assertText('T1F2');\n\n this.runTask(() => {\n (0, _metal.set)(this.context, 'cond1', this.truthyValue);\n (0, _metal.set)(this.context, 'cond2', this.truthyValue);\n });\n\n this.assertText('T1F2');\n\n this.runTask(() => {\n (0, _metal.set)(this.context, 'cond1', this.truthyValue);\n (0, _metal.set)(this.context, 'cond2', this.falsyValue);\n });\n\n this.assertText('T1F2');\n }\n\n ['@test it has access to the outer scope from both templates']() {\n let template = this.wrapperFor([this.templateFor({\n cond: 'cond1',\n truthy: '{{truthy}}',\n falsy: '{{falsy}}'\n }), this.templateFor({\n cond: 'cond2',\n truthy: '{{truthy}}',\n falsy: '{{falsy}}'\n })]);\n\n this.render(template, {\n cond1: this.truthyValue,\n cond2: this.falsyValue,\n truthy: 'YES',\n falsy: 'NO'\n });\n\n this.assertText('YESNO');\n\n this.runTask(() => this.rerender());\n\n this.assertText('YESNO');\n\n this.runTask(() => {\n (0, _metal.set)(this.context, 'truthy', 'YASS');\n (0, _metal.set)(this.context, 'falsy', 'NOPE');\n });\n\n this.assertText('YASSNOPE');\n\n this.runTask(() => {\n (0, _metal.set)(this.context, 'cond1', this.falsyValue);\n (0, _metal.set)(this.context, 'cond2', this.truthyValue);\n });\n\n this.assertText('NOPEYASS');\n\n this.runTask(() => {\n (0, _metal.set)(this.context, 'truthy', 'YES');\n (0, _metal.set)(this.context, 'falsy', 'NO');\n (0, _metal.set)(this.context, 'cond1', this.truthyValue);\n (0, _metal.set)(this.context, 'cond2', this.falsyValue);\n });\n\n this.assertText('YESNO');\n }\n\n ['@test it updates correctly when enclosing another conditional']() {\n // This tests whether the outer conditional tracks its bounds correctly as its inner bounds changes\n let inner = this.templateFor({\n cond: 'inner',\n truthy: 'T-inner',\n falsy: 'F-inner'\n });\n let template = this.wrappedTemplateFor({\n cond: 'outer',\n truthy: inner,\n falsy: 'F-outer'\n });\n\n this.render(template, { outer: this.truthyValue, inner: this.truthyValue });\n\n this.assertText('T-inner');\n\n this.runTask(() => this.rerender());\n\n this.assertText('T-inner');\n\n // Changes the inner bounds\n this.runTask(() => (0, _metal.set)(this.context, 'inner', this.falsyValue));\n\n this.assertText('F-inner');\n\n // Now rerender the outer conditional, which require first clearing its bounds\n this.runTask(() => (0, _metal.set)(this.context, 'outer', this.falsyValue));\n\n this.assertText('F-outer');\n }\n\n ['@test it updates correctly when enclosing #each']() {\n // This tests whether the outer conditional tracks its bounds correctly as its inner bounds changes\n let template = this.wrappedTemplateFor({\n cond: 'outer',\n truthy: '{{#each inner as |text|}}{{text}}{{/each}}',\n falsy: 'F-outer'\n });\n\n this.render(template, {\n outer: this.truthyValue,\n inner: ['inner', '-', 'before']\n });\n\n this.assertText('inner-before');\n\n this.runTask(() => this.rerender());\n\n this.assertText('inner-before');\n\n // Changes the inner bounds\n this.runTask(() => (0, _metal.set)(this.context, 'inner', ['inner-after']));\n\n this.assertText('inner-after');\n\n // Now rerender the outer conditional, which require first clearing its bounds\n this.runTask(() => (0, _metal.set)(this.context, 'outer', this.falsyValue));\n\n this.assertText('F-outer');\n\n // Reset\n this.runTask(() => {\n (0, _metal.set)(this.context, 'inner', ['inner-again']);\n (0, _metal.set)(this.context, 'outer', this.truthyValue);\n });\n\n this.assertText('inner-again');\n\n // Now clear the inner bounds\n this.runTask(() => (0, _metal.set)(this.context, 'inner', []));\n\n this.assertText('');\n\n // Now rerender the outer conditional, which require first clearing its bounds\n this.runTask(() => (0, _metal.set)(this.context, 'outer', this.falsyValue));\n\n this.assertText('F-outer');\n }\n\n ['@test it updates correctly when enclosing triple-curlies']() {\n // This tests whether the outer conditional tracks its bounds correctly as its inner bounds changes\n let template = this.wrappedTemplateFor({\n cond: 'outer',\n truthy: '{{{inner}}}',\n falsy: 'F-outer'\n });\n\n this.render(template, {\n outer: this.truthyValue,\n inner: 'inner-before'\n });\n\n this.assertText('inner-before');\n\n this.runTask(() => this.rerender());\n\n this.assertText('inner-before');\n\n // Changes the inner bounds\n this.runTask(() => (0, _metal.set)(this.context, 'inner', '
inner-after
'));\n\n this.assertText('inner-after');\n\n // Now rerender the outer conditional, which require first clearing its bounds\n this.runTask(() => (0, _metal.set)(this.context, 'outer', this.falsyValue));\n\n this.assertText('F-outer');\n }\n\n ['@test child conditional should not render children if parent conditional becomes false'](assert) {\n let childCreated = false;\n\n this.registerComponent('foo-bar', {\n template: 'foo-bar',\n ComponentClass: _helpers.Component.extend({\n init() {\n this._super(...arguments);\n childCreated = true;\n }\n })\n });\n\n let innerTemplate = this.templateFor({\n cond: 'cond2',\n truthy: '{{foo-bar}}',\n falsy: ''\n });\n let wrappedTemplate = this.wrappedTemplateFor({\n cond: 'cond1',\n truthy: innerTemplate,\n falsy: ''\n });\n\n this.render(wrappedTemplate, {\n cond1: this.truthyValue,\n cond2: this.falsyValue\n });\n\n assert.ok(!childCreated);\n this.assertText('');\n\n this.runTask(() => this.rerender());\n\n assert.ok(!childCreated);\n this.assertText('');\n\n this.runTask(() => {\n (0, _metal.set)(this.context, 'cond2', this.truthyValue);\n (0, _metal.set)(this.context, 'cond1', this.falsyValue);\n });\n\n assert.ok(!childCreated);\n this.assertText('');\n\n this.runTask(() => {\n (0, _metal.set)(this.context, 'cond2', this.falsyValue);\n (0, _metal.set)(this.context, 'cond1', this.truthyValue);\n });\n\n assert.ok(!childCreated);\n this.assertText('');\n }\n\n ['@test evaluation should be lazy'](assert) {\n let truthyEvaluated;\n let falsyEvaluated;\n\n let withoutEvaluatingTruthy = callback => {\n truthyEvaluated = false;\n callback();\n assert.ok(!truthyEvaluated, 'x-truthy is not evaluated');\n };\n\n let withoutEvaluatingFalsy = callback => {\n falsyEvaluated = false;\n callback();\n assert.ok(!falsyEvaluated, 'x-falsy is not evaluated');\n };\n\n this.registerHelper('x-truthy', {\n compute() {\n truthyEvaluated = true;\n return 'T';\n }\n });\n\n this.registerHelper('x-falsy', {\n compute() {\n falsyEvaluated = true;\n return 'F';\n }\n });\n\n let template = this.wrappedTemplateFor({\n cond: 'cond',\n truthy: '{{x-truthy}}',\n falsy: '{{x-falsy}}'\n });\n\n withoutEvaluatingFalsy(() => this.render(template, { cond: this.truthyValue }));\n\n this.assertText('T');\n\n withoutEvaluatingFalsy(() => this.runTask(() => this.rerender()));\n\n this.assertText('T');\n\n withoutEvaluatingTruthy(() => this.runTask(() => (0, _metal.set)(this.context, 'cond', this.falsyValue)));\n\n this.assertText('F');\n\n withoutEvaluatingTruthy(() => this.runTask(() => this.rerender()));\n\n this.assertText('F');\n\n withoutEvaluatingFalsy(() => this.runTask(() => (0, _metal.set)(this.context, 'cond', this.truthyValue)));\n\n this.assertText('T');\n }\n }\n\n exports.TogglingSyntaxConditionalsTest = TogglingSyntaxConditionalsTest;\n class IfUnlessWithSyntaxTest extends TogglingSyntaxConditionalsTest {}\n\n exports.IfUnlessWithSyntaxTest = IfUnlessWithSyntaxTest;\n (0, _abstractTestCase.applyMixins)(IfUnlessWithSyntaxTest, ...IfUnlessWithTestCases);\n});","enifed('@ember/-internals/glimmer/tests/utils/string-test', ['@ember/-internals/glimmer/tests/utils/helpers', '@ember/-internals/glimmer/tests/utils/abstract-test-case', '@ember/-internals/glimmer/tests/utils/test-case'], function (_helpers, _abstractTestCase, _testCase) {\n 'use strict';\n\n (0, _testCase.moduleFor)('SafeString', class extends _abstractTestCase.TestCase {\n ['@test htmlSafe should return an instance of SafeString']() {\n let safeString = (0, _helpers.htmlSafe)('you need to be more bold');\n\n this.assert.ok(safeString instanceof _helpers.SafeString, 'should be a SafeString');\n }\n\n ['@test htmlSafe should return an empty string for null']() {\n let safeString = (0, _helpers.htmlSafe)(null);\n\n this.assert.equal(safeString instanceof _helpers.SafeString, true, 'should be a SafeString');\n this.assert.equal(safeString.toString(), '', 'should return an empty string');\n }\n\n ['@test htmlSafe should return an instance of SafeString']() {\n let safeString = (0, _helpers.htmlSafe)();\n\n this.assert.equal(safeString instanceof _helpers.SafeString, true, 'should be a SafeString');\n this.assert.equal(safeString.toString(), '', 'should return an empty string');\n }\n });\n\n (0, _testCase.moduleFor)('SafeString isHTMLSafe', class extends _abstractTestCase.TestCase {\n ['@test isHTMLSafe should detect SafeString']() {\n let safeString = (0, _helpers.htmlSafe)('Emphasize the important things.');\n\n this.assert.ok((0, _helpers.isHTMLSafe)(safeString));\n }\n\n ['@test isHTMLSafe should not detect SafeString on primatives']() {\n this.assert.notOk((0, _helpers.isHTMLSafe)('Hello World'));\n this.assert.notOk((0, _helpers.isHTMLSafe)({}));\n this.assert.notOk((0, _helpers.isHTMLSafe)([]));\n this.assert.notOk((0, _helpers.isHTMLSafe)(10));\n this.assert.notOk((0, _helpers.isHTMLSafe)(null));\n }\n });\n});","enifed('@ember/-internals/glimmer/tests/utils/test-case', ['exports', 'internal-test-helpers'], function (exports, _internalTestHelpers) {\n 'use strict';\n\n Object.defineProperty(exports, 'TestCase', {\n enumerable: true,\n get: function () {\n return _internalTestHelpers.AbstractTestCase;\n }\n });\n Object.defineProperty(exports, 'ApplicationTest', {\n enumerable: true,\n get: function () {\n return _internalTestHelpers.ApplicationTestCase;\n }\n });\n Object.defineProperty(exports, 'RenderingTest', {\n enumerable: true,\n get: function () {\n return _internalTestHelpers.RenderingTestCase;\n }\n });\n Object.defineProperty(exports, 'moduleFor', {\n enumerable: true,\n get: function () {\n return _internalTestHelpers.moduleFor;\n }\n });\n});","enifed('@ember/-internals/glimmer/tests/utils/test-helpers', ['exports', 'internal-test-helpers'], function (exports, _internalTestHelpers) {\n 'use strict';\n\n Object.defineProperty(exports, 'styles', {\n enumerable: true,\n get: function () {\n return _internalTestHelpers.styles;\n }\n });\n Object.defineProperty(exports, 'classes', {\n enumerable: true,\n get: function () {\n return _internalTestHelpers.classes;\n }\n });\n Object.defineProperty(exports, 'equalTokens', {\n enumerable: true,\n get: function () {\n return _internalTestHelpers.equalTokens;\n }\n });\n Object.defineProperty(exports, 'equalsElement', {\n enumerable: true,\n get: function () {\n return _internalTestHelpers.equalsElement;\n }\n });\n});","enifed('@ember/-internals/meta/tests/listeners_test', ['internal-test-helpers', '@ember/-internals/meta'], function (_internalTestHelpers, _meta) {\n 'use strict';\n\n (0, _internalTestHelpers.moduleFor)('Ember.meta listeners', class extends _internalTestHelpers.AbstractTestCase {\n ['@test basics'](assert) {\n let t = {};\n let m = (0, _meta.meta)({});\n m.addToListeners('hello', t, 'm', 0);\n let matching = m.matchingListeners('hello');\n assert.equal(matching.length, 3);\n assert.equal(matching[0], t);\n m.removeFromListeners('hello', t, 'm');\n matching = m.matchingListeners('hello');\n assert.equal(matching, undefined);\n }\n\n ['@test inheritance'](assert) {\n let target = {};\n let parent = {};\n let parentMeta = (0, _meta.meta)(parent);\n parentMeta.addToListeners('hello', target, 'm', 0);\n\n let child = Object.create(parent);\n let m = (0, _meta.meta)(child);\n\n let matching = m.matchingListeners('hello');\n assert.equal(matching.length, 3);\n assert.equal(matching[0], target);\n assert.equal(matching[1], 'm');\n assert.equal(matching[2], 0);\n m.removeFromListeners('hello', target, 'm');\n matching = m.matchingListeners('hello');\n assert.equal(matching, undefined);\n matching = parentMeta.matchingListeners('hello');\n assert.equal(matching.length, 3);\n }\n\n ['@test deduplication'](assert) {\n let t = {};\n let m = (0, _meta.meta)({});\n m.addToListeners('hello', t, 'm', 0);\n m.addToListeners('hello', t, 'm', 0);\n let matching = m.matchingListeners('hello');\n assert.equal(matching.length, 3);\n assert.equal(matching[0], t);\n }\n\n ['@test parent caching'](assert) {\n _meta.counters.flattenedListenersCalls = 0;\n _meta.counters.parentListenersUsed = 0;\n\n class Class {}\n let classMeta = (0, _meta.meta)(Class.prototype);\n classMeta.addToListeners('hello', null, 'm', 0);\n\n let instance = new Class();\n let m = (0, _meta.meta)(instance);\n\n let matching = m.matchingListeners('hello');\n\n assert.equal(matching.length, 3);\n assert.equal(_meta.counters.flattenedListenersCalls, 2);\n assert.equal(_meta.counters.parentListenersUsed, 1);\n\n matching = m.matchingListeners('hello');\n\n assert.equal(matching.length, 3);\n assert.equal(_meta.counters.flattenedListenersCalls, 3);\n assert.equal(_meta.counters.parentListenersUsed, 1);\n }\n\n ['@test parent cache invalidation'](assert) {\n _meta.counters.flattenedListenersCalls = 0;\n _meta.counters.parentListenersUsed = 0;\n _meta.counters.listenersInherited = 0;\n\n class Class {}\n let classMeta = (0, _meta.meta)(Class.prototype);\n classMeta.addToListeners('hello', null, 'm', 0);\n\n let instance = new Class();\n let m = (0, _meta.meta)(instance);\n\n let matching = m.matchingListeners('hello');\n\n assert.equal(matching.length, 3);\n assert.equal(_meta.counters.flattenedListenersCalls, 2);\n assert.equal(_meta.counters.parentListenersUsed, 1);\n assert.equal(_meta.counters.listenersInherited, 0);\n\n m.addToListeners('hello', null, 'm2');\n\n matching = m.matchingListeners('hello');\n\n assert.equal(matching.length, 6);\n assert.equal(_meta.counters.flattenedListenersCalls, 4);\n assert.equal(_meta.counters.parentListenersUsed, 1);\n assert.equal(_meta.counters.listenersInherited, 1);\n }\n\n ['@test reopen after flatten'](assert) {\n // Ensure counter is zeroed\n _meta.counters.reopensAfterFlatten = 0;\n\n class Class1 {}\n let class1Meta = (0, _meta.meta)(Class1.prototype);\n class1Meta.addToListeners('hello', null, 'm', 0);\n\n let instance1 = new Class1();\n let m1 = (0, _meta.meta)(instance1);\n\n class Class2 {}\n let class2Meta = (0, _meta.meta)(Class2.prototype);\n class2Meta.addToListeners('hello', null, 'm', 0);\n\n let instance2 = new Class2();\n let m2 = (0, _meta.meta)(instance2);\n\n m1.matchingListeners('hello');\n m2.matchingListeners('hello');\n\n assert.equal(_meta.counters.reopensAfterFlatten, 0, 'no reopen calls yet');\n\n m1.addToListeners('world', null, 'm', 0);\n m2.addToListeners('world', null, 'm', 0);\n m1.matchingListeners('world');\n m2.matchingListeners('world');\n\n assert.equal(_meta.counters.reopensAfterFlatten, 1, 'reopen calls after invalidating parent cache');\n\n m1.addToListeners('world', null, 'm', 0);\n m2.addToListeners('world', null, 'm', 0);\n m1.matchingListeners('world');\n m2.matchingListeners('world');\n\n assert.equal(_meta.counters.reopensAfterFlatten, 1, 'no reopen calls after mutating leaf nodes');\n\n class1Meta.removeFromListeners('hello', null, 'm');\n class2Meta.removeFromListeners('hello', null, 'm');\n m1.matchingListeners('hello');\n m2.matchingListeners('hello');\n\n assert.equal(_meta.counters.reopensAfterFlatten, 2, 'one reopen call after mutating parents');\n\n class1Meta.addToListeners('hello', null, 'm', 0);\n m1.matchingListeners('hello');\n class2Meta.addToListeners('hello', null, 'm', 0);\n m2.matchingListeners('hello');\n\n assert.equal(_meta.counters.reopensAfterFlatten, 3, 'one reopen call after mutating parents and flattening out of order');\n }\n\n ['@test REMOVE_ALL does not interfere with future adds'](assert) {\n expectDeprecation(() => {\n let t = {};\n let m = (0, _meta.meta)({});\n\n m.addToListeners('hello', t, 'm', 0);\n let matching = m.matchingListeners('hello');\n\n assert.equal(matching.length, 3);\n assert.equal(matching[0], t);\n\n // Remove all listeners\n m.removeAllListeners('hello');\n\n matching = m.matchingListeners('hello');\n assert.equal(matching, undefined);\n\n m.addToListeners('hello', t, 'm', 0);\n matching = m.matchingListeners('hello');\n\n // listener was added back successfully\n assert.equal(matching.length, 3);\n assert.equal(matching[0], t);\n });\n }\n });\n});","enifed('@ember/-internals/meta/tests/meta_test', ['internal-test-helpers', '@ember/-internals/meta'], function (_internalTestHelpers, _meta) {\n 'use strict';\n\n (0, _internalTestHelpers.moduleFor)('Ember.meta', class extends _internalTestHelpers.AbstractTestCase {\n ['@test should return the same hash for an object'](assert) {\n let obj = {};\n\n (0, _meta.meta)(obj).foo = 'bar';\n\n assert.equal((0, _meta.meta)(obj).foo, 'bar', 'returns same hash with multiple calls to Ember.meta()');\n }\n\n ['@test meta is not enumerable'](assert) {\n let proto, obj, props, prop;\n proto = { foo: 'bar' };\n (0, _meta.meta)(proto);\n obj = Object.create(proto);\n (0, _meta.meta)(obj);\n obj.bar = 'baz';\n props = [];\n for (prop in obj) {\n props.push(prop);\n }\n assert.deepEqual(props.sort(), ['bar', 'foo']);\n if (typeof JSON !== 'undefined' && 'stringify' in JSON) {\n try {\n JSON.stringify(obj);\n } catch (e) {\n assert.ok(false, 'meta should not fail JSON.stringify');\n }\n }\n }\n\n ['@test meta.writeWatching issues useful error after destroy']() {\n let target = {\n toString() {\n return '';\n }\n };\n let targetMeta = (0, _meta.meta)(target);\n\n targetMeta.destroy();\n\n expectAssertion(() => {\n targetMeta.writeWatching('hello', 1);\n }, 'Cannot update watchers for `hello` on `` after it has been destroyed.');\n }\n\n ['@test meta.writableTag issues useful error after destroy']() {\n let target = {\n toString() {\n return '';\n }\n };\n let targetMeta = (0, _meta.meta)(target);\n\n targetMeta.destroy();\n\n expectAssertion(() => {\n targetMeta.writableTag(() => {});\n }, 'Cannot create a new tag for `` after it has been destroyed.');\n }\n\n ['@test meta.writableChainWatchers issues useful error after destroy']() {\n let target = {\n toString() {\n return '';\n }\n };\n let targetMeta = (0, _meta.meta)(target);\n\n targetMeta.destroy();\n\n expectAssertion(() => {\n targetMeta.writableChainWatchers(() => {});\n }, 'Cannot create a new chain watcher for `` after it has been destroyed.');\n }\n\n ['@test meta.writableChains issues useful error after destroy']() {\n let target = {\n toString() {\n return '';\n }\n };\n let targetMeta = (0, _meta.meta)(target);\n\n targetMeta.destroy();\n\n expectAssertion(() => {\n targetMeta.writableChains(() => {});\n }, 'Cannot create a new chains for `` after it has been destroyed.');\n }\n\n ['@test meta.writeValues issues useful error after destroy']() {\n let target = {\n toString() {\n return '';\n }\n };\n let targetMeta = (0, _meta.meta)(target);\n\n targetMeta.destroy();\n\n expectAssertion(() => {\n targetMeta.writeValues('derp', 'ohai');\n }, 'Cannot set the value of `derp` on `` after it has been destroyed.');\n }\n\n ['@test meta.writeDeps issues useful error after destroy']() {\n let target = {\n toString() {\n return '';\n }\n };\n let targetMeta = (0, _meta.meta)(target);\n\n targetMeta.destroy();\n\n expectAssertion(() => {\n targetMeta.writeDeps('derp', 'ohai', 1);\n }, 'Cannot modify dependent keys for `ohai` on `` after it has been destroyed.');\n }\n });\n});","enifed('@ember/-internals/metal/tests/accessors/get_path_test', ['@ember/-internals/metal', 'internal-test-helpers'], function (_metal, _internalTestHelpers) {\n 'use strict';\n\n let obj;\n\n (0, _internalTestHelpers.moduleFor)('get with path', class extends _internalTestHelpers.AbstractTestCase {\n constructor() {\n super();\n obj = {\n foo: {\n bar: {\n baz: { biff: 'BIFF' }\n }\n },\n foothis: {\n bar: {\n baz: { biff: 'BIFF' }\n }\n },\n falseValue: false,\n emptyString: '',\n Wuz: {\n nar: 'foo'\n },\n nullValue: null\n };\n }\n\n teardown() {\n obj = undefined;\n }\n\n // ..........................................................\n // LOCAL PATHS\n //\n ['@test [obj, foo] -> obj.foo'](assert) {\n assert.deepEqual((0, _metal.get)(obj, 'foo'), obj.foo);\n }\n\n ['@test [obj, foo.bar] -> obj.foo.bar'](assert) {\n assert.deepEqual((0, _metal.get)(obj, 'foo.bar'), obj.foo.bar);\n }\n\n ['@test [obj, foothis.bar] -> obj.foothis.bar'](assert) {\n assert.deepEqual((0, _metal.get)(obj, 'foothis.bar'), obj.foothis.bar);\n }\n\n ['@test [obj, falseValue.notDefined] -> (undefined)'](assert) {\n assert.strictEqual((0, _metal.get)(obj, 'falseValue.notDefined'), undefined);\n }\n\n ['@test [obj, emptyString.length] -> 0'](assert) {\n assert.strictEqual((0, _metal.get)(obj, 'emptyString.length'), 0);\n }\n\n ['@test [obj, nullValue.notDefined] -> (undefined)'](assert) {\n assert.strictEqual((0, _metal.get)(obj, 'nullValue.notDefined'), undefined);\n }\n\n // ..........................................................\n // GLOBAL PATHS TREATED LOCAL WITH GET\n //\n\n ['@test [obj, Wuz] -> obj.Wuz'](assert) {\n assert.deepEqual((0, _metal.get)(obj, 'Wuz'), obj.Wuz);\n }\n\n ['@test [obj, Wuz.nar] -> obj.Wuz.nar'](assert) {\n assert.deepEqual((0, _metal.get)(obj, 'Wuz.nar'), obj.Wuz.nar);\n }\n\n ['@test [obj, Foo] -> (undefined)'](assert) {\n assert.strictEqual((0, _metal.get)(obj, 'Foo'), undefined);\n }\n\n ['@test [obj, Foo.bar] -> (undefined)'](assert) {\n assert.strictEqual((0, _metal.get)(obj, 'Foo.bar'), undefined);\n }\n });\n});","enifed('@ember/-internals/metal/tests/accessors/get_properties_test', ['@ember/-internals/metal', 'internal-test-helpers'], function (_metal, _internalTestHelpers) {\n 'use strict';\n\n (0, _internalTestHelpers.moduleFor)('getProperties', class extends _internalTestHelpers.AbstractTestCase {\n ['@test can retrieve a hash of properties from an object via an argument list or array of property names'](assert) {\n let obj = {\n firstName: 'Steve',\n lastName: 'Jobs',\n companyName: 'Apple, Inc.'\n };\n\n assert.deepEqual((0, _metal.getProperties)(obj, 'firstName', 'lastName'), {\n firstName: 'Steve',\n lastName: 'Jobs'\n });\n assert.deepEqual((0, _metal.getProperties)(obj, 'firstName', 'lastName'), {\n firstName: 'Steve',\n lastName: 'Jobs'\n });\n assert.deepEqual((0, _metal.getProperties)(obj, 'lastName'), { lastName: 'Jobs' });\n assert.deepEqual((0, _metal.getProperties)(obj), {});\n assert.deepEqual((0, _metal.getProperties)(obj, ['firstName', 'lastName']), {\n firstName: 'Steve',\n lastName: 'Jobs'\n });\n assert.deepEqual((0, _metal.getProperties)(obj, ['firstName']), {\n firstName: 'Steve'\n });\n assert.deepEqual((0, _metal.getProperties)(obj, []), {});\n }\n });\n});","enifed('@ember/-internals/metal/tests/accessors/get_test', ['@ember/-internals/environment', '@ember/-internals/runtime', '@ember/-internals/metal', 'internal-test-helpers', '@ember/runloop'], function (_environment, _runtime, _metal, _internalTestHelpers, _runloop) {\n 'use strict';\n\n function aget(x, y) {\n return x[y];\n }\n\n (0, _internalTestHelpers.moduleFor)('get', class extends _internalTestHelpers.AbstractTestCase {\n ['@test should get arbitrary properties on an object'](assert) {\n let obj = {\n string: 'string',\n number: 23,\n boolTrue: true,\n boolFalse: false,\n nullValue: null\n };\n\n for (let key in obj) {\n if (!obj.hasOwnProperty(key)) {\n continue;\n }\n assert.equal((0, _metal.get)(obj, key), obj[key], key);\n }\n }\n\n ['@test should retrieve a number key on an object'](assert) {\n let obj = { 1: 'first' };\n\n assert.equal((0, _metal.get)(obj, 1), 'first');\n }\n\n ['@test should retrieve an array index'](assert) {\n let arr = ['first', 'second'];\n\n assert.equal((0, _metal.get)(arr, 0), 'first');\n assert.equal((0, _metal.get)(arr, 1), 'second');\n }\n\n ['@test should retrieve an empty string key on an object'](assert) {\n let obj = { '': 'empty-string' };\n\n assert.equal((0, _metal.get)(obj, ''), 'empty-string');\n }\n\n ['@test should return undefined when passed an empty string if that key does not exist on an object'](assert) {\n let obj = { tomster: true };\n\n assert.equal((0, _metal.get)(obj, ''), undefined);\n }\n\n ['@test should not access a property more than once'](assert) {\n let count = 0;\n let obj = {\n get id() {\n return ++count;\n }\n };\n\n (0, _metal.get)(obj, 'id');\n\n assert.equal(count, 1);\n }\n\n ['@test should call unknownProperty on watched values if the value is undefined using getFromEmberMetal()/set()'](assert) {\n let obj = {\n unknownProperty(key) {\n assert.equal(key, 'foo', 'should pass key');\n return 'FOO';\n }\n };\n assert.equal((0, _metal.get)(obj, 'foo'), 'FOO', 'should return value from unknown');\n }\n\n ['@test should call unknownProperty on watched values if the value is undefined using accessors'](assert) {\n if (_environment.ENV.USES_ACCESSORS) {\n let obj = {\n unknownProperty(key) {\n assert.equal(key, 'foo', 'should pass key');\n return 'FOO';\n }\n };\n assert.equal(aget(obj, 'foo'), 'FOO', 'should return value from unknown');\n } else {\n assert.ok('SKIPPING ACCESSORS');\n }\n }\n\n ['@test get works with paths correctly'](assert) {\n let func = function () {};\n func.bar = 'awesome';\n\n let destroyedObj = _runtime.Object.create({ bar: 'great' });\n (0, _runloop.run)(() => destroyedObj.destroy());\n\n assert.equal((0, _metal.get)({ foo: null }, 'foo.bar'), undefined);\n assert.equal((0, _metal.get)({ foo: { bar: 'hello' } }, 'foo.bar.length'), 5);\n assert.equal((0, _metal.get)({ foo: func }, 'foo.bar'), 'awesome');\n assert.equal((0, _metal.get)({ foo: func }, 'foo.bar.length'), 7);\n assert.equal((0, _metal.get)({}, 'foo.bar.length'), undefined);\n assert.equal((0, _metal.get)(function () {}, 'foo.bar.length'), undefined);\n assert.equal((0, _metal.get)('', 'foo.bar.length'), undefined);\n assert.equal((0, _metal.get)({ foo: destroyedObj }, 'foo.bar'), undefined);\n }\n\n ['@test warn on attempts to call get with no arguments']() {\n expectAssertion(function () {\n (0, _metal.get)('aProperty');\n }, /Get must be called with two arguments;/i);\n }\n\n ['@test warn on attempts to call get with only one argument']() {\n expectAssertion(function () {\n (0, _metal.get)('aProperty');\n }, /Get must be called with two arguments;/i);\n }\n\n ['@test warn on attempts to call get with more then two arguments']() {\n expectAssertion(function () {\n (0, _metal.get)({}, 'aProperty', true);\n }, /Get must be called with two arguments;/i);\n }\n\n ['@test warn on attempts to get a property of undefined']() {\n expectAssertion(function () {\n (0, _metal.get)(undefined, 'aProperty');\n }, /Cannot call get with 'aProperty' on an undefined object/i);\n }\n\n ['@test warn on attempts to get a property path of undefined']() {\n expectAssertion(function () {\n (0, _metal.get)(undefined, 'aProperty.on.aPath');\n }, /Cannot call get with 'aProperty.on.aPath' on an undefined object/);\n }\n\n ['@test warn on attempts to get a property of null']() {\n expectAssertion(function () {\n (0, _metal.get)(null, 'aProperty');\n }, /Cannot call get with 'aProperty' on an undefined object/);\n }\n\n ['@test warn on attempts to get a property path of null']() {\n expectAssertion(function () {\n (0, _metal.get)(null, 'aProperty.on.aPath');\n }, /Cannot call get with 'aProperty.on.aPath' on an undefined object/);\n }\n\n ['@test warn on attempts to use get with an unsupported property path']() {\n let obj = {};\n expectAssertion(() => (0, _metal.get)(obj, null), /The key provided to get must be a string or number, you passed null/);\n expectAssertion(() => (0, _metal.get)(obj, NaN), /The key provided to get must be a string or number, you passed NaN/);\n expectAssertion(() => (0, _metal.get)(obj, undefined), /The key provided to get must be a string or number, you passed undefined/);\n expectAssertion(() => (0, _metal.get)(obj, false), /The key provided to get must be a string or number, you passed false/);\n }\n\n // ..........................................................\n // BUGS\n //\n\n ['@test (regression) watched properties on unmodified inherited objects should still return their original value'](assert) {\n let MyMixin = _metal.Mixin.create({\n someProperty: 'foo',\n propertyDidChange: (0, _metal.observer)('someProperty', () => {})\n });\n\n let baseObject = MyMixin.apply({});\n let theRealObject = Object.create(baseObject);\n\n assert.equal((0, _metal.get)(theRealObject, 'someProperty'), 'foo', 'should return the set value, not false');\n }\n });\n\n (0, _internalTestHelpers.moduleFor)('getWithDefault', class extends _internalTestHelpers.AbstractTestCase {\n ['@test should get arbitrary properties on an object'](assert) {\n let obj = {\n string: 'string',\n number: 23,\n boolTrue: true,\n boolFalse: false,\n nullValue: null\n };\n\n for (let key in obj) {\n if (!obj.hasOwnProperty(key)) {\n continue;\n }\n assert.equal((0, _metal.getWithDefault)(obj, key, 'fail'), obj[key], key);\n }\n\n obj = {\n undef: undefined\n };\n\n assert.equal((0, _metal.getWithDefault)(obj, 'undef', 'default'), 'default', 'explicit undefined retrieves the default');\n assert.equal((0, _metal.getWithDefault)(obj, 'not-present', 'default'), 'default', 'non-present key retrieves the default');\n }\n\n ['@test should call unknownProperty if defined and value is undefined'](assert) {\n let obj = {\n count: 0,\n unknownProperty(key) {\n assert.equal(key, 'foo', 'should pass key');\n this.count++;\n return 'FOO';\n }\n };\n\n assert.equal((0, _metal.get)(obj, 'foo'), 'FOO', 'should return value from unknown');\n assert.equal(obj.count, 1, 'should have invoked');\n }\n\n ['@test if unknownProperty is present, it is called using getFromEmberMetal()/set()'](assert) {\n let obj = {\n unknownProperty(key) {\n if (key === 'foo') {\n assert.equal(key, 'foo', 'should pass key');\n return 'FOO';\n }\n }\n };\n assert.equal((0, _metal.getWithDefault)(obj, 'foo', 'fail'), 'FOO', 'should return value from unknownProperty');\n assert.equal((0, _metal.getWithDefault)(obj, 'bar', 'default'), 'default', 'should convert undefined from unknownProperty into default');\n }\n\n ['@test if unknownProperty is present, it is called using accessors'](assert) {\n if (_environment.ENV.USES_ACCESSORS) {\n let obj = {\n unknownProperty(key) {\n if (key === 'foo') {\n assert.equal(key, 'foo', 'should pass key');\n return 'FOO';\n }\n }\n };\n assert.equal(aget(obj, 'foo', 'fail'), 'FOO', 'should return value from unknownProperty');\n assert.equal(aget(obj, 'bar', 'default'), 'default', 'should convert undefined from unknownProperty into default');\n } else {\n assert.ok('SKIPPING ACCESSORS');\n }\n }\n\n // ..........................................................\n // BUGS\n //\n\n ['@test (regression) watched properties on unmodified inherited objects should still return their original value'](assert) {\n let MyMixin = _metal.Mixin.create({\n someProperty: 'foo',\n propertyDidChange: (0, _metal.observer)('someProperty', () => {\n /* nothing to do */\n })\n });\n\n let baseObject = MyMixin.apply({});\n let theRealObject = Object.create(baseObject);\n\n assert.equal((0, _metal.getWithDefault)(theRealObject, 'someProperty', 'fail'), 'foo', 'should return the set value, not false');\n }\n });\n});","enifed('@ember/-internals/metal/tests/accessors/mandatory_setters_test', ['@ember/-internals/metal', '@ember/-internals/meta', 'internal-test-helpers'], function (_metal, _meta, _internalTestHelpers) {\n 'use strict';\n\n function hasMandatorySetter(object, property) {\n try {\n return Object.getOwnPropertyDescriptor(object, property).set.isMandatorySetter === true;\n } catch (e) {\n return false;\n }\n }\n\n function hasMetaValue(object, property) {\n return (0, _meta.meta)(object).peekValues(property) !== undefined;\n }\n\n if (true /* DEBUG */) {\n (0, _internalTestHelpers.moduleFor)('mandory-setters', class extends _internalTestHelpers.AbstractTestCase {\n ['@test does not assert if property is not being watched'](assert) {\n let obj = {\n someProp: null,\n toString() {\n return 'custom-object';\n }\n };\n\n obj.someProp = 'blastix';\n assert.equal((0, _metal.get)(obj, 'someProp'), 'blastix');\n }\n\n ['@test should not setup mandatory-setter if property is not writable'](assert) {\n assert.expect(6);\n\n let obj = {};\n\n Object.defineProperty(obj, 'a', { value: true });\n Object.defineProperty(obj, 'b', { value: false });\n Object.defineProperty(obj, 'c', { value: undefined });\n Object.defineProperty(obj, 'd', { value: undefined, writable: false });\n Object.defineProperty(obj, 'e', {\n value: undefined,\n configurable: false\n });\n Object.defineProperty(obj, 'f', {\n value: undefined,\n configurable: true\n });\n\n (0, _metal.watch)(obj, 'a');\n (0, _metal.watch)(obj, 'b');\n (0, _metal.watch)(obj, 'c');\n (0, _metal.watch)(obj, 'd');\n (0, _metal.watch)(obj, 'e');\n (0, _metal.watch)(obj, 'f');\n\n assert.ok(!hasMandatorySetter(obj, 'a'), 'mandatory-setter should not be installed');\n assert.ok(!hasMandatorySetter(obj, 'b'), 'mandatory-setter should not be installed');\n assert.ok(!hasMandatorySetter(obj, 'c'), 'mandatory-setter should not be installed');\n assert.ok(!hasMandatorySetter(obj, 'd'), 'mandatory-setter should not be installed');\n assert.ok(!hasMandatorySetter(obj, 'e'), 'mandatory-setter should not be installed');\n assert.ok(!hasMandatorySetter(obj, 'f'), 'mandatory-setter should not be installed');\n }\n\n ['@test should not teardown non mandatory-setter descriptor'](assert) {\n assert.expect(1);\n\n let obj = {\n get a() {\n return 'hi';\n }\n };\n\n (0, _metal.watch)(obj, 'a');\n (0, _metal.unwatch)(obj, 'a');\n\n assert.equal(obj.a, 'hi');\n }\n\n ['@test should not confuse non descriptor watched gets'](assert) {\n assert.expect(2);\n\n let obj = {\n get a() {\n return 'hi';\n }\n };\n\n (0, _metal.watch)(obj, 'a');\n assert.equal((0, _metal.get)(obj, 'a'), 'hi');\n assert.equal(obj.a, 'hi');\n }\n\n ['@test should not setup mandatory-setter if setter is already setup on property'](assert) {\n assert.expect(2);\n\n let obj = { someProp: null };\n\n Object.defineProperty(obj, 'someProp', {\n get() {\n return null;\n },\n\n set(value) {\n assert.equal(value, 'foo-bar', 'custom setter was called');\n }\n });\n\n (0, _metal.watch)(obj, 'someProp');\n assert.ok(!hasMandatorySetter(obj, 'someProp'), 'mandatory-setter should not be installed');\n\n obj.someProp = 'foo-bar';\n }\n\n ['@test watched ES5 setter should not be smashed by mandatory setter'](assert) {\n let value;\n let obj = {\n get foo() {},\n set foo(_value) {\n value = _value;\n }\n };\n\n (0, _metal.watch)(obj, 'foo');\n\n (0, _metal.set)(obj, 'foo', 2);\n assert.equal(value, 2);\n }\n\n ['@test should not setup mandatory-setter if setter is already setup on property in parent prototype'](assert) {\n assert.expect(2);\n\n function Foo() {}\n\n Object.defineProperty(Foo.prototype, 'someProp', {\n get() {\n return null;\n },\n\n set(value) {\n assert.equal(value, 'foo-bar', 'custom setter was called');\n }\n });\n\n let obj = new Foo();\n\n (0, _metal.watch)(obj, 'someProp');\n assert.ok(!hasMandatorySetter(obj, 'someProp'), 'mandatory-setter should not be installed');\n\n obj.someProp = 'foo-bar';\n }\n\n ['@test should not setup mandatory-setter if setter is already setup on property in grandparent prototype'](assert) {\n assert.expect(2);\n\n function Foo() {}\n\n Object.defineProperty(Foo.prototype, 'someProp', {\n get() {\n return null;\n },\n\n set(value) {\n assert.equal(value, 'foo-bar', 'custom setter was called');\n }\n });\n\n function Bar() {}\n Bar.prototype = Object.create(Foo.prototype);\n Bar.prototype.constructor = Bar;\n\n let obj = new Bar();\n\n (0, _metal.watch)(obj, 'someProp');\n assert.ok(!hasMandatorySetter(obj, 'someProp'), 'mandatory-setter should not be installed');\n\n obj.someProp = 'foo-bar';\n }\n\n ['@test should not setup mandatory-setter if setter is already setup on property in great grandparent prototype'](assert) {\n assert.expect(2);\n\n function Foo() {}\n\n Object.defineProperty(Foo.prototype, 'someProp', {\n get() {\n return null;\n },\n\n set(value) {\n assert.equal(value, 'foo-bar', 'custom setter was called');\n }\n });\n\n function Bar() {}\n Bar.prototype = Object.create(Foo.prototype);\n Bar.prototype.constructor = Bar;\n\n function Qux() {}\n Qux.prototype = Object.create(Bar.prototype);\n Qux.prototype.constructor = Qux;\n\n let obj = new Qux();\n\n (0, _metal.watch)(obj, 'someProp');\n assert.ok(!hasMandatorySetter(obj, 'someProp'), 'mandatory-setter should not be installed');\n\n obj.someProp = 'foo-bar';\n }\n\n ['@test should assert if set without set when property is being watched']() {\n let obj = {\n someProp: null,\n toString() {\n return 'custom-object';\n }\n };\n\n (0, _metal.watch)(obj, 'someProp');\n\n expectAssertion(function () {\n obj.someProp = 'foo-bar';\n }, 'You must use set() to set the `someProp` property (of custom-object) to `foo-bar`.');\n }\n\n ['@test should not assert if set with set when property is being watched'](assert) {\n let obj = {\n someProp: null,\n toString() {\n return 'custom-object';\n }\n };\n\n (0, _metal.watch)(obj, 'someProp');\n (0, _metal.set)(obj, 'someProp', 'foo-bar');\n\n assert.equal((0, _metal.get)(obj, 'someProp'), 'foo-bar');\n }\n\n ['@test does not setup mandatory-setter if non-configurable'](assert) {\n let obj = {\n someProp: null,\n toString() {\n return 'custom-object';\n }\n };\n\n Object.defineProperty(obj, 'someProp', {\n configurable: false,\n enumerable: true,\n value: 'blastix'\n });\n\n (0, _metal.watch)(obj, 'someProp');\n assert.ok(!hasMandatorySetter(obj, 'someProp'), 'blastix');\n }\n\n ['@test ensure after watch the property is restored (and the value is no-longer stored in meta) [non-enumerable]'](assert) {\n let obj = {\n someProp: null,\n toString() {\n return 'custom-object';\n }\n };\n\n Object.defineProperty(obj, 'someProp', {\n configurable: true,\n enumerable: false,\n value: 'blastix'\n });\n\n (0, _metal.watch)(obj, 'someProp');\n assert.equal(hasMandatorySetter(obj, 'someProp'), true, 'should have a mandatory setter');\n\n let descriptor = Object.getOwnPropertyDescriptor(obj, 'someProp');\n\n assert.equal(descriptor.enumerable, false, 'property should remain non-enumerable');\n assert.equal(descriptor.configurable, true, 'property should remain configurable');\n assert.equal(obj.someProp, 'blastix', 'expected value to be the getter');\n\n assert.equal(descriptor.value, undefined, 'expected existing value to NOT remain');\n\n assert.ok(hasMetaValue(obj, 'someProp'), 'someProp is stored in meta.values');\n\n (0, _metal.unwatch)(obj, 'someProp');\n\n assert.ok(!hasMetaValue(obj, 'someProp'), 'someProp is no longer stored in meta.values');\n\n descriptor = Object.getOwnPropertyDescriptor(obj, 'someProp');\n\n assert.equal(hasMandatorySetter(obj, 'someProp'), false, 'should no longer have a mandatory setter');\n\n assert.equal(descriptor.enumerable, false, 'property should remain non-enumerable');\n assert.equal(descriptor.configurable, true, 'property should remain configurable');\n assert.equal(obj.someProp, 'blastix', 'expected value to be the getter');\n assert.equal(descriptor.value, 'blastix', 'expected existing value to remain');\n\n obj.someProp = 'new value';\n\n // make sure the descriptor remains correct (nothing funky, like a redefined, happened in the setter);\n descriptor = Object.getOwnPropertyDescriptor(obj, 'someProp');\n\n assert.equal(descriptor.enumerable, false, 'property should remain non-enumerable');\n assert.equal(descriptor.configurable, true, 'property should remain configurable');\n assert.equal(descriptor.value, 'new value', 'expected existing value to NOT remain');\n assert.equal(obj.someProp, 'new value', 'expected value to be the getter');\n assert.equal(obj.someProp, 'new value');\n }\n\n ['@test ensure after watch the property is restored (and the value is no-longer stored in meta) [enumerable]'](assert) {\n let obj = {\n someProp: null,\n toString() {\n return 'custom-object';\n }\n };\n\n Object.defineProperty(obj, 'someProp', {\n configurable: true,\n enumerable: true,\n value: 'blastix'\n });\n\n (0, _metal.watch)(obj, 'someProp');\n assert.equal(hasMandatorySetter(obj, 'someProp'), true, 'should have a mandatory setter');\n\n let descriptor = Object.getOwnPropertyDescriptor(obj, 'someProp');\n\n assert.equal(descriptor.enumerable, true, 'property should remain enumerable');\n assert.equal(descriptor.configurable, true, 'property should remain configurable');\n assert.equal(obj.someProp, 'blastix', 'expected value to be the getter');\n\n assert.equal(descriptor.value, undefined, 'expected existing value to NOT remain');\n\n assert.ok(hasMetaValue(obj, 'someProp'), 'someProp is stored in meta.values');\n\n (0, _metal.unwatch)(obj, 'someProp');\n\n assert.ok(!hasMetaValue(obj, 'someProp'), 'someProp is no longer stored in meta.values');\n\n descriptor = Object.getOwnPropertyDescriptor(obj, 'someProp');\n\n assert.equal(hasMandatorySetter(obj, 'someProp'), false, 'should no longer have a mandatory setter');\n\n assert.equal(descriptor.enumerable, true, 'property should remain enumerable');\n assert.equal(descriptor.configurable, true, 'property should remain configurable');\n assert.equal(obj.someProp, 'blastix', 'expected value to be the getter');\n assert.equal(descriptor.value, 'blastix', 'expected existing value to remain');\n\n obj.someProp = 'new value';\n\n // make sure the descriptor remains correct (nothing funky, like a redefined, happened in the setter);\n descriptor = Object.getOwnPropertyDescriptor(obj, 'someProp');\n\n assert.equal(descriptor.enumerable, true, 'property should remain enumerable');\n assert.equal(descriptor.configurable, true, 'property should remain configurable');\n assert.equal(descriptor.value, 'new value', 'expected existing value to NOT remain');\n assert.equal(obj.someProp, 'new value');\n }\n\n ['@test sets up mandatory-setter if property comes from prototype'](assert) {\n assert.expect(2);\n\n let obj = {\n someProp: null,\n toString() {\n return 'custom-object';\n }\n };\n\n let obj2 = Object.create(obj);\n\n (0, _metal.watch)(obj2, 'someProp');\n\n assert.ok(hasMandatorySetter(obj2, 'someProp'), 'mandatory setter has been setup');\n\n expectAssertion(function () {\n obj2.someProp = 'foo-bar';\n }, 'You must use set() to set the `someProp` property (of custom-object) to `foo-bar`.');\n }\n\n ['@test inheritance remains live'](assert) {\n function Parent() {}\n Parent.prototype.food = 'chips';\n\n let child = new Parent();\n\n assert.equal(child.food, 'chips');\n\n (0, _metal.watch)(child, 'food');\n\n assert.equal(child.food, 'chips');\n\n Parent.prototype.food = 'icecreame';\n\n assert.equal(child.food, 'icecreame');\n\n (0, _metal.unwatch)(child, 'food');\n\n assert.equal(child.food, 'icecreame');\n\n Parent.prototype.food = 'chips';\n\n assert.equal(child.food, 'chips');\n }\n\n ['@test inheritance remains live and preserves this'](assert) {\n function Parent(food) {\n this._food = food;\n }\n\n Object.defineProperty(Parent.prototype, 'food', {\n get() {\n return this._food;\n }\n });\n\n let child = new Parent('chips');\n\n assert.equal(child.food, 'chips');\n\n (0, _metal.watch)(child, 'food');\n\n assert.equal(child.food, 'chips');\n\n child._food = 'icecreame';\n\n assert.equal(child.food, 'icecreame');\n\n (0, _metal.unwatch)(child, 'food');\n\n assert.equal(child.food, 'icecreame');\n\n let foodDesc = Object.getOwnPropertyDescriptor(Parent.prototype, 'food');\n assert.ok(!foodDesc.configurable, 'Parent.prototype.food desc should be non configable');\n assert.ok(!foodDesc.enumerable, 'Parent.prototype.food desc should be non enumerable');\n\n assert.equal(foodDesc.get.call({\n _food: 'hi'\n }), 'hi');\n assert.equal(foodDesc.set, undefined);\n\n assert.equal(child.food, 'icecreame');\n }\n });\n }\n});","enifed('@ember/-internals/metal/tests/accessors/set_path_test', ['@ember/-internals/environment', '@ember/-internals/metal', 'internal-test-helpers'], function (_environment, _metal, _internalTestHelpers) {\n 'use strict';\n\n let originalLookup = _environment.context.lookup;\n let lookup;\n\n let obj;\n function commonSetup() {\n _environment.context.lookup = lookup = {};\n obj = {\n foo: {\n bar: {\n baz: { biff: 'BIFF' }\n }\n }\n };\n }\n\n function commonTeardown() {\n _environment.context.lookup = originalLookup;\n obj = null;\n }\n\n (0, _internalTestHelpers.moduleFor)('set with path', class extends _internalTestHelpers.AbstractTestCase {\n constructor() {\n super();\n commonSetup();\n }\n\n teardown() {\n commonTeardown();\n }\n\n ['@test [Foo, bar] -> Foo.bar'](assert) {\n lookup.Foo = {\n toString() {\n return 'Foo';\n }\n }; // Behave like an Ember.Namespace\n\n (0, _metal.set)(lookup.Foo, 'bar', 'baz');\n assert.equal((0, _metal.get)(lookup.Foo, 'bar'), 'baz');\n }\n\n // ..........................................................\n //\n // LOCAL PATHS\n\n ['@test [obj, foo] -> obj.foo'](assert) {\n (0, _metal.set)(obj, 'foo', 'BAM');\n assert.equal((0, _metal.get)(obj, 'foo'), 'BAM');\n }\n\n ['@test [obj, foo.bar] -> obj.foo.bar'](assert) {\n (0, _metal.set)(obj, 'foo.bar', 'BAM');\n assert.equal((0, _metal.get)(obj, 'foo.bar'), 'BAM');\n }\n });\n\n (0, _internalTestHelpers.moduleFor)('set with path - deprecated', class extends _internalTestHelpers.AbstractTestCase {\n constructor() {\n super();\n commonSetup();\n }\n\n teardown() {\n commonTeardown();\n }\n\n // ..........................................................\n // DEPRECATED\n //\n ['@test [obj, bla.bla] gives a proper exception message'](assert) {\n let exceptionMessage = 'Property set failed: object in path \"bla\" could not be found.';\n try {\n (0, _metal.set)(obj, 'bla.bla', 'BAM');\n } catch (ex) {\n assert.equal(ex.message, exceptionMessage);\n }\n }\n\n ['@test [obj, foo.baz.bat] -> EXCEPTION'](assert) {\n assert.throws(() => (0, _metal.set)(obj, 'foo.baz.bat', 'BAM'));\n }\n\n ['@test [obj, foo.baz.bat] -> EXCEPTION'](assert) {\n (0, _metal.trySet)(obj, 'foo.baz.bat', 'BAM');\n assert.ok(true, 'does not raise');\n }\n });\n});","enifed('@ember/-internals/metal/tests/accessors/set_test', ['@ember/-internals/metal', 'internal-test-helpers'], function (_metal, _internalTestHelpers) {\n 'use strict';\n\n (0, _internalTestHelpers.moduleFor)('set', class extends _internalTestHelpers.AbstractTestCase {\n teardown() {\n (0, _metal.setHasViews)(() => false);\n }\n\n ['@test should set arbitrary properties on an object'](assert) {\n let obj = {\n string: 'string',\n number: 23,\n boolTrue: true,\n boolFalse: false,\n nullValue: null,\n undefinedValue: undefined\n };\n\n let newObj = {};\n\n for (let key in obj) {\n if (!obj.hasOwnProperty(key)) {\n continue;\n }\n\n assert.equal((0, _metal.set)(newObj, key, obj[key]), obj[key], 'should return value');\n assert.ok(key in newObj, 'should have key');\n assert.ok(newObj.hasOwnProperty(key), 'should have key');\n assert.equal((0, _metal.get)(newObj, key), obj[key], 'should set value');\n }\n }\n\n ['@test should set a number key on an object'](assert) {\n let obj = {};\n\n (0, _metal.set)(obj, 1, 'first');\n assert.equal(obj[1], 'first');\n }\n\n ['@test should set an array index'](assert) {\n let arr = ['first', 'second'];\n\n (0, _metal.set)(arr, 1, 'lol');\n assert.deepEqual(arr, ['first', 'lol']);\n }\n\n ['@test should call setUnknownProperty if defined and value is undefined'](assert) {\n let obj = {\n count: 0,\n\n unknownProperty() {\n assert.ok(false, 'should not invoke unknownProperty if setUnknownProperty is defined');\n },\n\n setUnknownProperty(key, value) {\n assert.equal(key, 'foo', 'should pass key');\n assert.equal(value, 'BAR', 'should pass key');\n this.count++;\n return 'FOO';\n }\n };\n\n assert.equal((0, _metal.set)(obj, 'foo', 'BAR'), 'BAR', 'should return set value');\n assert.equal(obj.count, 1, 'should have invoked');\n }\n\n ['@test warn on attempts to call set with undefined as object']() {\n expectAssertion(() => (0, _metal.set)(undefined, 'aProperty', 'BAM'), /Cannot call set with 'aProperty' on an undefined object./);\n }\n\n ['@test warn on attempts to call set with null as object']() {\n expectAssertion(() => (0, _metal.set)(null, 'aProperty', 'BAM'), /Cannot call set with 'aProperty' on an undefined object./);\n }\n\n ['@test warn on attempts to use set with an unsupported property path']() {\n let obj = {};\n expectAssertion(() => (0, _metal.set)(obj, null, 42), /The key provided to set must be a string or number, you passed null/);\n expectAssertion(() => (0, _metal.set)(obj, NaN, 42), /The key provided to set must be a string or number, you passed NaN/);\n expectAssertion(() => (0, _metal.set)(obj, undefined, 42), /The key provided to set must be a string or number, you passed undefined/);\n expectAssertion(() => (0, _metal.set)(obj, false, 42), /The key provided to set must be a string or number, you passed false/);\n }\n\n ['@test warn on attempts of calling set on a destroyed object']() {\n let obj = { isDestroyed: true };\n\n expectAssertion(() => (0, _metal.set)(obj, 'favoriteFood', 'hot dogs'), 'calling set on destroyed object: [object Object].favoriteFood = hot dogs');\n }\n\n ['@test does not trigger auto-run assertion for objects that have not been tagged'](assert) {\n (0, _metal.setHasViews)(() => true);\n let obj = {};\n\n (0, _metal.set)(obj, 'foo', 'bar');\n\n assert.equal(obj.foo, 'bar');\n }\n\n ['@test does not warn on attempts of calling set on a destroyed object with `trySet`'](assert) {\n let obj = { isDestroyed: true };\n\n (0, _metal.trySet)(obj, 'favoriteFood', 'hot dogs');\n assert.equal(obj.favoriteFood, undefined, 'does not set and does not error');\n }\n });\n});","enifed('@ember/-internals/metal/tests/alias_test', ['@ember/-internals/metal', '@ember/-internals/meta', 'internal-test-helpers'], function (_metal, _meta, _internalTestHelpers) {\n 'use strict';\n\n let obj, count;\n\n function incrementCount() {\n count++;\n }\n\n (0, _internalTestHelpers.moduleFor)('@ember/-internals/metal/alias', class extends _internalTestHelpers.AbstractTestCase {\n beforeEach() {\n obj = { foo: { faz: 'FOO' } };\n count = 0;\n }\n\n afterEach() {\n obj = null;\n }\n\n ['@test should proxy get to alt key'](assert) {\n (0, _metal.defineProperty)(obj, 'bar', (0, _metal.alias)('foo.faz'));\n assert.equal((0, _metal.get)(obj, 'bar'), 'FOO');\n }\n\n ['@test should proxy set to alt key'](assert) {\n (0, _metal.defineProperty)(obj, 'bar', (0, _metal.alias)('foo.faz'));\n (0, _metal.set)(obj, 'bar', 'BAR');\n assert.equal((0, _metal.get)(obj, 'foo.faz'), 'BAR');\n }\n\n ['@test old dependent keys should not trigger property changes'](assert) {\n let obj1 = Object.create(null);\n (0, _metal.defineProperty)(obj1, 'foo', null, null);\n (0, _metal.defineProperty)(obj1, 'bar', (0, _metal.alias)('foo'));\n (0, _metal.defineProperty)(obj1, 'baz', (0, _metal.alias)('foo'));\n (0, _metal.defineProperty)(obj1, 'baz', (0, _metal.alias)('bar')); // redefine baz\n (0, _metal.addObserver)(obj1, 'baz', incrementCount);\n\n (0, _metal.set)(obj1, 'foo', 'FOO');\n assert.equal(count, 1);\n\n (0, _metal.removeObserver)(obj1, 'baz', incrementCount);\n\n (0, _metal.set)(obj1, 'foo', 'OOF');\n assert.equal(count, 1);\n }\n\n [`@test inheriting an observer of the alias from the prototype then\n redefining the alias on the instance to another property dependent on same key\n does not call the observer twice`](assert) {\n let obj1 = Object.create(null);\n obj1.incrementCount = incrementCount;\n\n (0, _meta.meta)(obj1).proto = obj1;\n\n (0, _metal.defineProperty)(obj1, 'foo', null, null);\n (0, _metal.defineProperty)(obj1, 'bar', (0, _metal.alias)('foo'));\n (0, _metal.defineProperty)(obj1, 'baz', (0, _metal.alias)('foo'));\n (0, _metal.addObserver)(obj1, 'baz', null, 'incrementCount');\n\n let obj2 = Object.create(obj1);\n (0, _metal.defineProperty)(obj2, 'baz', (0, _metal.alias)('bar')); // override baz\n\n (0, _metal.set)(obj2, 'foo', 'FOO');\n assert.equal(count, 1);\n\n (0, _metal.removeObserver)(obj2, 'baz', null, 'incrementCount');\n\n (0, _metal.set)(obj2, 'foo', 'OOF');\n assert.equal(count, 1);\n }\n\n ['@test an observer of the alias works if added after defining the alias'](assert) {\n (0, _metal.defineProperty)(obj, 'bar', (0, _metal.alias)('foo.faz'));\n (0, _metal.addObserver)(obj, 'bar', incrementCount);\n assert.ok((0, _metal.isWatching)(obj, 'foo.faz'));\n (0, _metal.set)(obj, 'foo.faz', 'BAR');\n assert.equal(count, 1);\n }\n\n ['@test an observer of the alias works if added before defining the alias'](assert) {\n (0, _metal.addObserver)(obj, 'bar', incrementCount);\n (0, _metal.defineProperty)(obj, 'bar', (0, _metal.alias)('foo.faz'));\n assert.ok((0, _metal.isWatching)(obj, 'foo.faz'));\n (0, _metal.set)(obj, 'foo.faz', 'BAR');\n assert.equal(count, 1);\n }\n\n ['@test object with alias is dirtied if interior object of alias is set after consumption'](assert) {\n (0, _metal.defineProperty)(obj, 'bar', (0, _metal.alias)('foo.faz'));\n (0, _metal.get)(obj, 'bar');\n\n let tag = (0, _metal.tagFor)(obj);\n let tagValue = tag.value();\n (0, _metal.set)(obj, 'foo.faz', 'BAR');\n\n assert.ok(!tag.validate(tagValue), 'setting the aliased key should dirty the object');\n }\n\n ['@test setting alias on self should fail assertion']() {\n expectAssertion(() => (0, _metal.defineProperty)(obj, 'bar', (0, _metal.alias)('bar')), \"Setting alias 'bar' on self\");\n }\n\n ['@test destroyed alias does not disturb watch count'](assert) {\n (0, _metal.defineProperty)(obj, 'bar', (0, _metal.alias)('foo.faz'));\n\n assert.equal((0, _metal.get)(obj, 'bar'), 'FOO');\n assert.ok((0, _metal.isWatching)(obj, 'foo.faz'));\n\n (0, _metal.defineProperty)(obj, 'bar', null);\n\n assert.notOk((0, _metal.isWatching)(obj, 'foo.faz'));\n }\n\n ['@test setting on oneWay alias does not disturb watch count'](assert) {\n (0, _metal.defineProperty)(obj, 'bar', (0, _metal.alias)('foo.faz').oneWay());\n\n assert.equal((0, _metal.get)(obj, 'bar'), 'FOO');\n assert.ok((0, _metal.isWatching)(obj, 'foo.faz'));\n\n (0, _metal.set)(obj, 'bar', null);\n\n assert.notOk((0, _metal.isWatching)(obj, 'foo.faz'));\n }\n\n ['@test redefined alias with observer does not disturb watch count'](assert) {\n (0, _metal.defineProperty)(obj, 'bar', (0, _metal.alias)('foo.faz').oneWay());\n\n assert.equal((0, _metal.get)(obj, 'bar'), 'FOO');\n assert.ok((0, _metal.isWatching)(obj, 'foo.faz'));\n\n (0, _metal.addObserver)(obj, 'bar', incrementCount);\n\n assert.equal(count, 0);\n\n (0, _metal.set)(obj, 'bar', null);\n\n assert.equal(count, 1);\n assert.notOk((0, _metal.isWatching)(obj, 'foo.faz'));\n\n (0, _metal.defineProperty)(obj, 'bar', (0, _metal.alias)('foo.faz'));\n\n assert.equal(count, 1);\n assert.ok((0, _metal.isWatching)(obj, 'foo.faz'));\n\n (0, _metal.set)(obj, 'foo.faz', 'great');\n\n assert.equal(count, 2);\n }\n });\n});","enifed('@ember/-internals/metal/tests/chains_test', ['@ember/-internals/metal', '@ember/-internals/meta', 'internal-test-helpers'], function (_metal, _meta, _internalTestHelpers) {\n 'use strict';\n\n (0, _internalTestHelpers.moduleFor)('Chains', class extends _internalTestHelpers.AbstractTestCase {\n ['@test finishChains should properly copy chains from prototypes to instances'](assert) {\n function didChange() {}\n\n let obj = {};\n (0, _metal.addObserver)(obj, 'foo.bar', null, didChange);\n\n let childObj = Object.create(obj);\n\n let parentMeta = (0, _meta.meta)(obj);\n let childMeta = (0, _meta.meta)(childObj);\n\n (0, _metal.finishChains)(childMeta);\n\n assert.ok(parentMeta.readableChains() !== childMeta.readableChains(), 'The chains object is copied');\n }\n\n ['@test does not observe primitive values'](assert) {\n let obj = {\n foo: { bar: 'STRING' }\n };\n\n (0, _metal.addObserver)(obj, 'foo.bar.baz', null, function () {});\n let meta = (0, _meta.peekMeta)(obj);\n assert.notOk(meta._object);\n }\n\n ['@test observer and CP chains'](assert) {\n let obj = {};\n\n (0, _metal.defineProperty)(obj, 'foo', (0, _metal.computed)('qux.[]', function () {}));\n (0, _metal.defineProperty)(obj, 'qux', (0, _metal.computed)(function () {}));\n\n // create DK chains\n (0, _metal.get)(obj, 'foo');\n\n // create observer chain\n (0, _metal.addObserver)(obj, 'qux.length', function () {});\n\n /*\n +-----+\n | qux | root CP\n +-----+\n ^\n +------+-----+\n | |\n +--------+ +----+\n | length | | [] | chainWatchers\n +--------+ +----+\n observer CP(foo, 'qux.[]')\n */\n\n // invalidate qux\n (0, _metal.notifyPropertyChange)(obj, 'qux');\n\n // CP chain is blown away\n\n /*\n +-----+\n | qux | root CP\n +-----+\n ^\n +------+xxxxxx\n | x\n +--------+ xxxxxx\n | length | x [] x chainWatchers\n +--------+ xxxxxx\n observer CP(foo, 'qux.[]')\n */\n\n (0, _metal.get)(obj, 'qux'); // CP chain re-recreated\n assert.ok(true, 'no crash');\n }\n\n ['@test checks cache correctly'](assert) {\n let obj = {};\n let parentChainNode = new _metal.ChainNode(null, null, obj);\n let chainNode = new _metal.ChainNode(parentChainNode, 'foo');\n\n (0, _metal.defineProperty)(obj, 'foo', (0, _metal.computed)(function () {\n return undefined;\n }));\n (0, _metal.get)(obj, 'foo');\n\n assert.strictEqual(chainNode.value(), undefined);\n }\n\n ['@test chains are watched correctly'](assert) {\n let obj = { foo: { bar: { baz: 1 } } };\n\n (0, _metal.watch)(obj, 'foo.bar.baz');\n\n assert.equal((0, _metal.watcherCount)(obj, 'foo'), 1);\n assert.equal((0, _metal.watcherCount)(obj, 'foo.bar'), 0);\n assert.equal((0, _metal.watcherCount)(obj, 'foo.bar.baz'), 1);\n assert.equal((0, _metal.watcherCount)(obj.foo, 'bar'), 1);\n assert.equal((0, _metal.watcherCount)(obj.foo, 'bar.baz'), 0);\n assert.equal((0, _metal.watcherCount)(obj.foo.bar, 'baz'), 1);\n\n (0, _metal.unwatch)(obj, 'foo.bar.baz');\n\n assert.equal((0, _metal.watcherCount)(obj, 'foo'), 0);\n assert.equal((0, _metal.watcherCount)(obj, 'foo.bar'), 0);\n assert.equal((0, _metal.watcherCount)(obj, 'foo.bar.baz'), 0);\n assert.equal((0, _metal.watcherCount)(obj.foo, 'bar'), 0);\n assert.equal((0, _metal.watcherCount)(obj.foo, 'bar.baz'), 0);\n assert.equal((0, _metal.watcherCount)(obj.foo.bar, 'baz'), 0);\n }\n\n ['@test chains with single character keys are watched correctly'](assert) {\n let obj = { a: { b: { c: 1 } } };\n\n (0, _metal.watch)(obj, 'a.b.c');\n\n assert.equal((0, _metal.watcherCount)(obj, 'a'), 1);\n assert.equal((0, _metal.watcherCount)(obj, 'a.b'), 0);\n assert.equal((0, _metal.watcherCount)(obj, 'a.b.c'), 1);\n assert.equal((0, _metal.watcherCount)(obj.a, 'b'), 1);\n assert.equal((0, _metal.watcherCount)(obj.a, 'b.c'), 0);\n assert.equal((0, _metal.watcherCount)(obj.a.b, 'c'), 1);\n\n (0, _metal.unwatch)(obj, 'a.b.c');\n\n assert.equal((0, _metal.watcherCount)(obj, 'a'), 0);\n assert.equal((0, _metal.watcherCount)(obj, 'a.b'), 0);\n assert.equal((0, _metal.watcherCount)(obj, 'a.b.c'), 0);\n assert.equal((0, _metal.watcherCount)(obj.a, 'b'), 0);\n assert.equal((0, _metal.watcherCount)(obj.a, 'b.c'), 0);\n assert.equal((0, _metal.watcherCount)(obj.a.b, 'c'), 0);\n }\n\n ['@test writable chains is not defined more than once'](assert) {\n assert.expect(0);\n\n class Base {\n constructor() {\n (0, _metal.finishChains)((0, _meta.meta)(this));\n }\n\n didChange() {}\n }\n\n Base.prototype.foo = {\n bar: {\n baz: {\n value: 123\n }\n }\n };\n\n // Define a standard computed property, which will eventually setup dependencies\n (0, _metal.defineProperty)(Base.prototype, 'bar', (0, _metal.computed)('foo.bar', {\n get() {\n return this.foo.bar;\n }\n }));\n\n // Define some aliases, which will proxy chains along\n (0, _metal.defineProperty)(Base.prototype, 'baz', (0, _metal.alias)('bar.baz'));\n (0, _metal.defineProperty)(Base.prototype, 'value', (0, _metal.alias)('baz.value'));\n\n // Define an observer, which will eagerly attempt to setup chains and watch\n // their values. This follows the aliases eagerly, and forces the first\n // computed to actually set up its values/dependencies for chains. If\n // writableChains was not already defined, this results in multiple root\n // chain nodes being defined on the same object meta.\n (0, _metal.addObserver)(Base.prototype, 'value', null, 'didChange');\n\n class Child extends Base {}\n\n let childObj = new Child();\n\n (0, _metal.set)(childObj, 'foo.bar', {\n baz: {\n value: 456\n }\n });\n }\n });\n});","enifed('@ember/-internals/metal/tests/computed_test', ['@ember/-internals/runtime', '@ember/-internals/metal', '@ember/-internals/meta', 'internal-test-helpers'], function (_runtime, _metal, _meta, _internalTestHelpers) {\n 'use strict';\n\n let obj, count;\n\n (0, _internalTestHelpers.moduleFor)('computed', class extends _internalTestHelpers.AbstractTestCase {\n ['@test computed property should be an instance of descriptor'](assert) {\n assert.ok((0, _metal.computed)(function () {}) instanceof _metal.Descriptor);\n }\n\n ['@test computed properties assert the presence of a getter or setter function']() {\n expectAssertion(function () {\n (0, _metal.computed)('nogetternorsetter', {});\n }, 'Computed properties must receive a getter or a setter, you passed none.');\n }\n\n ['@test computed properties check for the presence of a function or configuration object']() {\n expectAssertion(function () {\n (0, _metal.computed)('nolastargument');\n }, 'computed expects a function or an object as last argument.');\n }\n\n ['@test computed properties defined with an object only allow `get` and `set` keys']() {\n expectAssertion(function () {\n (0, _metal.computed)({\n get() {},\n set() {},\n other() {}\n });\n }, 'Config object passed to computed can only contain `get` and `set` keys.');\n }\n\n ['@test computed property can be accessed without `get`'](assert) {\n let obj = {};\n let count = 0;\n (0, _metal.defineProperty)(obj, 'foo', (0, _metal.computed)(function (key) {\n count++;\n return 'computed ' + key;\n }));\n\n assert.equal(obj.foo, 'computed foo', 'should return value');\n assert.equal(count, 1, 'should have invoked computed property');\n }\n\n ['@test defining computed property should invoke property on get'](assert) {\n let obj = {};\n let count = 0;\n (0, _metal.defineProperty)(obj, 'foo', (0, _metal.computed)(function (key) {\n count++;\n return 'computed ' + key;\n }));\n\n assert.equal((0, _metal.get)(obj, 'foo'), 'computed foo', 'should return value');\n assert.equal(count, 1, 'should have invoked computed property');\n }\n\n ['@test defining computed property should invoke property on set'](assert) {\n let obj = {};\n let count = 0;\n (0, _metal.defineProperty)(obj, 'foo', (0, _metal.computed)({\n get(key) {\n return this['__' + key];\n },\n set(key, value) {\n count++;\n this['__' + key] = 'computed ' + value;\n return this['__' + key];\n }\n }));\n\n assert.equal((0, _metal.set)(obj, 'foo', 'bar'), 'bar', 'should return set value');\n assert.equal(count, 1, 'should have invoked computed property');\n assert.equal((0, _metal.get)(obj, 'foo'), 'computed bar', 'should return new value');\n }\n\n ['@test defining a computed property with a dependent key ending with @each is expanded to []'](assert) {\n let cp = (0, _metal.computed)('blazo.@each', function () {});\n\n assert.deepEqual(cp._dependentKeys, ['blazo.[]']);\n\n cp = (0, _metal.computed)('qux', 'zoopa.@each', function () {});\n\n assert.deepEqual(cp._dependentKeys, ['qux', 'zoopa.[]']);\n }\n\n ['@test defining a computed property with a dependent key more than one level deep beyond @each is not supported']() {\n expectNoWarning(() => {\n (0, _metal.computed)('todos', () => {});\n });\n\n expectNoWarning(() => {\n (0, _metal.computed)('todos.@each.owner', () => {});\n });\n\n expectWarning(() => {\n (0, _metal.computed)('todos.@each.owner.name', () => {});\n }, /You used the key \"todos\\.@each\\.owner\\.name\" which is invalid\\. /);\n\n expectWarning(() => {\n (0, _metal.computed)('todos.@each.owner.@each.name', () => {});\n }, /You used the key \"todos\\.@each\\.owner\\.@each\\.name\" which is invalid\\. /);\n }\n });\n\n let objA, objB;\n (0, _internalTestHelpers.moduleFor)('computed should inherit through prototype', class extends _internalTestHelpers.AbstractTestCase {\n beforeEach() {\n objA = { __foo: 'FOO' };\n (0, _metal.defineProperty)(objA, 'foo', (0, _metal.computed)({\n get(key) {\n return this['__' + key];\n },\n set(key, value) {\n this['__' + key] = 'computed ' + value;\n return this['__' + key];\n }\n }));\n\n objB = Object.create(objA);\n objB.__foo = 'FOO'; // make a copy;\n }\n\n afterEach() {\n objA = objB = null;\n }\n\n ['@test using get() and set()'](assert) {\n assert.equal((0, _metal.get)(objA, 'foo'), 'FOO', 'should get FOO from A');\n assert.equal((0, _metal.get)(objB, 'foo'), 'FOO', 'should get FOO from B');\n\n (0, _metal.set)(objA, 'foo', 'BIFF');\n assert.equal((0, _metal.get)(objA, 'foo'), 'computed BIFF', 'should change A');\n assert.equal((0, _metal.get)(objB, 'foo'), 'FOO', 'should NOT change B');\n\n (0, _metal.set)(objB, 'foo', 'bar');\n assert.equal((0, _metal.get)(objB, 'foo'), 'computed bar', 'should change B');\n assert.equal((0, _metal.get)(objA, 'foo'), 'computed BIFF', 'should NOT change A');\n\n (0, _metal.set)(objA, 'foo', 'BAZ');\n assert.equal((0, _metal.get)(objA, 'foo'), 'computed BAZ', 'should change A');\n assert.equal((0, _metal.get)(objB, 'foo'), 'computed bar', 'should NOT change B');\n }\n });\n\n (0, _internalTestHelpers.moduleFor)('redefining computed property to normal', class extends _internalTestHelpers.AbstractTestCase {\n beforeEach() {\n objA = { __foo: 'FOO' };\n (0, _metal.defineProperty)(objA, 'foo', (0, _metal.computed)({\n get(key) {\n return this['__' + key];\n },\n set(key, value) {\n this['__' + key] = 'computed ' + value;\n return this['__' + key];\n }\n }));\n\n objB = Object.create(objA);\n (0, _metal.defineProperty)(objB, 'foo'); // make this just a normal property.\n }\n\n afterEach() {\n objA = objB = null;\n }\n\n ['@test using get() and set()'](assert) {\n assert.equal((0, _metal.get)(objA, 'foo'), 'FOO', 'should get FOO from A');\n assert.equal((0, _metal.get)(objB, 'foo'), undefined, 'should get undefined from B');\n\n (0, _metal.set)(objA, 'foo', 'BIFF');\n assert.equal((0, _metal.get)(objA, 'foo'), 'computed BIFF', 'should change A');\n assert.equal((0, _metal.get)(objB, 'foo'), undefined, 'should NOT change B');\n\n (0, _metal.set)(objB, 'foo', 'bar');\n assert.equal((0, _metal.get)(objB, 'foo'), 'bar', 'should change B');\n assert.equal((0, _metal.get)(objA, 'foo'), 'computed BIFF', 'should NOT change A');\n\n (0, _metal.set)(objA, 'foo', 'BAZ');\n assert.equal((0, _metal.get)(objA, 'foo'), 'computed BAZ', 'should change A');\n assert.equal((0, _metal.get)(objB, 'foo'), 'bar', 'should NOT change B');\n }\n });\n\n (0, _internalTestHelpers.moduleFor)('redefining computed property to another property', class extends _internalTestHelpers.AbstractTestCase {\n beforeEach() {\n objA = { __foo: 'FOO' };\n (0, _metal.defineProperty)(objA, 'foo', (0, _metal.computed)({\n get(key) {\n return this['__' + key];\n },\n set(key, value) {\n this['__' + key] = 'A ' + value;\n return this['__' + key];\n }\n }));\n\n objB = Object.create(objA);\n objB.__foo = 'FOO';\n (0, _metal.defineProperty)(objB, 'foo', (0, _metal.computed)({\n get(key) {\n return this['__' + key];\n },\n set(key, value) {\n this['__' + key] = 'B ' + value;\n return this['__' + key];\n }\n }));\n }\n\n afterEach() {\n objA = objB = null;\n }\n\n ['@test using get() and set()'](assert) {\n assert.equal((0, _metal.get)(objA, 'foo'), 'FOO', 'should get FOO from A');\n assert.equal((0, _metal.get)(objB, 'foo'), 'FOO', 'should get FOO from B');\n\n (0, _metal.set)(objA, 'foo', 'BIFF');\n assert.equal((0, _metal.get)(objA, 'foo'), 'A BIFF', 'should change A');\n assert.equal((0, _metal.get)(objB, 'foo'), 'FOO', 'should NOT change B');\n\n (0, _metal.set)(objB, 'foo', 'bar');\n assert.equal((0, _metal.get)(objB, 'foo'), 'B bar', 'should change B');\n assert.equal((0, _metal.get)(objA, 'foo'), 'A BIFF', 'should NOT change A');\n\n (0, _metal.set)(objA, 'foo', 'BAZ');\n assert.equal((0, _metal.get)(objA, 'foo'), 'A BAZ', 'should change A');\n assert.equal((0, _metal.get)(objB, 'foo'), 'B bar', 'should NOT change B');\n }\n });\n\n (0, _internalTestHelpers.moduleFor)('computed - metadata', class extends _internalTestHelpers.AbstractTestCase {\n ['@test can set metadata on a computed property'](assert) {\n let computedProperty = (0, _metal.computed)(function () {});\n computedProperty.meta({ key: 'keyValue' });\n\n assert.equal(computedProperty.meta().key, 'keyValue', 'saves passed meta hash to the _meta property');\n }\n\n ['@test meta should return an empty hash if no meta is set'](assert) {\n let computedProperty = (0, _metal.computed)(function () {});\n assert.deepEqual(computedProperty.meta(), {}, 'returned value is an empty hash');\n }\n });\n\n // ..........................................................\n // CACHEABLE\n //\n\n (0, _internalTestHelpers.moduleFor)('computed - cacheable', class extends _internalTestHelpers.AbstractTestCase {\n beforeEach() {\n obj = {};\n count = 0;\n let func = function () {\n count++;\n return 'bar ' + count;\n };\n (0, _metal.defineProperty)(obj, 'foo', (0, _metal.computed)({ get: func, set: func }));\n }\n\n afterEach() {\n obj = count = null;\n }\n ['@test cacheable should cache'](assert) {\n assert.equal((0, _metal.get)(obj, 'foo'), 'bar 1', 'first get');\n assert.equal((0, _metal.get)(obj, 'foo'), 'bar 1', 'second get');\n assert.equal(count, 1, 'should only invoke once');\n }\n\n ['@test modifying a cacheable property should update cache'](assert) {\n assert.equal((0, _metal.get)(obj, 'foo'), 'bar 1', 'first get');\n assert.equal((0, _metal.get)(obj, 'foo'), 'bar 1', 'second get');\n\n assert.equal((0, _metal.set)(obj, 'foo', 'baz'), 'baz', 'setting');\n assert.equal((0, _metal.get)(obj, 'foo'), 'bar 2', 'third get');\n assert.equal(count, 2, 'should not invoke again');\n }\n\n ['@test inherited property should not pick up cache'](assert) {\n let objB = Object.create(obj);\n\n assert.equal((0, _metal.get)(obj, 'foo'), 'bar 1', 'obj first get');\n assert.equal((0, _metal.get)(objB, 'foo'), 'bar 2', 'objB first get');\n\n assert.equal((0, _metal.get)(obj, 'foo'), 'bar 1', 'obj second get');\n assert.equal((0, _metal.get)(objB, 'foo'), 'bar 2', 'objB second get');\n\n (0, _metal.set)(obj, 'foo', 'baz'); // modify A\n assert.equal((0, _metal.get)(obj, 'foo'), 'bar 3', 'obj third get');\n assert.equal((0, _metal.get)(objB, 'foo'), 'bar 2', 'objB third get');\n }\n\n ['@test getCachedValueFor should return the cached value'](assert) {\n assert.equal((0, _metal.getCachedValueFor)(obj, 'foo'), undefined, 'should not yet be a cached value');\n\n (0, _metal.get)(obj, 'foo');\n\n assert.equal((0, _metal.getCachedValueFor)(obj, 'foo'), 'bar 1', 'should retrieve cached value');\n }\n\n ['@test getCachedValueFor should return falsy cached values'](assert) {\n (0, _metal.defineProperty)(obj, 'falsy', (0, _metal.computed)(function () {\n return false;\n }));\n\n assert.equal((0, _metal.getCachedValueFor)(obj, 'falsy'), undefined, 'should not yet be a cached value');\n\n (0, _metal.get)(obj, 'falsy');\n\n assert.equal((0, _metal.getCachedValueFor)(obj, 'falsy'), false, 'should retrieve cached value');\n }\n\n ['@test setting a cached computed property passes the old value as the third argument'](assert) {\n let obj = {\n foo: 0\n };\n\n let receivedOldValue;\n\n (0, _metal.defineProperty)(obj, 'plusOne', (0, _metal.computed)({\n get() {},\n set(key, value, oldValue) {\n receivedOldValue = oldValue;\n return value;\n }\n }).property('foo'));\n\n (0, _metal.set)(obj, 'plusOne', 1);\n assert.strictEqual(receivedOldValue, undefined, 'oldValue should be undefined');\n\n (0, _metal.set)(obj, 'plusOne', 2);\n assert.strictEqual(receivedOldValue, 1, 'oldValue should be 1');\n\n (0, _metal.set)(obj, 'plusOne', 3);\n assert.strictEqual(receivedOldValue, 2, 'oldValue should be 2');\n }\n });\n\n // ..........................................................\n // DEPENDENT KEYS\n //\n\n (0, _internalTestHelpers.moduleFor)('computed - dependentkey', class extends _internalTestHelpers.AbstractTestCase {\n beforeEach() {\n obj = { bar: 'baz' };\n count = 0;\n let getterAndSetter = function () {\n count++;\n (0, _metal.get)(this, 'bar');\n return 'bar ' + count;\n };\n (0, _metal.defineProperty)(obj, 'foo', (0, _metal.computed)({\n get: getterAndSetter,\n set: getterAndSetter\n }).property('bar'));\n }\n\n afterEach() {\n obj = count = null;\n }\n\n ['@test should lazily watch dependent keys on set'](assert) {\n assert.equal((0, _metal.isWatching)(obj, 'bar'), false, 'precond not watching dependent key');\n (0, _metal.set)(obj, 'foo', 'bar');\n assert.equal((0, _metal.isWatching)(obj, 'bar'), true, 'lazily watching dependent key');\n }\n\n ['@test should lazily watch dependent keys on get'](assert) {\n assert.equal((0, _metal.isWatching)(obj, 'bar'), false, 'precond not watching dependent key');\n (0, _metal.get)(obj, 'foo');\n assert.equal((0, _metal.isWatching)(obj, 'bar'), true, 'lazily watching dependent key');\n }\n\n ['@test local dependent key should invalidate cache'](assert) {\n assert.equal((0, _metal.isWatching)(obj, 'bar'), false, 'precond not watching dependent key');\n assert.equal((0, _metal.get)(obj, 'foo'), 'bar 1', 'get once');\n assert.equal((0, _metal.isWatching)(obj, 'bar'), true, 'lazily setup watching dependent key');\n assert.equal((0, _metal.get)(obj, 'foo'), 'bar 1', 'cached retrieve');\n\n (0, _metal.set)(obj, 'bar', 'BIFF'); // should invalidate foo\n\n assert.equal((0, _metal.get)(obj, 'foo'), 'bar 2', 'should recache');\n assert.equal((0, _metal.get)(obj, 'foo'), 'bar 2', 'cached retrieve');\n }\n\n ['@test should invalidate multiple nested dependent keys'](assert) {\n let count = 0;\n (0, _metal.defineProperty)(obj, 'bar', (0, _metal.computed)(function () {\n count++;\n (0, _metal.get)(this, 'baz');\n return 'baz ' + count;\n }).property('baz'));\n\n assert.equal((0, _metal.isWatching)(obj, 'bar'), false, 'precond not watching dependent key');\n assert.equal((0, _metal.isWatching)(obj, 'baz'), false, 'precond not watching dependent key');\n assert.equal((0, _metal.get)(obj, 'foo'), 'bar 1', 'get once');\n assert.equal((0, _metal.isWatching)(obj, 'bar'), true, 'lazily setup watching dependent key');\n assert.equal((0, _metal.isWatching)(obj, 'baz'), true, 'lazily setup watching dependent key');\n assert.equal((0, _metal.get)(obj, 'foo'), 'bar 1', 'cached retrieve');\n\n (0, _metal.set)(obj, 'baz', 'BIFF'); // should invalidate bar -> foo\n assert.equal((0, _metal.isWatching)(obj, 'bar'), false, 'should not be watching dependent key after cache cleared');\n assert.equal((0, _metal.isWatching)(obj, 'baz'), false, 'should not be watching dependent key after cache cleared');\n\n assert.equal((0, _metal.get)(obj, 'foo'), 'bar 2', 'should recache');\n assert.equal((0, _metal.get)(obj, 'foo'), 'bar 2', 'cached retrieve');\n assert.equal((0, _metal.isWatching)(obj, 'bar'), true, 'lazily setup watching dependent key');\n assert.equal((0, _metal.isWatching)(obj, 'baz'), true, 'lazily setup watching dependent key');\n }\n\n ['@test circular keys should not blow up'](assert) {\n let func = function () {\n count++;\n return 'bar ' + count;\n };\n (0, _metal.defineProperty)(obj, 'bar', (0, _metal.computed)({ get: func, set: func }).property('foo'));\n\n (0, _metal.defineProperty)(obj, 'foo', (0, _metal.computed)(function () {\n count++;\n return 'foo ' + count;\n }).property('bar'));\n\n assert.equal((0, _metal.get)(obj, 'foo'), 'foo 1', 'get once');\n assert.equal((0, _metal.get)(obj, 'foo'), 'foo 1', 'cached retrieve');\n\n (0, _metal.set)(obj, 'bar', 'BIFF'); // should invalidate bar -> foo -> bar\n\n assert.equal((0, _metal.get)(obj, 'foo'), 'foo 3', 'should recache');\n assert.equal((0, _metal.get)(obj, 'foo'), 'foo 3', 'cached retrieve');\n }\n\n ['@test redefining a property should undo old dependent keys'](assert) {\n assert.equal((0, _metal.isWatching)(obj, 'bar'), false, 'precond not watching dependent key');\n assert.equal((0, _metal.get)(obj, 'foo'), 'bar 1');\n assert.equal((0, _metal.isWatching)(obj, 'bar'), true, 'lazily watching dependent key');\n\n (0, _metal.defineProperty)(obj, 'foo', (0, _metal.computed)(function () {\n count++;\n return 'baz ' + count;\n }).property('baz'));\n\n assert.equal((0, _metal.isWatching)(obj, 'bar'), false, 'after redefining should not be watching dependent key');\n\n assert.equal((0, _metal.get)(obj, 'foo'), 'baz 2');\n\n (0, _metal.set)(obj, 'bar', 'BIFF'); // should not kill cache\n assert.equal((0, _metal.get)(obj, 'foo'), 'baz 2');\n\n (0, _metal.set)(obj, 'baz', 'BOP');\n assert.equal((0, _metal.get)(obj, 'foo'), 'baz 3');\n }\n\n ['@test can watch multiple dependent keys specified declaratively via brace expansion'](assert) {\n (0, _metal.defineProperty)(obj, 'foo', (0, _metal.computed)(function () {\n count++;\n return 'foo ' + count;\n }).property('qux.{bar,baz}'));\n\n assert.equal((0, _metal.get)(obj, 'foo'), 'foo 1', 'get once');\n assert.equal((0, _metal.get)(obj, 'foo'), 'foo 1', 'cached retrieve');\n\n (0, _metal.set)(obj, 'qux', {});\n (0, _metal.set)(obj, 'qux.bar', 'bar'); // invalidate foo\n\n assert.equal((0, _metal.get)(obj, 'foo'), 'foo 2', 'foo invalidated from bar');\n\n (0, _metal.set)(obj, 'qux.baz', 'baz'); // invalidate foo\n\n assert.equal((0, _metal.get)(obj, 'foo'), 'foo 3', 'foo invalidated from baz');\n\n (0, _metal.set)(obj, 'qux.quux', 'quux'); // do not invalidate foo\n\n assert.equal((0, _metal.get)(obj, 'foo'), 'foo 3', 'foo not invalidated by quux');\n }\n\n ['@test throws assertion if brace expansion notation has spaces']() {\n expectAssertion(function () {\n (0, _metal.defineProperty)(obj, 'roo', (0, _metal.computed)(function () {\n count++;\n return 'roo ' + count;\n }).property('fee.{bar, baz,bop , }'));\n }, /cannot contain spaces/);\n }\n\n ['@test throws an assertion if an uncached `get` is called after object is destroyed'](assert) {\n assert.equal((0, _metal.isWatching)(obj, 'bar'), false, 'precond not watching dependent key');\n\n let meta = (0, _meta.meta)(obj);\n meta.destroy();\n\n obj.toString = () => '';\n\n expectAssertion(() => {\n (0, _metal.get)(obj, 'foo');\n }, 'Cannot modify dependent keys for `foo` on `` after it has been destroyed.');\n\n assert.equal((0, _metal.isWatching)(obj, 'bar'), false, 'deps were not updated');\n }\n });\n\n // ..........................................................\n // CHAINED DEPENDENT KEYS\n //\n\n let func;\n\n (0, _internalTestHelpers.moduleFor)('computed - dependentkey with chained properties', class extends _internalTestHelpers.AbstractTestCase {\n beforeEach() {\n obj = {\n foo: {\n bar: {\n baz: {\n biff: 'BIFF'\n }\n }\n }\n };\n\n count = 0;\n func = function () {\n count++;\n return (0, _metal.get)(obj, 'foo.bar.baz.biff') + ' ' + count;\n };\n }\n\n afterEach() {\n obj = count = func = null;\n }\n\n ['@test depending on simple chain'](assert) {\n // assign computed property\n (0, _metal.defineProperty)(obj, 'prop', (0, _metal.computed)(func).property('foo.bar.baz.biff'));\n\n assert.equal((0, _metal.get)(obj, 'prop'), 'BIFF 1');\n\n (0, _metal.set)((0, _metal.get)(obj, 'foo.bar.baz'), 'biff', 'BUZZ');\n assert.equal((0, _metal.get)(obj, 'prop'), 'BUZZ 2');\n assert.equal((0, _metal.get)(obj, 'prop'), 'BUZZ 2');\n\n (0, _metal.set)((0, _metal.get)(obj, 'foo.bar'), 'baz', { biff: 'BLOB' });\n assert.equal((0, _metal.get)(obj, 'prop'), 'BLOB 3');\n assert.equal((0, _metal.get)(obj, 'prop'), 'BLOB 3');\n\n (0, _metal.set)((0, _metal.get)(obj, 'foo.bar.baz'), 'biff', 'BUZZ');\n assert.equal((0, _metal.get)(obj, 'prop'), 'BUZZ 4');\n assert.equal((0, _metal.get)(obj, 'prop'), 'BUZZ 4');\n\n (0, _metal.set)((0, _metal.get)(obj, 'foo'), 'bar', { baz: { biff: 'BOOM' } });\n assert.equal((0, _metal.get)(obj, 'prop'), 'BOOM 5');\n assert.equal((0, _metal.get)(obj, 'prop'), 'BOOM 5');\n\n (0, _metal.set)((0, _metal.get)(obj, 'foo.bar.baz'), 'biff', 'BUZZ');\n assert.equal((0, _metal.get)(obj, 'prop'), 'BUZZ 6');\n assert.equal((0, _metal.get)(obj, 'prop'), 'BUZZ 6');\n\n (0, _metal.set)(obj, 'foo', { bar: { baz: { biff: 'BLARG' } } });\n assert.equal((0, _metal.get)(obj, 'prop'), 'BLARG 7');\n assert.equal((0, _metal.get)(obj, 'prop'), 'BLARG 7');\n\n (0, _metal.set)((0, _metal.get)(obj, 'foo.bar.baz'), 'biff', 'BUZZ');\n assert.equal((0, _metal.get)(obj, 'prop'), 'BUZZ 8');\n assert.equal((0, _metal.get)(obj, 'prop'), 'BUZZ 8');\n\n (0, _metal.defineProperty)(obj, 'prop');\n (0, _metal.set)(obj, 'prop', 'NONE');\n assert.equal((0, _metal.get)(obj, 'prop'), 'NONE');\n\n (0, _metal.set)(obj, 'foo', { bar: { baz: { biff: 'BLARG' } } });\n assert.equal((0, _metal.get)(obj, 'prop'), 'NONE'); // should do nothing\n assert.equal(count, 8, 'should be not have invoked computed again');\n }\n\n ['@test chained dependent keys should evaluate computed properties lazily'](assert) {\n (0, _metal.defineProperty)(obj.foo.bar, 'b', (0, _metal.computed)(func));\n (0, _metal.defineProperty)(obj.foo, 'c', (0, _metal.computed)(function () {}).property('bar.b'));\n assert.equal(count, 0, 'b should not run');\n }\n });\n\n // ..........................................................\n // improved-cp-syntax\n //\n\n (0, _internalTestHelpers.moduleFor)('computed - improved cp syntax', class extends _internalTestHelpers.AbstractTestCase {\n ['@test setter and getters are passed using an object'](assert) {\n let testObj = _runtime.Object.extend({\n a: '1',\n b: '2',\n aInt: (0, _metal.computed)('a', {\n get(keyName) {\n assert.equal(keyName, 'aInt', 'getter receives the keyName');\n return parseInt(this.get('a'));\n },\n set(keyName, value, oldValue) {\n assert.equal(keyName, 'aInt', 'setter receives the keyName');\n assert.equal(value, 123, 'setter receives the new value');\n assert.equal(oldValue, 1, 'setter receives the old value');\n this.set('a', '' + value); // side effect\n return parseInt(this.get('a'));\n }\n })\n }).create();\n\n assert.ok(testObj.get('aInt') === 1, 'getter works');\n testObj.set('aInt', 123);\n assert.ok(testObj.get('a') === '123', 'setter works');\n assert.ok(testObj.get('aInt') === 123, 'cp has been updated too');\n }\n\n ['@test setter can be omited'](assert) {\n let testObj = _runtime.Object.extend({\n a: '1',\n b: '2',\n aInt: (0, _metal.computed)('a', {\n get(keyName) {\n assert.equal(keyName, 'aInt', 'getter receives the keyName');\n return parseInt(this.get('a'));\n }\n })\n }).create();\n\n assert.ok(testObj.get('aInt') === 1, 'getter works');\n assert.ok(testObj.get('a') === '1');\n testObj.set('aInt', '123');\n assert.ok(testObj.get('aInt') === '123', 'cp has been updated too');\n }\n\n ['@test getter can be omited'](assert) {\n let testObj = _runtime.Object.extend({\n com: (0, _metal.computed)({\n set(key, value) {\n return value;\n }\n })\n }).create();\n\n assert.ok(testObj.get('com') === undefined);\n testObj.set('com', '123');\n assert.ok(testObj.get('com') === '123', 'cp has been updated');\n }\n\n ['@test the return value of the setter gets cached'](assert) {\n let testObj = _runtime.Object.extend({\n a: '1',\n sampleCP: (0, _metal.computed)('a', {\n get() {\n assert.ok(false, 'The getter should not be invoked');\n return 'get-value';\n },\n set() {\n return 'set-value';\n }\n })\n }).create();\n\n testObj.set('sampleCP', 'abcd');\n assert.ok(testObj.get('sampleCP') === 'set-value', 'The return value of the CP was cached');\n }\n });\n\n // ..........................................................\n // BUGS\n //\n\n (0, _internalTestHelpers.moduleFor)('computed edge cases', class extends _internalTestHelpers.AbstractTestCase {\n ['@test adding a computed property should show up in key iteration'](assert) {\n let obj = {};\n (0, _metal.defineProperty)(obj, 'foo', (0, _metal.computed)(function () {}));\n\n let found = [];\n for (let key in obj) {\n found.push(key);\n }\n assert.ok(found.indexOf('foo') >= 0, 'should find computed property in iteration found=' + found);\n assert.ok('foo' in obj, 'foo in obj should pass');\n }\n\n [\"@test when setting a value after it had been retrieved empty don't pass function UNDEFINED as oldValue\"](assert) {\n let obj = {};\n let oldValueIsNoFunction = true;\n\n (0, _metal.defineProperty)(obj, 'foo', (0, _metal.computed)({\n get() {},\n set(key, value, oldValue) {\n if (typeof oldValue === 'function') {\n oldValueIsNoFunction = false;\n }\n return undefined;\n }\n }));\n\n (0, _metal.get)(obj, 'foo');\n (0, _metal.set)(obj, 'foo', undefined);\n\n assert.ok(oldValueIsNoFunction);\n }\n });\n\n (0, _internalTestHelpers.moduleFor)('computed - setter', class extends _internalTestHelpers.AbstractTestCase {\n ['@test setting a watched computed property'](assert) {\n let obj = {\n firstName: 'Yehuda',\n lastName: 'Katz'\n };\n\n (0, _metal.defineProperty)(obj, 'fullName', (0, _metal.computed)({\n get() {\n return (0, _metal.get)(this, 'firstName') + ' ' + (0, _metal.get)(this, 'lastName');\n },\n set(key, value) {\n let values = value.split(' ');\n (0, _metal.set)(this, 'firstName', values[0]);\n (0, _metal.set)(this, 'lastName', values[1]);\n return value;\n }\n }).property('firstName', 'lastName'));\n\n let fullNameDidChange = 0;\n let firstNameDidChange = 0;\n let lastNameDidChange = 0;\n (0, _metal.addObserver)(obj, 'fullName', function () {\n fullNameDidChange++;\n });\n (0, _metal.addObserver)(obj, 'firstName', function () {\n firstNameDidChange++;\n });\n (0, _metal.addObserver)(obj, 'lastName', function () {\n lastNameDidChange++;\n });\n\n assert.equal((0, _metal.get)(obj, 'fullName'), 'Yehuda Katz');\n\n (0, _metal.set)(obj, 'fullName', 'Yehuda Katz');\n\n (0, _metal.set)(obj, 'fullName', 'Kris Selden');\n\n assert.equal((0, _metal.get)(obj, 'fullName'), 'Kris Selden');\n assert.equal((0, _metal.get)(obj, 'firstName'), 'Kris');\n assert.equal((0, _metal.get)(obj, 'lastName'), 'Selden');\n\n assert.equal(fullNameDidChange, 1);\n assert.equal(firstNameDidChange, 1);\n assert.equal(lastNameDidChange, 1);\n }\n\n ['@test setting a cached computed property that modifies the value you give it'](assert) {\n let obj = {\n foo: 0\n };\n\n (0, _metal.defineProperty)(obj, 'plusOne', (0, _metal.computed)({\n get() {\n return (0, _metal.get)(this, 'foo') + 1;\n },\n set(key, value) {\n (0, _metal.set)(this, 'foo', value);\n return value + 1;\n }\n }).property('foo'));\n\n let plusOneDidChange = 0;\n (0, _metal.addObserver)(obj, 'plusOne', function () {\n plusOneDidChange++;\n });\n\n assert.equal((0, _metal.get)(obj, 'plusOne'), 1);\n (0, _metal.set)(obj, 'plusOne', 1);\n assert.equal((0, _metal.get)(obj, 'plusOne'), 2);\n (0, _metal.set)(obj, 'plusOne', 1);\n assert.equal((0, _metal.get)(obj, 'plusOne'), 2);\n\n assert.equal(plusOneDidChange, 1);\n\n (0, _metal.set)(obj, 'foo', 5);\n assert.equal((0, _metal.get)(obj, 'plusOne'), 6);\n\n assert.equal(plusOneDidChange, 2);\n }\n });\n\n (0, _internalTestHelpers.moduleFor)('computed - default setter', class extends _internalTestHelpers.AbstractTestCase {\n [\"@test when setting a value on a computed property that doesn't handle sets\"](assert) {\n let obj = {};\n let observerFired = false;\n\n (0, _metal.defineProperty)(obj, 'foo', (0, _metal.computed)(function () {\n return 'foo';\n }));\n\n (0, _metal.addObserver)(obj, 'foo', null, () => observerFired = true);\n\n (0, _metal.set)(obj, 'foo', 'bar');\n\n assert.equal((0, _metal.get)(obj, 'foo'), 'bar', 'The set value is properly returned');\n assert.ok(typeof obj.foo === 'string', 'The computed property was removed');\n assert.ok(observerFired, 'The observer was still notified');\n }\n });\n\n (0, _internalTestHelpers.moduleFor)('computed - readOnly', class extends _internalTestHelpers.AbstractTestCase {\n ['@test is chainable'](assert) {\n let cp = (0, _metal.computed)(function () {}).readOnly();\n\n assert.ok(cp instanceof _metal.Descriptor);\n assert.ok(cp instanceof _metal.ComputedProperty);\n }\n\n ['@test throws assertion if called over a CP with a setter defined with the new syntax']() {\n expectAssertion(() => {\n (0, _metal.computed)({\n get() {},\n set() {}\n }).readOnly();\n }, /Computed properties that define a setter using the new syntax cannot be read-only/);\n }\n\n ['@test protects against setting'](assert) {\n let obj = {};\n\n (0, _metal.defineProperty)(obj, 'bar', (0, _metal.computed)(function () {\n return 'barValue';\n }).readOnly());\n\n assert.equal((0, _metal.get)(obj, 'bar'), 'barValue');\n\n assert.throws(() => {\n (0, _metal.set)(obj, 'bar', 'newBar');\n }, /Cannot set read\\-only property \"bar\" on object:/);\n\n assert.equal((0, _metal.get)(obj, 'bar'), 'barValue');\n }\n });\n});","enifed('@ember/-internals/metal/tests/descriptor_test', ['@ember/-internals/runtime', '@ember/-internals/metal', 'internal-test-helpers'], function (_runtime, _metal, _internalTestHelpers) {\n 'use strict';\n\n let classes = [class {\n static module(title) {\n return `${title}: using defineProperty on an object directly`;\n }\n\n constructor() {\n this.object = {};\n }\n\n install(key, desc, assert) {\n let { object } = this;\n\n (0, _metal.defineProperty)(object, key, desc);\n\n assert.ok(object.hasOwnProperty(key));\n }\n\n set(key, value) {\n this.object[key] = value;\n }\n\n finalize() {\n return this.object;\n }\n\n source() {\n return this.object;\n }\n }, class {\n static module(title) {\n return `${title}: using defineProperty on a prototype`;\n }\n\n constructor() {\n this.proto = {};\n }\n\n install(key, desc, assert) {\n let { proto } = this;\n\n (0, _metal.defineProperty)(proto, key, desc);\n\n assert.ok(proto.hasOwnProperty(key));\n }\n\n set(key, value) {\n this.proto[key] = value;\n }\n\n finalize() {\n return Object.create(this.proto);\n }\n\n source() {\n return this.proto;\n }\n }, class {\n static module(title) {\n return `${title}: in EmberObject.extend()`;\n }\n\n constructor() {\n this.klass = null;\n this.props = {};\n }\n\n install(key, desc) {\n this.props[key] = desc;\n }\n\n set(key, value) {\n this.props[key] = value;\n }\n\n finalize() {\n this.klass = _runtime.Object.extend(this.props);\n return this.klass.create();\n }\n\n source() {\n return this.klass.prototype;\n }\n }, class {\n static module(title) {\n return `${title}: in EmberObject.extend() through a mixin`;\n }\n\n constructor() {\n this.klass = null;\n this.props = {};\n }\n\n install(key, desc) {\n this.props[key] = desc;\n }\n\n set(key, value) {\n this.props[key] = value;\n }\n\n finalize() {\n this.klass = _runtime.Object.extend(_metal.Mixin.create(this.props));\n return this.klass.create();\n }\n\n source() {\n return this.klass.prototype;\n }\n }, class {\n static module(title) {\n return `${title}: inherited from another EmberObject super class`;\n }\n\n constructor() {\n this.superklass = null;\n this.props = {};\n }\n\n install(key, desc) {\n this.props[key] = desc;\n }\n\n set(key, value) {\n this.props[key] = value;\n }\n\n finalize() {\n this.superklass = _runtime.Object.extend(this.props);\n return this.superklass.extend().create();\n }\n\n source() {\n return this.superklass.prototype;\n }\n }];\n\n classes.forEach(TestClass => {\n (0, _internalTestHelpers.moduleFor)(TestClass.module('@ember/-internals/metal/descriptor'), class extends _internalTestHelpers.AbstractTestCase {\n ['@test defining a configurable property'](assert) {\n let factory = new TestClass(assert);\n\n factory.install('foo', (0, _metal.descriptor)({ configurable: true, value: 'bar' }), assert);\n\n let obj = factory.finalize();\n\n assert.equal(obj.foo, 'bar');\n\n let source = factory.source();\n\n delete source.foo;\n\n assert.strictEqual(obj.foo, undefined);\n\n Object.defineProperty(source, 'foo', { configurable: true, value: 'baz' });\n\n assert.equal(obj.foo, 'baz');\n }\n\n ['@test defining a non-configurable property'](assert) {\n let factory = new TestClass(assert);\n factory.install('foo', (0, _metal.descriptor)({ configurable: false, value: 'bar' }), assert);\n\n let obj = factory.finalize();\n\n assert.equal(obj.foo, 'bar');\n\n let source = factory.source();\n\n assert.throws(() => delete source.foo, TypeError);\n\n assert.throws(() => Object.defineProperty(source, 'foo', {\n configurable: true,\n value: 'baz'\n }), TypeError);\n\n assert.equal(obj.foo, 'bar');\n }\n\n ['@test defining an enumerable property'](assert) {\n let factory = new TestClass(assert);\n factory.install('foo', (0, _metal.descriptor)({ enumerable: true, value: 'bar' }), assert);\n\n let obj = factory.finalize();\n\n assert.equal(obj.foo, 'bar');\n\n let source = factory.source();\n\n assert.ok(Object.keys(source).indexOf('foo') !== -1);\n }\n\n ['@test defining a non-enumerable property'](assert) {\n let factory = new TestClass(assert);\n factory.install('foo', (0, _metal.descriptor)({ enumerable: false, value: 'bar' }), assert);\n\n let obj = factory.finalize();\n\n assert.equal(obj.foo, 'bar');\n\n let source = factory.source();\n\n assert.ok(Object.keys(source).indexOf('foo') === -1);\n }\n\n ['@test defining a writable property'](assert) {\n let factory = new TestClass(assert);\n factory.install('foo', (0, _metal.descriptor)({ writable: true, value: 'bar' }), assert);\n\n let obj = factory.finalize();\n\n assert.equal(obj.foo, 'bar');\n\n let source = factory.source();\n\n source.foo = 'baz';\n\n assert.equal(obj.foo, 'baz');\n\n obj.foo = 'bat';\n\n assert.equal(obj.foo, 'bat');\n }\n\n ['@test defining a non-writable property'](assert) {\n let factory = new TestClass(assert);\n factory.install('foo', (0, _metal.descriptor)({ writable: false, value: 'bar' }), assert);\n\n let obj = factory.finalize();\n\n assert.equal(obj.foo, 'bar');\n\n let source = factory.source();\n\n assert.throws(() => source.foo = 'baz', TypeError);\n assert.throws(() => obj.foo = 'baz', TypeError);\n\n assert.equal(obj.foo, 'bar');\n }\n\n ['@test defining a getter'](assert) {\n let factory = new TestClass(assert);\n factory.install('foo', (0, _metal.descriptor)({\n get: function () {\n return this.__foo__;\n }\n }), assert);\n\n factory.set('__foo__', 'bar');\n\n let obj = factory.finalize();\n\n assert.equal(obj.foo, 'bar');\n\n obj.__foo__ = 'baz';\n\n assert.equal(obj.foo, 'baz');\n }\n\n ['@test defining a setter'](assert) {\n let factory = new TestClass(assert);\n factory.install('foo', (0, _metal.descriptor)({\n set: function (value) {\n this.__foo__ = value;\n }\n }), assert);\n\n factory.set('__foo__', 'bar');\n\n let obj = factory.finalize();\n\n assert.equal(obj.__foo__, 'bar');\n\n obj.foo = 'baz';\n\n assert.equal(obj.__foo__, 'baz');\n }\n\n ['@test combining multiple setter and getters'](assert) {\n let factory = new TestClass(assert);\n factory.install('foo', (0, _metal.descriptor)({\n get: function () {\n return this.__foo__;\n },\n\n set: function (value) {\n this.__foo__ = value;\n }\n }), assert);\n\n factory.set('__foo__', 'foo');\n\n factory.install('bar', (0, _metal.descriptor)({\n get: function () {\n return this.__bar__;\n },\n\n set: function (value) {\n this.__bar__ = value;\n }\n }), assert);\n\n factory.set('__bar__', 'bar');\n\n factory.install('fooBar', (0, _metal.descriptor)({\n get: function () {\n return this.foo + '-' + this.bar;\n }\n }), assert);\n\n let obj = factory.finalize();\n\n assert.equal(obj.fooBar, 'foo-bar');\n\n obj.foo = 'FOO';\n\n assert.equal(obj.fooBar, 'FOO-bar');\n\n obj.__bar__ = 'BAR';\n\n assert.equal(obj.fooBar, 'FOO-BAR');\n\n assert.throws(() => obj.fooBar = 'foobar', TypeError);\n\n assert.equal(obj.fooBar, 'FOO-BAR');\n }\n });\n });\n});","enifed('@ember/-internals/metal/tests/events_test', ['@ember/-internals/metal', 'internal-test-helpers'], function (_metal, _internalTestHelpers) {\n 'use strict';\n\n (0, _internalTestHelpers.moduleFor)('system/props/events_test', class extends _internalTestHelpers.AbstractTestCase {\n ['@test listener should receive event - removing should remove'](assert) {\n let obj = {};\n let count = 0;\n\n function F() {\n count++;\n }\n\n (0, _metal.addListener)(obj, 'event!', F);\n assert.equal(count, 0, 'nothing yet');\n\n (0, _metal.sendEvent)(obj, 'event!');\n assert.equal(count, 1, 'received event');\n\n (0, _metal.removeListener)(obj, 'event!', F);\n\n count = 0;\n (0, _metal.sendEvent)(obj, 'event!');\n assert.equal(count, 0, 'received event');\n }\n\n ['@test listeners should be inherited'](assert) {\n let count = 0;\n\n let obj = {\n func() {\n count++;\n }\n };\n\n (0, _metal.addListener)(obj, 'event!', null, 'func');\n\n let obj2 = Object.create(obj);\n\n assert.equal(count, 0, 'nothing yet');\n\n (0, _metal.sendEvent)(obj2, 'event!');\n assert.equal(count, 1, 'received event');\n\n (0, _metal.removeListener)(obj2, 'event!', null, 'func');\n\n count = 0;\n (0, _metal.sendEvent)(obj2, 'event!');\n assert.equal(count, 0, 'did not receive event');\n\n (0, _metal.sendEvent)(obj, 'event!');\n assert.equal(count, 1, 'should still invoke on parent');\n }\n\n ['@test adding a listener more than once should only invoke once'](assert) {\n let count = 0;\n let obj = {\n func() {\n count++;\n }\n };\n\n (0, _metal.addListener)(obj, 'event!', null, 'func');\n (0, _metal.addListener)(obj, 'event!', null, 'func');\n\n (0, _metal.sendEvent)(obj, 'event!');\n assert.equal(count, 1, 'should only invoke once');\n }\n\n ['@test adding a listener with a target should invoke with target'](assert) {\n let obj = {};\n let target;\n\n target = {\n count: 0,\n method() {\n this.count++;\n }\n };\n\n (0, _metal.addListener)(obj, 'event!', target, target.method);\n (0, _metal.sendEvent)(obj, 'event!');\n assert.equal(target.count, 1, 'should invoke');\n }\n\n ['@test adding a listener with string method should lookup method on event delivery'](assert) {\n let obj = {};\n let target;\n\n target = {\n count: 0,\n method() {}\n };\n\n (0, _metal.addListener)(obj, 'event!', target, 'method');\n (0, _metal.sendEvent)(obj, 'event!');\n assert.equal(target.count, 0, 'should invoke but do nothing');\n\n target.method = function () {\n this.count++;\n };\n (0, _metal.sendEvent)(obj, 'event!');\n assert.equal(target.count, 1, 'should invoke now');\n }\n\n ['@test calling sendEvent with extra params should be passed to listeners'](assert) {\n let obj = {};\n let params = null;\n (0, _metal.addListener)(obj, 'event!', function () {\n params = Array.prototype.slice.call(arguments);\n });\n\n (0, _metal.sendEvent)(obj, 'event!', ['foo', 'bar']);\n assert.deepEqual(params, ['foo', 'bar'], 'params should be saved');\n }\n\n ['@test hasListeners tells you if there are listeners for a given event'](assert) {\n let obj = {};\n\n function F() {}\n function F2() {}\n\n assert.equal((0, _metal.hasListeners)(obj, 'event!'), false, 'no listeners at first');\n\n (0, _metal.addListener)(obj, 'event!', F);\n (0, _metal.addListener)(obj, 'event!', F2);\n\n assert.equal((0, _metal.hasListeners)(obj, 'event!'), true, 'has listeners');\n\n (0, _metal.removeListener)(obj, 'event!', F);\n assert.equal((0, _metal.hasListeners)(obj, 'event!'), true, 'has listeners');\n\n (0, _metal.removeListener)(obj, 'event!', F2);\n assert.equal((0, _metal.hasListeners)(obj, 'event!'), false, 'has no more listeners');\n\n (0, _metal.addListener)(obj, 'event!', F);\n assert.equal((0, _metal.hasListeners)(obj, 'event!'), true, 'has listeners');\n }\n\n ['@test calling removeListener without method should remove all listeners'](assert) {\n expectDeprecation(() => {\n let obj = {};\n function F() {}\n function F2() {}\n\n assert.equal((0, _metal.hasListeners)(obj, 'event!'), false, 'no listeners at first');\n\n (0, _metal.addListener)(obj, 'event!', F);\n (0, _metal.addListener)(obj, 'event!', F2);\n\n assert.equal((0, _metal.hasListeners)(obj, 'event!'), true, 'has listeners');\n (0, _metal.removeListener)(obj, 'event!');\n\n assert.equal((0, _metal.hasListeners)(obj, 'event!'), false, 'has no more listeners');\n }, /The remove all functionality of removeListener and removeObserver has been deprecated/);\n }\n\n ['@test a listener can be added as part of a mixin'](assert) {\n let triggered = 0;\n let MyMixin = _metal.Mixin.create({\n foo1: (0, _metal.on)('bar', function () {\n triggered++;\n }),\n\n foo2: (0, _metal.on)('bar', function () {\n triggered++;\n })\n });\n\n let obj = {};\n MyMixin.apply(obj);\n\n (0, _metal.sendEvent)(obj, 'bar');\n assert.equal(triggered, 2, 'should invoke listeners');\n }\n\n [`@test 'on' asserts for invalid arguments`]() {\n expectAssertion(() => {\n _metal.Mixin.create({\n foo1: (0, _metal.on)('bar')\n });\n }, 'on expects function as last argument');\n\n expectAssertion(() => {\n _metal.Mixin.create({\n foo1: (0, _metal.on)(function () {})\n });\n }, 'on called without valid event names');\n }\n\n ['@test a listener added as part of a mixin may be overridden'](assert) {\n let triggered = 0;\n let FirstMixin = _metal.Mixin.create({\n foo: (0, _metal.on)('bar', function () {\n triggered++;\n })\n });\n let SecondMixin = _metal.Mixin.create({\n foo: (0, _metal.on)('baz', function () {\n triggered++;\n })\n });\n\n let obj = {};\n FirstMixin.apply(obj);\n SecondMixin.apply(obj);\n\n (0, _metal.sendEvent)(obj, 'bar');\n assert.equal(triggered, 0, 'should not invoke from overridden property');\n\n (0, _metal.sendEvent)(obj, 'baz');\n assert.equal(triggered, 1, 'should invoke from subclass property');\n }\n });\n});","enifed('@ember/-internals/metal/tests/expand_properties_test', ['@ember/-internals/metal', 'internal-test-helpers'], function (_metal, _internalTestHelpers) {\n 'use strict';\n\n let foundProperties = [];\n\n function addProperty(property) {\n foundProperties.push(property);\n }\n\n (0, _internalTestHelpers.moduleFor)('Property Brace Expansion Test', class extends _internalTestHelpers.AbstractTestCase {\n beforeEach() {\n foundProperties = [];\n }\n\n ['@test Properties without expansions are unaffected'](assert) {\n assert.expect(1);\n\n (0, _metal.expandProperties)('a', addProperty);\n (0, _metal.expandProperties)('a.b', addProperty);\n (0, _metal.expandProperties)('a.b.[]', addProperty);\n (0, _metal.expandProperties)('a.b.@each.c', addProperty);\n\n assert.deepEqual(['a', 'a.b', 'a.b.[]', 'a.b.@each.c'].sort(), foundProperties.sort());\n }\n\n ['@test A single expansion at the end expands properly'](assert) {\n assert.expect(1);\n\n (0, _metal.expandProperties)('a.b.{c,d}', addProperty);\n\n assert.deepEqual(['a.b.c', 'a.b.d'].sort(), foundProperties.sort());\n }\n\n ['@test A property with only a brace expansion expands correctly'](assert) {\n assert.expect(1);\n\n (0, _metal.expandProperties)('{a,b,c}', addProperty);\n\n let expected = ['a', 'b', 'c'];\n assert.deepEqual(expected.sort(), foundProperties.sort());\n }\n\n ['@test Expansions with single properties only expand once'](assert) {\n assert.expect(1);\n\n (0, _metal.expandProperties)('a.b.{c}.d.{e}', addProperty);\n\n assert.deepEqual(['a.b.c.d.e'], foundProperties);\n }\n\n ['@test A single brace expansion expands correctly'](assert) {\n assert.expect(1);\n\n (0, _metal.expandProperties)('a.{b,c,d}.e', addProperty);\n\n let expected = ['a.b.e', 'a.c.e', 'a.d.e'];\n assert.deepEqual(expected.sort(), foundProperties.sort());\n }\n\n ['@test Multiple brace expansions work correctly'](assert) {\n assert.expect(1);\n\n (0, _metal.expandProperties)('{a,b,c}.d.{e,f}.g', addProperty);\n\n let expected = ['a.d.e.g', 'a.d.f.g', 'b.d.e.g', 'b.d.f.g', 'c.d.e.g', 'c.d.f.g'];\n assert.deepEqual(expected.sort(), foundProperties.sort());\n }\n\n ['@test A property with only brace expansions expands correctly'](assert) {\n assert.expect(1);\n\n (0, _metal.expandProperties)('{a,b,c}.{d}.{e,f}', addProperty);\n\n let expected = ['a.d.e', 'a.d.f', 'b.d.e', 'b.d.f', 'c.d.e', 'c.d.f'];\n assert.deepEqual(expected.sort(), foundProperties.sort());\n }\n\n ['@test Nested brace expansions are not allowed']() {\n let nestedBraceProperties = ['a.{b.{c,d}}', 'a.{{b}.c}', 'a.{b,c}.{d.{e,f}.g', 'a.{b.{c}', 'a.{b,c}}', 'model.{bar,baz'];\n\n nestedBraceProperties.forEach(invalidProperties => {\n expectAssertion(() => (0, _metal.expandProperties)(invalidProperties, addProperty));\n }, /Brace expanded properties have to be balanced and cannot be nested/);\n }\n\n ['@test A property with no braces does not expand'](assert) {\n assert.expect(1);\n\n (0, _metal.expandProperties)('a,b,c.d.e,f', addProperty);\n\n assert.deepEqual(foundProperties, ['a,b,c.d.e,f']);\n }\n\n ['@test A pattern must be a string'](assert) {\n assert.expect(1);\n\n expectAssertion(() => {\n (0, _metal.expandProperties)([1, 2], addProperty);\n }, /A computed property key must be a string/);\n }\n\n ['@test A pattern must not contain a space'](assert) {\n assert.expect(1);\n\n expectAssertion(function () {\n (0, _metal.expandProperties)('{a, b}', addProperty);\n }, /Brace expanded properties cannot contain spaces, e.g. \"user.{firstName, lastName}\" should be \"user.{firstName,lastName}\"/);\n }\n });\n});","enifed('@ember/-internals/metal/tests/injected_property_test', ['@ember/-internals/owner', '@ember/-internals/metal', 'internal-test-helpers'], function (_owner, _metal, _internalTestHelpers) {\n 'use strict';\n\n (0, _internalTestHelpers.moduleFor)('InjectedProperty', class extends _internalTestHelpers.AbstractTestCase {\n ['@test injected properties should be descriptors'](assert) {\n assert.ok(new _metal.InjectedProperty() instanceof _metal.Descriptor);\n }\n\n ['@test injected properties should be overridable'](assert) {\n let obj = {};\n (0, _metal.defineProperty)(obj, 'foo', new _metal.InjectedProperty());\n\n (0, _metal.set)(obj, 'foo', 'bar');\n\n assert.equal((0, _metal.get)(obj, 'foo'), 'bar', 'should return the overridden value');\n }\n\n ['@test getting on an object without an owner or container should fail assertion']() {\n let obj = {};\n (0, _metal.defineProperty)(obj, 'foo', new _metal.InjectedProperty('type', 'name'));\n\n expectAssertion(function () {\n (0, _metal.get)(obj, 'foo');\n }, /Attempting to lookup an injected property on an object without a container, ensure that the object was instantiated via a container./);\n }\n\n ['@test getting on an object without an owner but with a container should not fail'](assert) {\n let obj = {\n container: {\n lookup(key) {\n assert.ok(true, 'should call container.lookup');\n return key;\n }\n }\n };\n\n (0, _metal.defineProperty)(obj, 'foo', new _metal.InjectedProperty('type', 'name'));\n\n assert.equal((0, _metal.get)(obj, 'foo'), 'type:name', 'should return the value of container.lookup');\n }\n\n ['@test getting should return a lookup on the container'](assert) {\n assert.expect(2);\n\n let obj = {};\n\n (0, _owner.setOwner)(obj, {\n lookup(key) {\n assert.ok(true, 'should call container.lookup');\n return key;\n }\n });\n\n (0, _metal.defineProperty)(obj, 'foo', new _metal.InjectedProperty('type', 'name'));\n\n assert.equal((0, _metal.get)(obj, 'foo'), 'type:name', 'should return the value of container.lookup');\n }\n\n ['@test omitting the lookup name should default to the property name'](assert) {\n let obj = {};\n\n (0, _owner.setOwner)(obj, {\n lookup(key) {\n return key;\n }\n });\n\n (0, _metal.defineProperty)(obj, 'foo', new _metal.InjectedProperty('type'));\n\n assert.equal((0, _metal.get)(obj, 'foo'), 'type:foo', 'should lookup the type using the property name');\n }\n });\n});","enifed('@ember/-internals/metal/tests/is_blank_test', ['@ember/-internals/metal', 'internal-test-helpers'], function (_metal, _internalTestHelpers) {\n 'use strict';\n\n (0, _internalTestHelpers.moduleFor)('isBlank', class extends _internalTestHelpers.AbstractTestCase {\n ['@test isBlank'](assert) {\n let string = 'string';\n let fn = function () {};\n let object = { length: 0 };\n\n assert.equal(true, (0, _metal.isBlank)(null), 'for null');\n assert.equal(true, (0, _metal.isBlank)(undefined), 'for undefined');\n assert.equal(true, (0, _metal.isBlank)(''), 'for an empty String');\n assert.equal(true, (0, _metal.isBlank)(' '), 'for a whitespace String');\n assert.equal(true, (0, _metal.isBlank)('\\n\\t'), 'for another whitespace String');\n assert.equal(false, (0, _metal.isBlank)('\\n\\t Hi'), 'for a String with whitespaces');\n assert.equal(false, (0, _metal.isBlank)(true), 'for true');\n assert.equal(false, (0, _metal.isBlank)(false), 'for false');\n assert.equal(false, (0, _metal.isBlank)(string), 'for a String');\n assert.equal(false, (0, _metal.isBlank)(fn), 'for a Function');\n assert.equal(false, (0, _metal.isBlank)(0), 'for 0');\n assert.equal(true, (0, _metal.isBlank)([]), 'for an empty Array');\n assert.equal(false, (0, _metal.isBlank)({}), 'for an empty Object');\n assert.equal(true, (0, _metal.isBlank)(object), \"for an Object that has zero 'length'\");\n assert.equal(false, (0, _metal.isBlank)([1, 2, 3]), 'for a non-empty array');\n }\n });\n});","enifed('@ember/-internals/metal/tests/is_empty_test', ['@ember/-internals/metal', '@ember/map', '@ember/map/lib/ordered-set', 'internal-test-helpers'], function (_metal, _map, _orderedSet, _internalTestHelpers) {\n 'use strict';\n\n (0, _internalTestHelpers.moduleFor)('isEmpty', class extends _internalTestHelpers.AbstractTestCase {\n ['@test isEmpty'](assert) {\n let string = 'string';\n let fn = function () {};\n let object = { length: 0 };\n\n assert.equal(true, (0, _metal.isEmpty)(null), 'for null');\n assert.equal(true, (0, _metal.isEmpty)(undefined), 'for undefined');\n assert.equal(true, (0, _metal.isEmpty)(''), 'for an empty String');\n assert.equal(false, (0, _metal.isEmpty)(' '), 'for a whitespace String');\n assert.equal(false, (0, _metal.isEmpty)('\\n\\t'), 'for another whitespace String');\n assert.equal(false, (0, _metal.isEmpty)(true), 'for true');\n assert.equal(false, (0, _metal.isEmpty)(false), 'for false');\n assert.equal(false, (0, _metal.isEmpty)(string), 'for a String');\n assert.equal(false, (0, _metal.isEmpty)(fn), 'for a Function');\n assert.equal(false, (0, _metal.isEmpty)(0), 'for 0');\n assert.equal(true, (0, _metal.isEmpty)([]), 'for an empty Array');\n assert.equal(false, (0, _metal.isEmpty)({}), 'for an empty Object');\n assert.equal(true, (0, _metal.isEmpty)(object), \"for an Object that has zero 'length'\");\n }\n\n ['@test isEmpty Map'](assert) {\n expectDeprecation(() => {\n let map = new _map.default();\n assert.equal(true, (0, _metal.isEmpty)(map), 'Empty map is empty');\n map.set('foo', 'bar');\n assert.equal(false, (0, _metal.isEmpty)(map), 'Map is not empty');\n }, 'Use of @ember/Map is deprecated. Please use native `Map` instead', { id: 'ember-map-deprecation', until: '3.5.0' });\n }\n\n ['@test isEmpty Ember.OrderedSet'](assert) {\n expectDeprecation(() => {\n let orderedSet = new _orderedSet.default();\n assert.equal(true, (0, _metal.isEmpty)(orderedSet), 'Empty ordered set is empty');\n orderedSet.add('foo');\n assert.equal(false, (0, _metal.isEmpty)(orderedSet), 'Ordered set is not empty');\n }, 'Use of @ember/OrderedSet is deprecated. Please use native `Map` instead', { id: 'ember-map-deprecation', until: '3.5.0' });\n }\n });\n});","enifed('@ember/-internals/metal/tests/is_none_test', ['@ember/-internals/metal', 'internal-test-helpers'], function (_metal, _internalTestHelpers) {\n 'use strict';\n\n (0, _internalTestHelpers.moduleFor)('isNone', class extends _internalTestHelpers.AbstractTestCase {\n ['@test isNone'](assert) {\n let string = 'string';\n let fn = function () {};\n\n assert.equal(true, (0, _metal.isNone)(null), 'for null');\n assert.equal(true, (0, _metal.isNone)(undefined), 'for undefined');\n assert.equal(false, (0, _metal.isNone)(''), 'for an empty String');\n assert.equal(false, (0, _metal.isNone)(true), 'for true');\n assert.equal(false, (0, _metal.isNone)(false), 'for false');\n assert.equal(false, (0, _metal.isNone)(string), 'for a String');\n assert.equal(false, (0, _metal.isNone)(fn), 'for a Function');\n assert.equal(false, (0, _metal.isNone)(0), 'for 0');\n assert.equal(false, (0, _metal.isNone)([]), 'for an empty Array');\n assert.equal(false, (0, _metal.isNone)({}), 'for an empty Object');\n }\n });\n});","enifed('@ember/-internals/metal/tests/is_present_test', ['@ember/-internals/metal', 'internal-test-helpers'], function (_metal, _internalTestHelpers) {\n 'use strict';\n\n (0, _internalTestHelpers.moduleFor)('isPresent', class extends _internalTestHelpers.AbstractTestCase {\n ['@test isPresent'](assert) {\n let string = 'string';\n let fn = function () {};\n let object = { length: 0 };\n\n assert.equal(false, (0, _metal.isPresent)(), 'for no params');\n assert.equal(false, (0, _metal.isPresent)(null), 'for null');\n assert.equal(false, (0, _metal.isPresent)(undefined), 'for undefined');\n assert.equal(false, (0, _metal.isPresent)(''), 'for an empty String');\n assert.equal(false, (0, _metal.isPresent)(' '), 'for a whitespace String');\n assert.equal(false, (0, _metal.isPresent)('\\n\\t'), 'for another whitespace String');\n assert.equal(true, (0, _metal.isPresent)('\\n\\t Hi'), 'for a String with whitespaces');\n assert.equal(true, (0, _metal.isPresent)(true), 'for true');\n assert.equal(true, (0, _metal.isPresent)(false), 'for false');\n assert.equal(true, (0, _metal.isPresent)(string), 'for a String');\n assert.equal(true, (0, _metal.isPresent)(fn), 'for a Function');\n assert.equal(true, (0, _metal.isPresent)(0), 'for 0');\n assert.equal(false, (0, _metal.isPresent)([]), 'for an empty Array');\n assert.equal(true, (0, _metal.isPresent)({}), 'for an empty Object');\n assert.equal(false, (0, _metal.isPresent)(object), \"for an Object that has zero 'length'\");\n assert.equal(true, (0, _metal.isPresent)([1, 2, 3]), 'for a non-empty array');\n }\n });\n});","enifed('@ember/-internals/metal/tests/libraries_test', ['@ember/debug', '@ember/-internals/metal', 'internal-test-helpers'], function (_debug, _metal, _internalTestHelpers) {\n 'use strict';\n\n let libs, registry; /* globals EmberDev */\n\n let originalWarn = (0, _debug.getDebugFunction)('warn');\n function noop() {}\n\n (0, _internalTestHelpers.moduleFor)('Libraries registry', class extends _internalTestHelpers.AbstractTestCase {\n beforeEach() {\n libs = new _metal.Libraries();\n registry = libs._registry;\n }\n\n afterEach() {\n libs = null;\n registry = null;\n\n (0, _debug.setDebugFunction)('warn', originalWarn);\n }\n\n ['@test core libraries come before other libraries'](assert) {\n assert.expect(2);\n\n libs.register('my-lib', '2.0.0a');\n libs.registerCoreLibrary('DS', '1.0.0-beta.2');\n\n assert.equal(registry[0].name, 'DS');\n assert.equal(registry[1].name, 'my-lib');\n }\n\n ['@test only the first registration of a library is stored'](assert) {\n assert.expect(3);\n\n // overwrite warn to supress the double registration warning (see https://github.com/emberjs/ember.js/issues/16391)\n (0, _debug.setDebugFunction)('warn', noop);\n libs.register('magic', 1.23);\n libs.register('magic', 2.23);\n\n assert.equal(registry[0].name, 'magic');\n assert.equal(registry[0].version, 1.23);\n assert.equal(registry.length, 1);\n }\n\n ['@test isRegistered returns correct value'](assert) {\n if (false /* EMBER_LIBRARIES_ISREGISTERED */) {\n assert.expect(3);\n\n assert.equal(libs.isRegistered('magic'), false);\n\n libs.register('magic', 1.23);\n assert.equal(libs.isRegistered('magic'), true);\n\n libs.deRegister('magic');\n assert.equal(libs.isRegistered('magic'), false);\n } else {\n assert.expect(0);\n }\n }\n\n ['@test attempting to register a library that is already registered warns you'](assert) {\n if (EmberDev && EmberDev.runningProdBuild) {\n assert.ok(true, 'Logging does not occur in production builds');\n return;\n }\n\n assert.expect(1);\n\n libs.register('magic', 1.23);\n\n (0, _debug.setDebugFunction)('warn', function (msg, test) {\n if (!test) {\n assert.equal(msg, 'Library \"magic\" is already registered with Ember.');\n }\n });\n\n // Should warn us\n libs.register('magic', 2.23);\n }\n\n ['@test libraries can be de-registered'](assert) {\n assert.expect(2);\n\n libs.register('lib1', '1.0.0b');\n libs.register('lib2', '1.0.0b');\n libs.register('lib3', '1.0.0b');\n\n libs.deRegister('lib1');\n libs.deRegister('lib3');\n\n assert.equal(registry[0].name, 'lib2');\n assert.equal(registry.length, 1);\n }\n });\n});","enifed('@ember/-internals/metal/tests/main_test', ['ember/version', 'internal-test-helpers'], function (_version, _internalTestHelpers) {\n 'use strict';\n\n // From https://github.com/semver/semver.org/issues/59 & https://regex101.com/r/vW1jA8/6\n const SEMVER_REGEX = /^((?:0|(?:[1-9]\\d*)))\\.((?:0|(?:[1-9]\\d*)))\\.((?:0|(?:[1-9]\\d*)))(?:-([0-9A-Za-z-]+(\\.[0-9A-Za-z-]+)*))?(?:\\+([0-9A-Za-z-]+(\\.[0-9A-Za-z-]+)*))?$/;\n\n (0, _internalTestHelpers.moduleFor)('@ember/-internals/metal/core/main', class extends _internalTestHelpers.AbstractTestCase {\n ['@test Ember.VERSION is in alignment with SemVer v2.0.0'](assert) {\n assert.ok(SEMVER_REGEX.test(_version.default), `Ember.VERSION (${_version.default})is valid SemVer v2.0.0`);\n }\n\n ['@test SEMVER_REGEX properly validates and invalidates version numbers'](assert) {\n function validateVersionString(versionString, expectedResult) {\n assert.equal(SEMVER_REGEX.test(versionString), expectedResult);\n }\n\n // Positive test cases\n validateVersionString('1.11.3', true);\n validateVersionString('1.0.0-beta.16.1', true);\n validateVersionString('1.12.1+canary.aba1412', true);\n validateVersionString('2.0.0-beta.1+canary.bb344775', true);\n validateVersionString('3.1.0-foobarBaz+30d70bd3', true);\n\n // Negative test cases\n validateVersionString('1.11.3.aba18a', false);\n validateVersionString('1.11', false);\n }\n });\n});","enifed('@ember/-internals/metal/tests/mixin/alias_method_test', ['@ember/-internals/metal', 'internal-test-helpers'], function (_metal, _internalTestHelpers) {\n 'use strict';\n\n function validateAliasMethod(assert, obj) {\n assert.equal(obj.fooMethod(), 'FOO', 'obj.fooMethod()');\n assert.equal(obj.barMethod(), 'FOO', 'obj.barMethod should be a copy of foo');\n }\n\n (0, _internalTestHelpers.moduleFor)('aliasMethod', class extends _internalTestHelpers.AbstractTestCase {\n ['@test methods of another name are aliased when the mixin is applied'](assert) {\n let MyMixin = _metal.Mixin.create({\n fooMethod() {\n return 'FOO';\n },\n barMethod: (0, _metal.aliasMethod)('fooMethod')\n });\n\n let obj = MyMixin.apply({});\n validateAliasMethod(assert, obj);\n }\n\n ['@test should follow aliasMethods all the way down'](assert) {\n let MyMixin = _metal.Mixin.create({\n bar: (0, _metal.aliasMethod)('foo'), // put first to break ordered iteration\n baz() {\n return 'baz';\n },\n foo: (0, _metal.aliasMethod)('baz')\n });\n\n let obj = MyMixin.apply({});\n assert.equal((0, _metal.get)(obj, 'bar')(), 'baz', 'should have followed aliasMethods');\n }\n\n ['@test should alias methods from other dependent mixins'](assert) {\n let BaseMixin = _metal.Mixin.create({\n fooMethod() {\n return 'FOO';\n }\n });\n\n let MyMixin = _metal.Mixin.create(BaseMixin, {\n barMethod: (0, _metal.aliasMethod)('fooMethod')\n });\n\n let obj = MyMixin.apply({});\n validateAliasMethod(assert, obj);\n }\n\n ['@test should alias methods from other mixins applied at same time'](assert) {\n let BaseMixin = _metal.Mixin.create({\n fooMethod() {\n return 'FOO';\n }\n });\n\n let MyMixin = _metal.Mixin.create({\n barMethod: (0, _metal.aliasMethod)('fooMethod')\n });\n\n let obj = (0, _metal.mixin)({}, BaseMixin, MyMixin);\n validateAliasMethod(assert, obj);\n }\n\n ['@test should alias methods from mixins already applied on object'](assert) {\n let BaseMixin = _metal.Mixin.create({\n quxMethod() {\n return 'qux';\n }\n });\n\n let MyMixin = _metal.Mixin.create({\n bar: (0, _metal.aliasMethod)('foo'),\n barMethod: (0, _metal.aliasMethod)('fooMethod')\n });\n\n let obj = {\n fooMethod() {\n return 'FOO';\n }\n };\n\n BaseMixin.apply(obj);\n MyMixin.apply(obj);\n\n validateAliasMethod(assert, obj);\n }\n });\n});","enifed('@ember/-internals/metal/tests/mixin/apply_test', ['@ember/-internals/metal', 'internal-test-helpers'], function (_metal, _internalTestHelpers) {\n 'use strict';\n\n function K() {}\n\n (0, _internalTestHelpers.moduleFor)('Mixin.apply', class extends _internalTestHelpers.AbstractTestCase {\n ['@test using apply() should apply properties'](assert) {\n let MixinA = _metal.Mixin.create({ foo: 'FOO', baz: K });\n let obj = {};\n (0, _metal.mixin)(obj, MixinA);\n\n assert.equal((0, _metal.get)(obj, 'foo'), 'FOO', 'should apply foo');\n assert.equal((0, _metal.get)(obj, 'baz'), K, 'should apply foo');\n }\n\n ['@test applying anonymous properties'](assert) {\n let obj = {};\n (0, _metal.mixin)(obj, {\n foo: 'FOO',\n baz: K\n });\n\n assert.equal((0, _metal.get)(obj, 'foo'), 'FOO', 'should apply foo');\n assert.equal((0, _metal.get)(obj, 'baz'), K, 'should apply foo');\n }\n\n ['@test applying null values']() {\n expectAssertion(() => (0, _metal.mixin)({}, null));\n }\n\n ['@test applying a property with an undefined value'](assert) {\n let obj = { tagName: '' };\n (0, _metal.mixin)(obj, { tagName: undefined });\n\n assert.strictEqual((0, _metal.get)(obj, 'tagName'), '');\n }\n });\n});","enifed('@ember/-internals/metal/tests/mixin/computed_test', ['@ember/-internals/metal', 'internal-test-helpers'], function (_metal, _internalTestHelpers) {\n 'use strict';\n\n function K() {\n return this;\n }\n\n (0, _internalTestHelpers.moduleFor)('Mixin Computed Properties', class extends _internalTestHelpers.AbstractTestCase {\n ['@test overriding computed properties'](assert) {\n let MixinA, MixinB, MixinC, MixinD;\n let obj;\n\n MixinA = _metal.Mixin.create({\n aProp: (0, _metal.computed)(function () {\n return 'A';\n })\n });\n\n MixinB = _metal.Mixin.create(MixinA, {\n aProp: (0, _metal.computed)(function () {\n return this._super(...arguments) + 'B';\n })\n });\n\n MixinC = _metal.Mixin.create(MixinA, {\n aProp: (0, _metal.computed)(function () {\n return this._super(...arguments) + 'C';\n })\n });\n\n MixinD = _metal.Mixin.create({\n aProp: (0, _metal.computed)(function () {\n return this._super(...arguments) + 'D';\n })\n });\n\n obj = {};\n MixinB.apply(obj);\n assert.equal((0, _metal.get)(obj, 'aProp'), 'AB', 'should expose super for B');\n\n obj = {};\n MixinC.apply(obj);\n assert.equal((0, _metal.get)(obj, 'aProp'), 'AC', 'should expose super for C');\n\n obj = {};\n\n MixinA.apply(obj);\n MixinD.apply(obj);\n assert.equal((0, _metal.get)(obj, 'aProp'), 'AD', 'should define super for D');\n\n obj = {};\n (0, _metal.defineProperty)(obj, 'aProp', (0, _metal.computed)(function () {\n return 'obj';\n }));\n MixinD.apply(obj);\n assert.equal((0, _metal.get)(obj, 'aProp'), 'objD', 'should preserve original computed property');\n }\n\n ['@test calling set on overridden computed properties'](assert) {\n let SuperMixin, SubMixin;\n let obj;\n\n let superGetOccurred = false;\n let superSetOccurred = false;\n\n SuperMixin = _metal.Mixin.create({\n aProp: (0, _metal.computed)({\n get() {\n superGetOccurred = true;\n },\n set() {\n superSetOccurred = true;\n }\n })\n });\n\n SubMixin = _metal.Mixin.create(SuperMixin, {\n aProp: (0, _metal.computed)({\n get() {\n return this._super(...arguments);\n },\n set() {\n return this._super(...arguments);\n }\n })\n });\n\n obj = {};\n SubMixin.apply(obj);\n\n (0, _metal.set)(obj, 'aProp', 'set thyself');\n assert.ok(superSetOccurred, 'should pass set to _super');\n\n superSetOccurred = false; // reset the set assertion\n\n obj = {};\n SubMixin.apply(obj);\n\n (0, _metal.get)(obj, 'aProp');\n assert.ok(superGetOccurred, 'should pass get to _super');\n\n (0, _metal.set)(obj, 'aProp', 'set thyself');\n assert.ok(superSetOccurred, 'should pass set to _super after getting');\n }\n\n ['@test setter behavior works properly when overriding computed properties'](assert) {\n let obj = {};\n\n let MixinA = _metal.Mixin.create({\n cpWithSetter2: (0, _metal.computed)(K),\n cpWithSetter3: (0, _metal.computed)(K),\n cpWithoutSetter: (0, _metal.computed)(K)\n });\n\n let cpWasCalled = false;\n\n let MixinB = _metal.Mixin.create({\n cpWithSetter2: (0, _metal.computed)({\n get: K,\n set() {\n cpWasCalled = true;\n }\n }),\n\n cpWithSetter3: (0, _metal.computed)({\n get: K,\n set() {\n cpWasCalled = true;\n }\n }),\n\n cpWithoutSetter: (0, _metal.computed)(function () {\n cpWasCalled = true;\n })\n });\n\n MixinA.apply(obj);\n MixinB.apply(obj);\n\n (0, _metal.set)(obj, 'cpWithSetter2', 'test');\n assert.ok(cpWasCalled, 'The computed property setter was called when defined with two args');\n cpWasCalled = false;\n\n (0, _metal.set)(obj, 'cpWithSetter3', 'test');\n assert.ok(cpWasCalled, 'The computed property setter was called when defined with three args');\n cpWasCalled = false;\n\n (0, _metal.set)(obj, 'cpWithoutSetter', 'test');\n assert.equal((0, _metal.get)(obj, 'cpWithoutSetter'), 'test', 'The default setter was called, the value is correct');\n assert.ok(!cpWasCalled, 'The default setter was called, not the CP itself');\n }\n });\n});","enifed('@ember/-internals/metal/tests/mixin/concatenated_properties_test', ['@ember/-internals/metal', 'internal-test-helpers'], function (_metal, _internalTestHelpers) {\n 'use strict';\n\n (0, _internalTestHelpers.moduleFor)('Mixin concatenatedProperties', class extends _internalTestHelpers.AbstractTestCase {\n ['@test defining concatenated properties should concat future version'](assert) {\n let MixinA = _metal.Mixin.create({\n concatenatedProperties: ['foo'],\n foo: ['a', 'b', 'c']\n });\n\n let MixinB = _metal.Mixin.create({\n foo: ['d', 'e', 'f']\n });\n\n let obj = (0, _metal.mixin)({}, MixinA, MixinB);\n assert.deepEqual((0, _metal.get)(obj, 'foo'), ['a', 'b', 'c', 'd', 'e', 'f']);\n }\n\n ['@test defining concatenated properties should concat future version'](assert) {\n let MixinA = _metal.Mixin.create({\n concatenatedProperties: null\n });\n\n let MixinB = _metal.Mixin.create({\n concatenatedProperties: null\n });\n\n let obj = (0, _metal.mixin)({}, MixinA, MixinB);\n\n assert.deepEqual(obj.concatenatedProperties, []);\n }\n\n ['@test concatenatedProperties should be concatenated'](assert) {\n let MixinA = _metal.Mixin.create({\n concatenatedProperties: ['foo'],\n foo: ['a', 'b', 'c']\n });\n\n let MixinB = _metal.Mixin.create({\n concatenatedProperties: 'bar',\n foo: ['d', 'e', 'f'],\n bar: [1, 2, 3]\n });\n\n let MixinC = _metal.Mixin.create({\n bar: [4, 5, 6]\n });\n\n let obj = (0, _metal.mixin)({}, MixinA, MixinB, MixinC);\n assert.deepEqual((0, _metal.get)(obj, 'concatenatedProperties'), ['foo', 'bar'], 'get concatenatedProperties');\n assert.deepEqual((0, _metal.get)(obj, 'foo'), ['a', 'b', 'c', 'd', 'e', 'f'], 'get foo');\n assert.deepEqual((0, _metal.get)(obj, 'bar'), [1, 2, 3, 4, 5, 6], 'get bar');\n }\n\n ['@test adding a prop that is not an array should make array'](assert) {\n let MixinA = _metal.Mixin.create({\n concatenatedProperties: ['foo'],\n foo: [1, 2, 3]\n });\n\n let MixinB = _metal.Mixin.create({\n foo: 4\n });\n\n let obj = (0, _metal.mixin)({}, MixinA, MixinB);\n assert.deepEqual((0, _metal.get)(obj, 'foo'), [1, 2, 3, 4]);\n }\n\n ['@test adding a prop that is not an array should make array'](assert) {\n let MixinA = _metal.Mixin.create({\n concatenatedProperties: ['foo'],\n foo: 'bar'\n });\n\n let obj = (0, _metal.mixin)({}, MixinA);\n assert.deepEqual((0, _metal.get)(obj, 'foo'), ['bar']);\n }\n\n ['@test adding a non-concatenable property that already has a defined value should result in an array with both values'](assert) {\n let mixinA = _metal.Mixin.create({\n foo: 1\n });\n\n let mixinB = _metal.Mixin.create({\n concatenatedProperties: ['foo'],\n foo: 2\n });\n\n let obj = (0, _metal.mixin)({}, mixinA, mixinB);\n assert.deepEqual((0, _metal.get)(obj, 'foo'), [1, 2]);\n }\n\n ['@test adding a concatenable property that already has a defined value should result in a concatenated value'](assert) {\n let mixinA = _metal.Mixin.create({\n foobar: 'foo'\n });\n\n let mixinB = _metal.Mixin.create({\n concatenatedProperties: ['foobar'],\n foobar: 'bar'\n });\n\n let obj = (0, _metal.mixin)({}, mixinA, mixinB);\n assert.deepEqual((0, _metal.get)(obj, 'foobar'), ['foo', 'bar']);\n }\n });\n});","enifed('@ember/-internals/metal/tests/mixin/detect_test', ['@ember/-internals/metal', 'internal-test-helpers'], function (_metal, _internalTestHelpers) {\n 'use strict';\n\n (0, _internalTestHelpers.moduleFor)('Mixin.detect', class extends _internalTestHelpers.AbstractTestCase {\n ['@test detect() finds a directly applied mixin'](assert) {\n let MixinA = _metal.Mixin.create();\n let obj = {};\n\n assert.equal(MixinA.detect(obj), false, 'MixinA.detect(obj) before apply()');\n\n MixinA.apply(obj);\n assert.equal(MixinA.detect(obj), true, 'MixinA.detect(obj) after apply()');\n }\n\n ['@test detect() finds nested mixins'](assert) {\n let MixinA = _metal.Mixin.create({});\n let MixinB = _metal.Mixin.create(MixinA);\n let obj = {};\n\n assert.equal(MixinA.detect(obj), false, 'MixinA.detect(obj) before apply()');\n\n MixinB.apply(obj);\n assert.equal(MixinA.detect(obj), true, 'MixinA.detect(obj) after apply()');\n }\n\n ['@test detect() finds mixins on other mixins'](assert) {\n let MixinA = _metal.Mixin.create({});\n let MixinB = _metal.Mixin.create(MixinA);\n assert.equal(MixinA.detect(MixinB), true, 'MixinA is part of MixinB');\n assert.equal(MixinB.detect(MixinA), false, 'MixinB is not part of MixinA');\n }\n\n ['@test detect handles null values'](assert) {\n let MixinA = _metal.Mixin.create();\n assert.equal(MixinA.detect(null), false);\n }\n });\n});","enifed('@ember/-internals/metal/tests/mixin/introspection_test', ['@ember/-internals/utils', '@ember/-internals/metal', 'internal-test-helpers'], function (_utils, _metal, _internalTestHelpers) {\n 'use strict';\n\n const PrivateProperty = _metal.Mixin.create({\n _foo: '_FOO'\n }); // NOTE: A previous iteration differentiated between public and private props\n // as well as methods vs props. We are just keeping these for testing; the\n // current impl doesn't care about the differences as much...\n\n const PublicProperty = _metal.Mixin.create({\n foo: 'FOO'\n });\n const PrivateMethod = _metal.Mixin.create({\n _fooMethod() {}\n });\n const PublicMethod = _metal.Mixin.create({\n fooMethod() {}\n });\n const BarProperties = _metal.Mixin.create({\n _bar: '_BAR',\n bar: 'bar'\n });\n const BarMethods = _metal.Mixin.create({\n _barMethod() {},\n barMethod() {}\n });\n\n const Combined = _metal.Mixin.create(BarProperties, BarMethods);\n\n let obj;\n\n (0, _internalTestHelpers.moduleFor)('Basic introspection', class extends _internalTestHelpers.AbstractTestCase {\n beforeEach() {\n obj = {};\n (0, _metal.mixin)(obj, PrivateProperty, PublicProperty, PrivateMethod, PublicMethod, Combined);\n }\n\n ['@test Ember.mixins()'](assert) {\n function mapGuids(ary) {\n return ary.map(x => (0, _utils.guidFor)(x));\n }\n\n assert.deepEqual(mapGuids(_metal.Mixin.mixins(obj)), mapGuids([PrivateProperty, PublicProperty, PrivateMethod, PublicMethod, Combined, BarProperties, BarMethods]), 'should return included mixins');\n }\n\n ['@test setting a NAME_KEY on a mixin does not error'](assert) {\n assert.expect(0);\n\n let instance = _metal.Mixin.create();\n instance[_utils.NAME_KEY] = 'My special name!';\n }\n\n ['@test setting a NAME_KEY on a mixin instance does not error'](assert) {\n assert.expect(0);\n\n _metal.Mixin.create({ [_utils.NAME_KEY]: 'My special name' });\n }\n });\n});","enifed('@ember/-internals/metal/tests/mixin/merged_properties_test', ['@ember/-internals/runtime', '@ember/-internals/metal', 'internal-test-helpers'], function (_runtime, _metal, _internalTestHelpers) {\n 'use strict';\n\n (0, _internalTestHelpers.moduleFor)('Mixin mergedProperties', class extends _internalTestHelpers.AbstractTestCase {\n ['@test defining mergedProperties should merge future version'](assert) {\n let MixinA = _metal.Mixin.create({\n mergedProperties: ['foo'],\n foo: { a: true, b: true, c: true }\n });\n\n let MixinB = _metal.Mixin.create({\n foo: { d: true, e: true, f: true }\n });\n\n let obj = (0, _metal.mixin)({}, MixinA, MixinB);\n assert.deepEqual((0, _metal.get)(obj, 'foo'), {\n a: true,\n b: true,\n c: true,\n d: true,\n e: true,\n f: true\n });\n }\n\n ['@test defining mergedProperties on future mixin should merged into past'](assert) {\n let MixinA = _metal.Mixin.create({\n foo: { a: true, b: true, c: true }\n });\n\n let MixinB = _metal.Mixin.create({\n mergedProperties: ['foo'],\n foo: { d: true, e: true, f: true }\n });\n\n let obj = (0, _metal.mixin)({}, MixinA, MixinB);\n assert.deepEqual((0, _metal.get)(obj, 'foo'), {\n a: true,\n b: true,\n c: true,\n d: true,\n e: true,\n f: true\n });\n }\n\n ['@test defining mergedProperties with null properties should keep properties null'](assert) {\n let MixinA = _metal.Mixin.create({\n mergedProperties: ['foo'],\n foo: null\n });\n\n let MixinB = _metal.Mixin.create({\n foo: null\n });\n\n let obj = (0, _metal.mixin)({}, MixinA, MixinB);\n assert.equal((0, _metal.get)(obj, 'foo'), null);\n }\n\n [\"@test mergedProperties' properties can get overwritten\"](assert) {\n let MixinA = _metal.Mixin.create({\n mergedProperties: ['foo'],\n foo: { a: 1 }\n });\n\n let MixinB = _metal.Mixin.create({\n foo: { a: 2 }\n });\n\n let obj = (0, _metal.mixin)({}, MixinA, MixinB);\n assert.deepEqual((0, _metal.get)(obj, 'foo'), { a: 2 });\n }\n\n ['@test mergedProperties should be concatenated'](assert) {\n let MixinA = _metal.Mixin.create({\n mergedProperties: ['foo'],\n foo: { a: true, b: true, c: true }\n });\n\n let MixinB = _metal.Mixin.create({\n mergedProperties: 'bar',\n foo: { d: true, e: true, f: true },\n bar: { a: true, l: true }\n });\n\n let MixinC = _metal.Mixin.create({\n bar: { e: true, x: true }\n });\n\n let obj = (0, _metal.mixin)({}, MixinA, MixinB, MixinC);\n assert.deepEqual((0, _metal.get)(obj, 'mergedProperties'), ['foo', 'bar'], 'get mergedProperties');\n assert.deepEqual((0, _metal.get)(obj, 'foo'), { a: true, b: true, c: true, d: true, e: true, f: true }, 'get foo');\n assert.deepEqual((0, _metal.get)(obj, 'bar'), { a: true, l: true, e: true, x: true }, 'get bar');\n }\n\n ['@test mergedProperties should exist even if not explicitly set on create'](assert) {\n let AnObj = _runtime.Object.extend({\n mergedProperties: ['options'],\n options: {\n a: 'a',\n b: {\n c: 'ccc'\n }\n }\n });\n\n let obj = AnObj.create({\n options: {\n a: 'A'\n }\n });\n\n assert.equal((0, _metal.get)(obj, 'options').a, 'A');\n assert.equal((0, _metal.get)(obj, 'options').b.c, 'ccc');\n }\n\n ['@test defining mergedProperties at create time should not modify the prototype'](assert) {\n let AnObj = _runtime.Object.extend({\n mergedProperties: ['options'],\n options: {\n a: 1\n }\n });\n\n let objA = AnObj.create({\n options: {\n a: 2\n }\n });\n let objB = AnObj.create({\n options: {\n a: 3\n }\n });\n\n assert.equal((0, _metal.get)(objA, 'options').a, 2);\n assert.equal((0, _metal.get)(objB, 'options').a, 3);\n }\n\n [\"@test mergedProperties' overwriting methods can call _super\"](assert) {\n assert.expect(4);\n\n let MixinA = _metal.Mixin.create({\n mergedProperties: ['foo'],\n foo: {\n meth(a) {\n assert.equal(a, 'WOOT', \"_super successfully called MixinA's `foo.meth` method\");\n return 'WAT';\n }\n }\n });\n\n let MixinB = _metal.Mixin.create({\n foo: {\n meth() {\n assert.ok(true, \"MixinB's `foo.meth` method called\");\n return this._super(...arguments);\n }\n }\n });\n\n let MixinC = _metal.Mixin.create({\n foo: {\n meth(a) {\n assert.ok(true, \"MixinC's `foo.meth` method called\");\n return this._super(a);\n }\n }\n });\n\n let obj = (0, _metal.mixin)({}, MixinA, MixinB, MixinC);\n assert.equal(obj.foo.meth('WOOT'), 'WAT');\n }\n\n ['@test Merging an Array should raise an error'](assert) {\n assert.expect(1);\n\n let MixinA = _metal.Mixin.create({\n mergedProperties: ['foo'],\n foo: { a: true, b: true, c: true }\n });\n\n let MixinB = _metal.Mixin.create({\n foo: ['a']\n });\n\n expectAssertion(() => {\n (0, _metal.mixin)({}, MixinA, MixinB);\n }, 'You passed in `[\"a\"]` as the value for `foo` but `foo` cannot be an Array');\n }\n });\n});","enifed('@ember/-internals/metal/tests/mixin/method_test', ['@ember/-internals/metal', 'internal-test-helpers'], function (_metal, _internalTestHelpers) {\n 'use strict';\n\n (0, _internalTestHelpers.moduleFor)('Mixin Methods', class extends _internalTestHelpers.AbstractTestCase {\n ['@test defining simple methods'](assert) {\n let MixinA, obj, props;\n\n props = {\n publicMethod() {\n return 'publicMethod';\n },\n _privateMethod() {\n return 'privateMethod';\n }\n };\n\n MixinA = _metal.Mixin.create(props);\n obj = {};\n MixinA.apply(obj);\n\n // but should be defined\n assert.equal(props.publicMethod(), 'publicMethod', 'publicMethod is func');\n assert.equal(props._privateMethod(), 'privateMethod', 'privateMethod is func');\n }\n\n ['@test overriding public methods'](assert) {\n let MixinA, MixinB, MixinD, MixinF, obj;\n\n MixinA = _metal.Mixin.create({\n publicMethod() {\n return 'A';\n }\n });\n\n MixinB = _metal.Mixin.create(MixinA, {\n publicMethod() {\n return this._super(...arguments) + 'B';\n }\n });\n\n MixinD = _metal.Mixin.create(MixinA, {\n publicMethod() {\n return this._super(...arguments) + 'D';\n }\n });\n\n MixinF = _metal.Mixin.create({\n publicMethod() {\n return this._super(...arguments) + 'F';\n }\n });\n\n obj = {};\n MixinB.apply(obj);\n assert.equal(obj.publicMethod(), 'AB', 'should define super for A and B');\n\n obj = {};\n MixinD.apply(obj);\n assert.equal(obj.publicMethod(), 'AD', 'should define super for A and B');\n\n obj = {};\n MixinA.apply(obj);\n MixinF.apply(obj);\n assert.equal(obj.publicMethod(), 'AF', 'should define super for A and F');\n\n obj = {\n publicMethod() {\n return 'obj';\n }\n };\n MixinF.apply(obj);\n assert.equal(obj.publicMethod(), 'objF', 'should define super for F');\n }\n\n ['@test overriding inherited objects'](assert) {\n let cnt = 0;\n let MixinA = _metal.Mixin.create({\n foo() {\n cnt++;\n }\n });\n\n let MixinB = _metal.Mixin.create({\n foo() {\n this._super(...arguments);\n cnt++;\n }\n });\n\n let objA = {};\n MixinA.apply(objA);\n\n let objB = Object.create(objA);\n MixinB.apply(objB);\n\n cnt = 0;\n objB.foo();\n assert.equal(cnt, 2, 'should invoke both methods');\n\n cnt = 0;\n objA.foo();\n assert.equal(cnt, 1, 'should not screw w/ parent obj');\n }\n\n ['@test Including the same mixin more than once will only run once'](assert) {\n let cnt = 0;\n let MixinA = _metal.Mixin.create({\n foo() {\n cnt++;\n }\n });\n\n let MixinB = _metal.Mixin.create(MixinA, {\n foo() {\n this._super(...arguments);\n }\n });\n\n let MixinC = _metal.Mixin.create(MixinA, {\n foo() {\n this._super(...arguments);\n }\n });\n\n let MixinD = _metal.Mixin.create(MixinB, MixinC, MixinA, {\n foo() {\n this._super(...arguments);\n }\n });\n\n let obj = {};\n MixinD.apply(obj);\n MixinA.apply(obj); // try to apply again..\n\n cnt = 0;\n obj.foo();\n\n assert.equal(cnt, 1, 'should invoke MixinA.foo one time');\n }\n\n ['@test _super from a single mixin with no superclass does not error'](assert) {\n let MixinA = _metal.Mixin.create({\n foo() {\n this._super(...arguments);\n }\n });\n\n let obj = {};\n MixinA.apply(obj);\n\n obj.foo();\n assert.ok(true);\n }\n\n ['@test _super from a first-of-two mixins with no superclass function does not error'](assert) {\n // _super was previously calling itself in the second assertion.\n // Use remaining count of calls to ensure it doesn't loop indefinitely.\n let remaining = 3;\n let MixinA = _metal.Mixin.create({\n foo() {\n if (remaining-- > 0) {\n this._super(...arguments);\n }\n }\n });\n\n let MixinB = _metal.Mixin.create({\n foo() {\n this._super(...arguments);\n }\n });\n\n let obj = {};\n MixinA.apply(obj);\n MixinB.apply(obj);\n\n obj.foo();\n assert.ok(true);\n }\n });\n\n // ..........................................................\n // CONFLICTS\n //\n (0, _internalTestHelpers.moduleFor)('Method Conflicts', class extends _internalTestHelpers.AbstractTestCase {\n ['@test overriding toString'](assert) {\n let MixinA = _metal.Mixin.create({\n toString() {\n return 'FOO';\n }\n });\n\n let obj = {};\n MixinA.apply(obj);\n assert.equal(obj.toString(), 'FOO', 'should override toString w/o error');\n\n obj = {};\n (0, _metal.mixin)(obj, {\n toString() {\n return 'FOO';\n }\n });\n assert.equal(obj.toString(), 'FOO', 'should override toString w/o error');\n }\n });\n\n // ..........................................................\n // BUGS\n //\n (0, _internalTestHelpers.moduleFor)('system/mixin/method_test BUGS', class extends _internalTestHelpers.AbstractTestCase {\n ['@test applying several mixins at once with sup already defined causes infinite loop'](assert) {\n let cnt = 0;\n let MixinA = _metal.Mixin.create({\n foo() {\n cnt++;\n }\n });\n\n let MixinB = _metal.Mixin.create({\n foo() {\n this._super(...arguments);\n cnt++;\n }\n });\n\n let MixinC = _metal.Mixin.create({\n foo() {\n this._super(...arguments);\n cnt++;\n }\n });\n\n let obj = {};\n (0, _metal.mixin)(obj, MixinA); // sup already exists\n (0, _metal.mixin)(obj, MixinB, MixinC); // must be more than one mixin\n\n cnt = 0;\n obj.foo();\n assert.equal(cnt, 3, 'should invoke all 3 methods');\n }\n });\n});","enifed('@ember/-internals/metal/tests/mixin/observer_test', ['@ember/-internals/metal', 'internal-test-helpers'], function (_metal, _internalTestHelpers) {\n 'use strict';\n\n (0, _internalTestHelpers.moduleFor)('Mixin observer', class extends _internalTestHelpers.AbstractTestCase {\n ['@test global observer helper'](assert) {\n let MyMixin = _metal.Mixin.create({\n count: 0,\n\n foo: (0, _metal.observer)('bar', function () {\n (0, _metal.set)(this, 'count', (0, _metal.get)(this, 'count') + 1);\n })\n });\n\n let obj = (0, _metal.mixin)({}, MyMixin);\n assert.equal((0, _metal.get)(obj, 'count'), 0, 'should not invoke observer immediately');\n\n (0, _metal.set)(obj, 'bar', 'BAZ');\n assert.equal((0, _metal.get)(obj, 'count'), 1, 'should invoke observer after change');\n }\n\n ['@test global observer helper takes multiple params'](assert) {\n let MyMixin = _metal.Mixin.create({\n count: 0,\n\n foo: (0, _metal.observer)('bar', 'baz', function () {\n (0, _metal.set)(this, 'count', (0, _metal.get)(this, 'count') + 1);\n })\n });\n\n let obj = (0, _metal.mixin)({}, MyMixin);\n assert.equal((0, _metal.get)(obj, 'count'), 0, 'should not invoke observer immediately');\n\n (0, _metal.set)(obj, 'bar', 'BAZ');\n (0, _metal.set)(obj, 'baz', 'BAZ');\n assert.equal((0, _metal.get)(obj, 'count'), 2, 'should invoke observer after change');\n }\n\n ['@test replacing observer should remove old observer'](assert) {\n let MyMixin = _metal.Mixin.create({\n count: 0,\n\n foo: (0, _metal.observer)('bar', function () {\n (0, _metal.set)(this, 'count', (0, _metal.get)(this, 'count') + 1);\n })\n });\n\n let Mixin2 = _metal.Mixin.create({\n foo: (0, _metal.observer)('baz', function () {\n (0, _metal.set)(this, 'count', (0, _metal.get)(this, 'count') + 10);\n })\n });\n\n let obj = (0, _metal.mixin)({}, MyMixin, Mixin2);\n assert.equal((0, _metal.get)(obj, 'count'), 0, 'should not invoke observer immediately');\n\n (0, _metal.set)(obj, 'bar', 'BAZ');\n assert.equal((0, _metal.get)(obj, 'count'), 0, 'should not invoke observer after change');\n\n (0, _metal.set)(obj, 'baz', 'BAZ');\n assert.equal((0, _metal.get)(obj, 'count'), 10, 'should invoke observer after change');\n }\n\n ['@test observing chain with property before'](assert) {\n let obj2 = { baz: 'baz' };\n\n let MyMixin = _metal.Mixin.create({\n count: 0,\n bar: obj2,\n foo: (0, _metal.observer)('bar.baz', function () {\n (0, _metal.set)(this, 'count', (0, _metal.get)(this, 'count') + 1);\n })\n });\n\n let obj = (0, _metal.mixin)({}, MyMixin);\n assert.equal((0, _metal.get)(obj, 'count'), 0, 'should not invoke observer immediately');\n\n (0, _metal.set)(obj2, 'baz', 'BAZ');\n assert.equal((0, _metal.get)(obj, 'count'), 1, 'should invoke observer after change');\n }\n\n ['@test observing chain with property after'](assert) {\n let obj2 = { baz: 'baz' };\n\n let MyMixin = _metal.Mixin.create({\n count: 0,\n foo: (0, _metal.observer)('bar.baz', function () {\n (0, _metal.set)(this, 'count', (0, _metal.get)(this, 'count') + 1);\n }),\n bar: obj2\n });\n\n let obj = (0, _metal.mixin)({}, MyMixin);\n assert.equal((0, _metal.get)(obj, 'count'), 0, 'should not invoke observer immediately');\n\n (0, _metal.set)(obj2, 'baz', 'BAZ');\n assert.equal((0, _metal.get)(obj, 'count'), 1, 'should invoke observer after change');\n }\n\n ['@test observing chain with property in mixin applied later'](assert) {\n let obj2 = { baz: 'baz' };\n\n let MyMixin = _metal.Mixin.create({\n count: 0,\n foo: (0, _metal.observer)('bar.baz', function () {\n (0, _metal.set)(this, 'count', (0, _metal.get)(this, 'count') + 1);\n })\n });\n\n let MyMixin2 = _metal.Mixin.create({ bar: obj2 });\n\n let obj = (0, _metal.mixin)({}, MyMixin);\n assert.equal((0, _metal.get)(obj, 'count'), 0, 'should not invoke observer immediately');\n\n MyMixin2.apply(obj);\n assert.equal((0, _metal.get)(obj, 'count'), 0, 'should not invoke observer immediately');\n\n (0, _metal.set)(obj2, 'baz', 'BAZ');\n assert.equal((0, _metal.get)(obj, 'count'), 1, 'should invoke observer after change');\n }\n\n ['@test observing chain with existing property'](assert) {\n let obj2 = { baz: 'baz' };\n\n let MyMixin = _metal.Mixin.create({\n count: 0,\n foo: (0, _metal.observer)('bar.baz', function () {\n (0, _metal.set)(this, 'count', (0, _metal.get)(this, 'count') + 1);\n })\n });\n\n let obj = (0, _metal.mixin)({ bar: obj2 }, MyMixin);\n assert.equal((0, _metal.get)(obj, 'count'), 0, 'should not invoke observer immediately');\n\n (0, _metal.set)(obj2, 'baz', 'BAZ');\n assert.equal((0, _metal.get)(obj, 'count'), 1, 'should invoke observer after change');\n }\n\n ['@test observing chain with property in mixin before'](assert) {\n let obj2 = { baz: 'baz' };\n let MyMixin2 = _metal.Mixin.create({ bar: obj2 });\n\n let MyMixin = _metal.Mixin.create({\n count: 0,\n foo: (0, _metal.observer)('bar.baz', function () {\n (0, _metal.set)(this, 'count', (0, _metal.get)(this, 'count') + 1);\n })\n });\n\n let obj = (0, _metal.mixin)({}, MyMixin2, MyMixin);\n assert.equal((0, _metal.get)(obj, 'count'), 0, 'should not invoke observer immediately');\n\n (0, _metal.set)(obj2, 'baz', 'BAZ');\n assert.equal((0, _metal.get)(obj, 'count'), 1, 'should invoke observer after change');\n }\n\n ['@test observing chain with property in mixin after'](assert) {\n let obj2 = { baz: 'baz' };\n let MyMixin2 = _metal.Mixin.create({ bar: obj2 });\n\n let MyMixin = _metal.Mixin.create({\n count: 0,\n foo: (0, _metal.observer)('bar.baz', function () {\n (0, _metal.set)(this, 'count', (0, _metal.get)(this, 'count') + 1);\n })\n });\n\n let obj = (0, _metal.mixin)({}, MyMixin, MyMixin2);\n assert.equal((0, _metal.get)(obj, 'count'), 0, 'should not invoke observer immediately');\n\n (0, _metal.set)(obj2, 'baz', 'BAZ');\n assert.equal((0, _metal.get)(obj, 'count'), 1, 'should invoke observer after change');\n }\n\n ['@test observing chain with overridden property'](assert) {\n let obj2 = { baz: 'baz' };\n let obj3 = { baz: 'foo' };\n\n let MyMixin2 = _metal.Mixin.create({ bar: obj3 });\n\n let MyMixin = _metal.Mixin.create({\n count: 0,\n foo: (0, _metal.observer)('bar.baz', function () {\n (0, _metal.set)(this, 'count', (0, _metal.get)(this, 'count') + 1);\n })\n });\n\n let obj = (0, _metal.mixin)({ bar: obj2 }, MyMixin, MyMixin2);\n assert.equal((0, _metal.get)(obj, 'count'), 0, 'should not invoke observer immediately');\n\n assert.equal((0, _metal.isWatching)(obj2, 'baz'), false, 'should not be watching baz');\n assert.equal((0, _metal.isWatching)(obj3, 'baz'), true, 'should be watching baz');\n\n (0, _metal.set)(obj2, 'baz', 'BAZ');\n assert.equal((0, _metal.get)(obj, 'count'), 0, 'should not invoke observer after change');\n\n (0, _metal.set)(obj3, 'baz', 'BEAR');\n assert.equal((0, _metal.get)(obj, 'count'), 1, 'should invoke observer after change');\n }\n });\n});","enifed('@ember/-internals/metal/tests/mixin/reopen_test', ['@ember/-internals/runtime', '@ember/-internals/metal', '@ember/runloop', 'internal-test-helpers'], function (_runtime, _metal, _runloop, _internalTestHelpers) {\n 'use strict';\n\n (0, _internalTestHelpers.moduleFor)('Mixin#reopen', class extends _internalTestHelpers.AbstractTestCase {\n ['@test using reopen() to add more properties to a simple'](assert) {\n let MixinA = _metal.Mixin.create({ foo: 'FOO', baz: 'BAZ' });\n MixinA.reopen({ bar: 'BAR', foo: 'FOO2' });\n let obj = {};\n MixinA.apply(obj);\n\n assert.equal((0, _metal.get)(obj, 'foo'), 'FOO2', 'mixin() should override');\n assert.equal((0, _metal.get)(obj, 'baz'), 'BAZ', 'preserve MixinA props');\n assert.equal((0, _metal.get)(obj, 'bar'), 'BAR', 'include MixinB props');\n }\n\n ['@test using reopen() and calling _super where there is not a super function does not cause infinite recursion'](assert) {\n let Taco = _runtime.Object.extend({\n createBreakfast() {\n // There is no original createBreakfast function.\n // Calling the wrapped _super function here\n // used to end in an infinite call loop\n this._super(...arguments);\n return 'Breakfast!';\n }\n });\n\n Taco.reopen({\n createBreakfast() {\n return this._super(...arguments);\n }\n });\n\n let taco = Taco.create();\n\n let result;\n (0, _runloop.run)(() => {\n try {\n result = taco.createBreakfast();\n } catch (e) {\n result = 'Your breakfast was interrupted by an infinite stack error.';\n }\n });\n\n assert.equal(result, 'Breakfast!');\n }\n });\n});","enifed('@ember/-internals/metal/tests/mixin/without_test', ['@ember/-internals/metal', 'internal-test-helpers'], function (_metal, _internalTestHelpers) {\n 'use strict';\n\n (0, _internalTestHelpers.moduleFor)('without', class extends _internalTestHelpers.AbstractTestCase {\n ['@test without should create a new mixin excluding named properties'](assert) {\n let MixinA = _metal.Mixin.create({\n foo: 'FOO',\n bar: 'BAR'\n });\n\n let MixinB = MixinA.without('bar');\n\n let obj = {};\n MixinB.apply(obj);\n\n assert.equal(obj.foo, 'FOO', 'should defined foo');\n assert.equal(obj.bar, undefined, 'should not define bar');\n }\n });\n});","enifed('@ember/-internals/metal/tests/namespace_search_test', ['@ember/-internals/metal', 'internal-test-helpers'], function (_metal, _internalTestHelpers) {\n 'use strict';\n\n (0, _internalTestHelpers.moduleFor)('NamespaceSearch', class extends _internalTestHelpers.AbstractTestCase {\n ['@test classToString: null as this inside class must not throw error'](assert) {\n let mixin = _metal.Mixin.create();\n assert.equal(mixin.toString(), '(unknown)', 'this = null should be handled on Mixin.toString() call');\n }\n });\n});","enifed('@ember/-internals/metal/tests/observer_test', ['@ember/-internals/environment', '@ember/-internals/metal', 'internal-test-helpers'], function (_environment, _metal, _internalTestHelpers) {\n 'use strict';\n\n function K() {}\n\n // ..........................................................\n // ADD OBSERVER\n //\n\n (0, _internalTestHelpers.moduleFor)('addObserver', class extends _internalTestHelpers.AbstractTestCase {\n ['@test observer should assert to invalid input']() {\n expectAssertion(() => {\n (0, _metal.observer)(() => {});\n }, 'observer called without valid path');\n\n expectAssertion(() => {\n (0, _metal.observer)(null);\n }, 'observer called without a function');\n }\n\n ['@test observer should fire when property is modified'](assert) {\n let obj = {};\n let count = 0;\n\n (0, _metal.addObserver)(obj, 'foo', function () {\n assert.equal((0, _metal.get)(obj, 'foo'), 'bar', 'should invoke AFTER value changed');\n count++;\n });\n\n (0, _metal.set)(obj, 'foo', 'bar');\n assert.equal(count, 1, 'should have invoked observer');\n }\n\n ['@test observer should fire when dependent property is modified'](assert) {\n let obj = { bar: 'bar' };\n (0, _metal.defineProperty)(obj, 'foo', (0, _metal.computed)(function () {\n return (0, _metal.get)(this, 'bar').toUpperCase();\n }).property('bar'));\n\n (0, _metal.get)(obj, 'foo');\n\n let count = 0;\n (0, _metal.addObserver)(obj, 'foo', function () {\n assert.equal((0, _metal.get)(obj, 'foo'), 'BAZ', 'should have invoked after prop change');\n count++;\n });\n\n (0, _metal.set)(obj, 'bar', 'baz');\n assert.equal(count, 1, 'should have invoked observer');\n }\n\n ['@test observer should continue to fire after dependent properties are accessed'](assert) {\n let observerCount = 0;\n let obj = {};\n\n (0, _metal.defineProperty)(obj, 'prop', (0, _metal.computed)(function () {\n return Math.random();\n }));\n (0, _metal.defineProperty)(obj, 'anotherProp', (0, _metal.computed)('prop', function () {\n return (0, _metal.get)(this, 'prop') + Math.random();\n }));\n\n (0, _metal.addObserver)(obj, 'prop', function () {\n observerCount++;\n });\n\n (0, _metal.get)(obj, 'anotherProp');\n\n for (let i = 0; i < 10; i++) {\n (0, _metal.notifyPropertyChange)(obj, 'prop');\n }\n\n assert.equal(observerCount, 10, 'should continue to fire indefinitely');\n }\n\n ['@test observer added declaratively via brace expansion should fire when property changes'](assert) {\n if (_environment.ENV.EXTEND_PROTOTYPES.Function) {\n let obj = {};\n let count = 0;\n\n (0, _metal.mixin)(obj, {\n observeFooAndBar: function () {\n count++;\n }.observes('{foo,bar}')\n });\n\n (0, _metal.set)(obj, 'foo', 'foo');\n assert.equal(count, 1, 'observer specified via brace expansion invoked on property change');\n\n (0, _metal.set)(obj, 'bar', 'bar');\n assert.equal(count, 2, 'observer specified via brace expansion invoked on property change');\n\n (0, _metal.set)(obj, 'baz', 'baz');\n assert.equal(count, 2, 'observer not invoked on unspecified property');\n } else {\n assert.expect(0);\n }\n }\n\n ['@test observer specified declaratively via brace expansion should fire when dependent property changes'](assert) {\n if (_environment.ENV.EXTEND_PROTOTYPES.Function) {\n let obj = { baz: 'Initial' };\n let count = 0;\n\n (0, _metal.defineProperty)(obj, 'foo', (0, _metal.computed)(function () {\n return (0, _metal.get)(this, 'bar').toLowerCase();\n }).property('bar'));\n\n (0, _metal.defineProperty)(obj, 'bar', (0, _metal.computed)(function () {\n return (0, _metal.get)(this, 'baz').toUpperCase();\n }).property('baz'));\n\n (0, _metal.mixin)(obj, {\n fooAndBarWatcher: function () {\n count++;\n }.observes('{foo,bar}')\n });\n\n (0, _metal.get)(obj, 'foo');\n (0, _metal.set)(obj, 'baz', 'Baz');\n // fire once for foo, once for bar\n assert.equal(count, 2, 'observer specified via brace expansion invoked on dependent property change');\n\n (0, _metal.set)(obj, 'quux', 'Quux');\n assert.equal(count, 2, 'observer not fired on unspecified property');\n } else {\n assert.expect(0);\n }\n }\n\n ['@test observers watching multiple properties via brace expansion should fire when the properties change'](assert) {\n let obj = {};\n let count = 0;\n\n (0, _metal.mixin)(obj, {\n observeFooAndBar: (0, _metal.observer)('{foo,bar}', function () {\n count++;\n })\n });\n\n (0, _metal.set)(obj, 'foo', 'foo');\n assert.equal(count, 1, 'observer specified via brace expansion invoked on property change');\n\n (0, _metal.set)(obj, 'bar', 'bar');\n assert.equal(count, 2, 'observer specified via brace expansion invoked on property change');\n\n (0, _metal.set)(obj, 'baz', 'baz');\n assert.equal(count, 2, 'observer not invoked on unspecified property');\n }\n\n ['@test observers watching multiple properties via brace expansion should fire when dependent properties change'](assert) {\n let obj = { baz: 'Initial' };\n let count = 0;\n\n (0, _metal.defineProperty)(obj, 'foo', (0, _metal.computed)(function () {\n return (0, _metal.get)(this, 'bar').toLowerCase();\n }).property('bar'));\n\n (0, _metal.defineProperty)(obj, 'bar', (0, _metal.computed)(function () {\n return (0, _metal.get)(this, 'baz').toUpperCase();\n }).property('baz'));\n\n (0, _metal.mixin)(obj, {\n fooAndBarWatcher: (0, _metal.observer)('{foo,bar}', function () {\n count++;\n })\n });\n\n (0, _metal.get)(obj, 'foo');\n (0, _metal.set)(obj, 'baz', 'Baz');\n // fire once for foo, once for bar\n assert.equal(count, 2, 'observer specified via brace expansion invoked on dependent property change');\n\n (0, _metal.set)(obj, 'quux', 'Quux');\n assert.equal(count, 2, 'observer not fired on unspecified property');\n }\n\n ['@test nested observers should fire in order'](assert) {\n let obj = { foo: 'foo', bar: 'bar' };\n let fooCount = 0;\n let barCount = 0;\n\n (0, _metal.addObserver)(obj, 'foo', function () {\n fooCount++;\n });\n (0, _metal.addObserver)(obj, 'bar', function () {\n (0, _metal.set)(obj, 'foo', 'BAZ');\n assert.equal(fooCount, 1, 'fooCount should have fired already');\n barCount++;\n });\n\n (0, _metal.set)(obj, 'bar', 'BIFF');\n assert.equal(barCount, 1, 'barCount should have fired');\n assert.equal(fooCount, 1, 'foo should have fired');\n }\n\n ['@test removing an chain observer on change should not fail'](assert) {\n let foo = { bar: 'bar' };\n let obj1 = { foo: foo };\n let obj2 = { foo: foo };\n let obj3 = { foo: foo };\n let obj4 = { foo: foo };\n let count1 = 0;\n let count2 = 0;\n let count3 = 0;\n let count4 = 0;\n\n function observer1() {\n count1++;\n }\n function observer2() {\n count2++;\n }\n function observer3() {\n count3++;\n (0, _metal.removeObserver)(obj1, 'foo.bar', observer1);\n (0, _metal.removeObserver)(obj2, 'foo.bar', observer2);\n (0, _metal.removeObserver)(obj4, 'foo.bar', observer4);\n }\n function observer4() {\n count4++;\n }\n\n (0, _metal.addObserver)(obj1, 'foo.bar', observer1);\n (0, _metal.addObserver)(obj2, 'foo.bar', observer2);\n (0, _metal.addObserver)(obj3, 'foo.bar', observer3);\n (0, _metal.addObserver)(obj4, 'foo.bar', observer4);\n\n (0, _metal.set)(foo, 'bar', 'baz');\n\n assert.equal(count1, 1, 'observer1 fired');\n assert.equal(count2, 1, 'observer2 fired');\n assert.equal(count3, 1, 'observer3 fired');\n assert.equal(count4, 0, 'observer4 did not fire');\n }\n\n ['@test deferring property change notifications'](assert) {\n let obj = { foo: 'foo' };\n let fooCount = 0;\n\n (0, _metal.addObserver)(obj, 'foo', function () {\n fooCount++;\n });\n\n (0, _metal.beginPropertyChanges)();\n (0, _metal.set)(obj, 'foo', 'BIFF');\n (0, _metal.set)(obj, 'foo', 'BAZ');\n (0, _metal.endPropertyChanges)();\n\n assert.equal(fooCount, 1, 'foo should have fired once');\n }\n\n ['@test deferring property change notifications safely despite exceptions'](assert) {\n let obj = { foo: 'foo' };\n let fooCount = 0;\n let exc = new Error('Something unexpected happened!');\n\n assert.expect(2);\n (0, _metal.addObserver)(obj, 'foo', function () {\n fooCount++;\n });\n\n try {\n (0, _metal.changeProperties)(function () {\n (0, _metal.set)(obj, 'foo', 'BIFF');\n (0, _metal.set)(obj, 'foo', 'BAZ');\n throw exc;\n });\n } catch (err) {\n if (err !== exc) {\n throw err;\n }\n }\n\n assert.equal(fooCount, 1, 'foo should have fired once');\n\n (0, _metal.changeProperties)(function () {\n (0, _metal.set)(obj, 'foo', 'BIFF2');\n (0, _metal.set)(obj, 'foo', 'BAZ2');\n });\n\n assert.equal(fooCount, 2, 'foo should have fired again once');\n }\n\n ['@test addObserver should propagate through prototype'](assert) {\n let obj = { foo: 'foo', count: 0 };\n let obj2;\n\n (0, _metal.addObserver)(obj, 'foo', function () {\n this.count++;\n });\n obj2 = Object.create(obj);\n\n (0, _metal.set)(obj2, 'foo', 'bar');\n\n assert.equal(obj2.count, 1, 'should have invoked observer on inherited');\n assert.equal(obj.count, 0, 'should not have invoked observer on parent');\n\n obj2.count = 0;\n (0, _metal.set)(obj, 'foo', 'baz');\n assert.equal(obj.count, 0, 'should not have invoked observer on parent');\n assert.equal(obj2.count, 0, 'should not have invoked observer on inherited');\n }\n\n ['@test addObserver should respect targets with methods'](assert) {\n let observed = { foo: 'foo' };\n\n let target1 = {\n count: 0,\n\n didChange(obj, keyName) {\n let value = (0, _metal.get)(obj, keyName);\n assert.equal(this, target1, 'should invoke with this');\n assert.equal(obj, observed, 'param1 should be observed object');\n assert.equal(keyName, 'foo', 'param2 should be keyName');\n assert.equal(value, 'BAZ', 'param3 should new value');\n this.count++;\n }\n };\n\n let target2 = {\n count: 0,\n\n didChange(obj, keyName) {\n let value = (0, _metal.get)(obj, keyName);\n assert.equal(this, target2, 'should invoke with this');\n assert.equal(obj, observed, 'param1 should be observed object');\n assert.equal(keyName, 'foo', 'param2 should be keyName');\n assert.equal(value, 'BAZ', 'param3 should new value');\n this.count++;\n }\n };\n\n (0, _metal.addObserver)(observed, 'foo', target1, 'didChange');\n (0, _metal.addObserver)(observed, 'foo', target2, target2.didChange);\n\n (0, _metal.set)(observed, 'foo', 'BAZ');\n assert.equal(target1.count, 1, 'target1 observer should have fired');\n assert.equal(target2.count, 1, 'target2 observer should have fired');\n }\n\n ['@test addObserver should allow multiple objects to observe a property'](assert) {\n let observed = { foo: 'foo' };\n\n let target1 = {\n count: 0,\n\n didChange() {\n this.count++;\n }\n };\n\n let target2 = {\n count: 0,\n\n didChange() {\n this.count++;\n }\n };\n\n (0, _metal.addObserver)(observed, 'foo', target1, 'didChange');\n (0, _metal.addObserver)(observed, 'foo', target2, 'didChange');\n\n (0, _metal.set)(observed, 'foo', 'BAZ');\n assert.equal(target1.count, 1, 'target1 observer should have fired');\n assert.equal(target2.count, 1, 'target2 observer should have fired');\n }\n });\n\n // ..........................................................\n // REMOVE OBSERVER\n //\n\n (0, _internalTestHelpers.moduleFor)('removeObserver', class extends _internalTestHelpers.AbstractTestCase {\n ['@test removing observer should stop firing'](assert) {\n let obj = {};\n let count = 0;\n function F() {\n count++;\n }\n (0, _metal.addObserver)(obj, 'foo', F);\n\n (0, _metal.set)(obj, 'foo', 'bar');\n assert.equal(count, 1, 'should have invoked observer');\n\n (0, _metal.removeObserver)(obj, 'foo', F);\n\n (0, _metal.set)(obj, 'foo', 'baz');\n assert.equal(count, 1, \"removed observer shouldn't fire\");\n }\n\n ['@test local observers can be removed'](assert) {\n let barObserved = 0;\n\n let MyMixin = _metal.Mixin.create({\n foo1: (0, _metal.observer)('bar', function () {\n barObserved++;\n }),\n\n foo2: (0, _metal.observer)('bar', function () {\n barObserved++;\n })\n });\n\n let obj = {};\n MyMixin.apply(obj);\n\n (0, _metal.set)(obj, 'bar', 'HI!');\n assert.equal(barObserved, 2, 'precond - observers should be fired');\n\n (0, _metal.removeObserver)(obj, 'bar', null, 'foo1');\n\n barObserved = 0;\n (0, _metal.set)(obj, 'bar', 'HI AGAIN!');\n\n assert.equal(barObserved, 1, 'removed observers should not be called');\n }\n\n ['@test removeObserver should respect targets with methods'](assert) {\n let observed = { foo: 'foo' };\n\n let target1 = {\n count: 0,\n\n didChange() {\n this.count++;\n }\n };\n\n let target2 = {\n count: 0,\n\n didChange() {\n this.count++;\n }\n };\n\n (0, _metal.addObserver)(observed, 'foo', target1, 'didChange');\n (0, _metal.addObserver)(observed, 'foo', target2, target2.didChange);\n\n (0, _metal.set)(observed, 'foo', 'BAZ');\n assert.equal(target1.count, 1, 'target1 observer should have fired');\n assert.equal(target2.count, 1, 'target2 observer should have fired');\n\n (0, _metal.removeObserver)(observed, 'foo', target1, 'didChange');\n (0, _metal.removeObserver)(observed, 'foo', target2, target2.didChange);\n\n target1.count = target2.count = 0;\n (0, _metal.set)(observed, 'foo', 'BAZ');\n assert.equal(target1.count, 0, 'target1 observer should not fire again');\n assert.equal(target2.count, 0, 'target2 observer should not fire again');\n }\n });\n\n // ..........................................................\n // CHAINED OBSERVERS\n //\n\n let obj, count;\n\n (0, _internalTestHelpers.moduleFor)('addObserver - dependentkey with chained properties', class extends _internalTestHelpers.AbstractTestCase {\n beforeEach() {\n obj = {\n foo: {\n bar: {\n baz: {\n biff: 'BIFF'\n }\n }\n },\n Capital: {\n foo: {\n bar: {\n baz: {\n biff: 'BIFF'\n }\n }\n }\n }\n };\n\n count = 0;\n }\n\n afterEach() {\n obj = count = null;\n }\n\n ['@test depending on a chain with a computed property'](assert) {\n (0, _metal.defineProperty)(obj, 'computed', (0, _metal.computed)(function () {\n return { foo: 'bar' };\n }));\n\n let changed = 0;\n (0, _metal.addObserver)(obj, 'computed.foo', function () {\n changed++;\n });\n\n assert.equal((0, _metal.getCachedValueFor)(obj, 'computed'), undefined, 'addObserver should not compute CP');\n\n (0, _metal.set)(obj, 'computed.foo', 'baz');\n\n assert.equal(changed, 1, 'should fire observer');\n }\n\n ['@test depending on a simple chain'](assert) {\n let val;\n (0, _metal.addObserver)(obj, 'foo.bar.baz.biff', function (target, key) {\n val = (0, _metal.get)(target, key);\n count++;\n });\n\n (0, _metal.set)((0, _metal.get)(obj, 'foo.bar.baz'), 'biff', 'BUZZ');\n assert.equal(val, 'BUZZ');\n assert.equal(count, 1);\n\n (0, _metal.set)((0, _metal.get)(obj, 'foo.bar'), 'baz', { biff: 'BLARG' });\n assert.equal(val, 'BLARG');\n assert.equal(count, 2);\n\n (0, _metal.set)((0, _metal.get)(obj, 'foo'), 'bar', { baz: { biff: 'BOOM' } });\n assert.equal(val, 'BOOM');\n assert.equal(count, 3);\n\n (0, _metal.set)(obj, 'foo', { bar: { baz: { biff: 'BLARG' } } });\n assert.equal(val, 'BLARG');\n assert.equal(count, 4);\n\n (0, _metal.set)((0, _metal.get)(obj, 'foo.bar.baz'), 'biff', 'BUZZ');\n assert.equal(val, 'BUZZ');\n assert.equal(count, 5);\n\n let foo = (0, _metal.get)(obj, 'foo');\n\n (0, _metal.set)(obj, 'foo', 'BOO');\n assert.equal(val, undefined);\n assert.equal(count, 6);\n\n (0, _metal.set)(foo.bar.baz, 'biff', 'BOOM');\n assert.equal(count, 6, 'should be not have invoked observer');\n }\n\n ['@test depending on a chain with a capitalized first key'](assert) {\n let val;\n\n (0, _metal.addObserver)(obj, 'Capital.foo.bar.baz.biff', function (target, key) {\n val = (0, _metal.get)(obj, key);\n count++;\n });\n\n (0, _metal.set)((0, _metal.get)(obj, 'Capital.foo.bar.baz'), 'biff', 'BUZZ');\n assert.equal(val, 'BUZZ');\n assert.equal(count, 1);\n\n (0, _metal.set)((0, _metal.get)(obj, 'Capital.foo.bar'), 'baz', { biff: 'BLARG' });\n assert.equal(val, 'BLARG');\n assert.equal(count, 2);\n\n (0, _metal.set)((0, _metal.get)(obj, 'Capital.foo'), 'bar', { baz: { biff: 'BOOM' } });\n assert.equal(val, 'BOOM');\n assert.equal(count, 3);\n\n (0, _metal.set)(obj, 'Capital.foo', { bar: { baz: { biff: 'BLARG' } } });\n assert.equal(val, 'BLARG');\n assert.equal(count, 4);\n\n (0, _metal.set)((0, _metal.get)(obj, 'Capital.foo.bar.baz'), 'biff', 'BUZZ');\n assert.equal(val, 'BUZZ');\n assert.equal(count, 5);\n\n let foo = (0, _metal.get)(obj, 'foo');\n\n (0, _metal.set)(obj, 'Capital.foo', 'BOO');\n assert.equal(val, undefined);\n assert.equal(count, 6);\n\n (0, _metal.set)(foo.bar.baz, 'biff', 'BOOM');\n assert.equal(count, 6, 'should be not have invoked observer');\n }\n });\n\n // ..........................................................\n // SETTING IDENTICAL VALUES\n //\n\n (0, _internalTestHelpers.moduleFor)('props/observer_test - setting identical values', class extends _internalTestHelpers.AbstractTestCase {\n ['@test setting simple prop should not trigger'](assert) {\n let obj = { foo: 'bar' };\n let count = 0;\n\n (0, _metal.addObserver)(obj, 'foo', function () {\n count++;\n });\n\n (0, _metal.set)(obj, 'foo', 'bar');\n assert.equal(count, 0, 'should not trigger observer');\n\n (0, _metal.set)(obj, 'foo', 'baz');\n assert.equal(count, 1, 'should trigger observer');\n\n (0, _metal.set)(obj, 'foo', 'baz');\n assert.equal(count, 1, 'should not trigger observer again');\n }\n\n // The issue here is when a computed property is directly set with a value, then has a\n // dependent key change (which triggers a cache expiration and recomputation), observers will\n // not be fired if the CP setter is called with the last set value.\n ['@test setting a cached computed property whose value has changed should trigger'](assert) {\n let obj = {};\n\n (0, _metal.defineProperty)(obj, 'foo', (0, _metal.computed)({\n get: function () {\n return (0, _metal.get)(this, 'baz');\n },\n set: function (key, value) {\n return value;\n }\n }).property('baz'));\n\n let count = 0;\n\n (0, _metal.addObserver)(obj, 'foo', function () {\n count++;\n });\n\n (0, _metal.set)(obj, 'foo', 'bar');\n assert.equal(count, 1);\n assert.equal((0, _metal.get)(obj, 'foo'), 'bar');\n\n (0, _metal.set)(obj, 'baz', 'qux');\n assert.equal(count, 2);\n assert.equal((0, _metal.get)(obj, 'foo'), 'qux');\n\n (0, _metal.get)(obj, 'foo');\n (0, _metal.set)(obj, 'foo', 'bar');\n assert.equal(count, 3);\n assert.equal((0, _metal.get)(obj, 'foo'), 'bar');\n }\n });\n\n (0, _internalTestHelpers.moduleFor)('changeProperties', class extends _internalTestHelpers.AbstractTestCase {\n ['@test observers added/removed during changeProperties should do the right thing.'](assert) {\n let obj = {\n foo: 0\n };\n function Observer() {\n this.didChangeCount = 0;\n }\n Observer.prototype = {\n add() {\n (0, _metal.addObserver)(obj, 'foo', this, 'didChange');\n },\n remove() {\n (0, _metal.removeObserver)(obj, 'foo', this, 'didChange');\n },\n didChange() {\n this.didChangeCount++;\n }\n };\n let addedBeforeFirstChangeObserver = new Observer();\n let addedAfterFirstChangeObserver = new Observer();\n let addedAfterLastChangeObserver = new Observer();\n let removedBeforeFirstChangeObserver = new Observer();\n let removedBeforeLastChangeObserver = new Observer();\n let removedAfterLastChangeObserver = new Observer();\n removedBeforeFirstChangeObserver.add();\n removedBeforeLastChangeObserver.add();\n removedAfterLastChangeObserver.add();\n (0, _metal.changeProperties)(function () {\n removedBeforeFirstChangeObserver.remove();\n addedBeforeFirstChangeObserver.add();\n\n (0, _metal.set)(obj, 'foo', 1);\n\n assert.equal(addedBeforeFirstChangeObserver.didChangeCount, 0, 'addObserver called before the first change is deferred');\n\n addedAfterFirstChangeObserver.add();\n removedBeforeLastChangeObserver.remove();\n\n (0, _metal.set)(obj, 'foo', 2);\n\n assert.equal(addedAfterFirstChangeObserver.didChangeCount, 0, 'addObserver called after the first change is deferred');\n\n addedAfterLastChangeObserver.add();\n removedAfterLastChangeObserver.remove();\n });\n\n assert.equal(removedBeforeFirstChangeObserver.didChangeCount, 0, 'removeObserver called before the first change sees none');\n assert.equal(addedBeforeFirstChangeObserver.didChangeCount, 1, 'addObserver called before the first change sees only 1');\n assert.equal(addedAfterFirstChangeObserver.didChangeCount, 1, 'addObserver called after the first change sees 1');\n assert.equal(addedAfterLastChangeObserver.didChangeCount, 1, 'addObserver called after the last change sees 1');\n assert.equal(removedBeforeLastChangeObserver.didChangeCount, 0, 'removeObserver called before the last change sees none');\n assert.equal(removedAfterLastChangeObserver.didChangeCount, 0, 'removeObserver called after the last change sees none');\n }\n\n ['@test calling changeProperties while executing deferred observers works correctly'](assert) {\n let obj = { foo: 0 };\n let fooDidChange = 0;\n\n (0, _metal.addObserver)(obj, 'foo', () => {\n fooDidChange++;\n (0, _metal.changeProperties)(() => {});\n });\n\n (0, _metal.changeProperties)(() => {\n (0, _metal.set)(obj, 'foo', 1);\n });\n\n assert.equal(fooDidChange, 1);\n }\n });\n\n (0, _internalTestHelpers.moduleFor)('Keys behavior with observers', class extends _internalTestHelpers.AbstractTestCase {\n ['@test should not leak properties on the prototype'](assert) {\n function Beer() {}\n Beer.prototype.type = 'ipa';\n\n let beer = new Beer();\n\n (0, _metal.addObserver)(beer, 'type', K);\n assert.deepEqual(Object.keys(beer), []);\n (0, _metal.removeObserver)(beer, 'type', K);\n }\n\n ['@test observing a non existent property'](assert) {\n function Beer() {}\n Beer.prototype.type = 'ipa';\n\n let beer = new Beer();\n\n (0, _metal.addObserver)(beer, 'brand', K);\n\n assert.deepEqual(Object.keys(beer), []);\n\n (0, _metal.set)(beer, 'brand', 'Corona');\n assert.deepEqual(Object.keys(beer), ['brand']);\n\n (0, _metal.removeObserver)(beer, 'brand', K);\n }\n\n ['@test with observers switched on and off'](assert) {\n function Beer() {}\n Beer.prototype.type = 'ipa';\n\n let beer = new Beer();\n\n (0, _metal.addObserver)(beer, 'type', K);\n (0, _metal.removeObserver)(beer, 'type', K);\n\n assert.deepEqual(Object.keys(beer), []);\n }\n\n ['@test observers switched on and off with setter in between'](assert) {\n function Beer() {}\n Beer.prototype.type = 'ipa';\n\n let beer = new Beer();\n\n (0, _metal.addObserver)(beer, 'type', K);\n (0, _metal.set)(beer, 'type', 'ale');\n (0, _metal.removeObserver)(beer, 'type', K);\n\n assert.deepEqual(Object.keys(beer), ['type']);\n }\n\n ['@test observer switched on and off and then setter'](assert) {\n function Beer() {}\n Beer.prototype.type = 'ipa';\n\n let beer = new Beer();\n\n (0, _metal.addObserver)(beer, 'type', K);\n (0, _metal.removeObserver)(beer, 'type', K);\n (0, _metal.set)(beer, 'type', 'ale');\n\n assert.deepEqual(Object.keys(beer), ['type']);\n }\n\n ['@test observers switched on and off with setter in between (observed property is not shadowing)'](assert) {\n function Beer() {}\n\n let beer = new Beer();\n (0, _metal.set)(beer, 'type', 'ale');\n assert.deepEqual(Object.keys(beer), ['type'], 'only set');\n\n let otherBeer = new Beer();\n (0, _metal.addObserver)(otherBeer, 'type', K);\n (0, _metal.set)(otherBeer, 'type', 'ale');\n assert.deepEqual(Object.keys(otherBeer), ['type'], 'addObserver -> set');\n\n let yetAnotherBeer = new Beer();\n (0, _metal.addObserver)(yetAnotherBeer, 'type', K);\n (0, _metal.set)(yetAnotherBeer, 'type', 'ale');\n (0, _metal.addObserver)(beer, 'type', K);\n (0, _metal.removeObserver)(beer, 'type', K);\n assert.deepEqual(Object.keys(yetAnotherBeer), ['type'], 'addObserver -> set -> removeObserver');\n\n let itsMyLastBeer = new Beer();\n (0, _metal.set)(itsMyLastBeer, 'type', 'ale');\n (0, _metal.addObserver)(beer, 'type', K);\n (0, _metal.removeObserver)(beer, 'type', K);\n assert.deepEqual(Object.keys(itsMyLastBeer), ['type'], 'set -> removeObserver');\n }\n\n ['@test observers switched on and off with setter in between (observed property is shadowing one on the prototype)'](assert) {\n function Beer() {}\n Beer.prototype.type = 'ipa';\n\n let beer = new Beer();\n (0, _metal.set)(beer, 'type', 'ale');\n assert.deepEqual(Object.keys(beer), ['type'], 'after set');\n\n let otherBeer = new Beer();\n (0, _metal.addObserver)(otherBeer, 'type', K);\n (0, _metal.set)(otherBeer, 'type', 'ale');\n assert.deepEqual(Object.keys(otherBeer), ['type'], 'addObserver -> set');\n\n let yetAnotherBeer = new Beer();\n (0, _metal.addObserver)(yetAnotherBeer, 'type', K);\n (0, _metal.set)(yetAnotherBeer, 'type', 'ale');\n (0, _metal.addObserver)(beer, 'type', K);\n (0, _metal.removeObserver)(beer, 'type', K);\n assert.deepEqual(Object.keys(yetAnotherBeer), ['type'], 'addObserver -> set -> removeObserver');\n\n let itsMyLastBeer = new Beer();\n (0, _metal.set)(itsMyLastBeer, 'type', 'ale');\n (0, _metal.addObserver)(beer, 'type', K);\n (0, _metal.removeObserver)(beer, 'type', K);\n assert.deepEqual(Object.keys(itsMyLastBeer), ['type'], 'set -> removeObserver');\n }\n });\n});","enifed('@ember/-internals/metal/tests/performance_test', ['@ember/-internals/metal', 'internal-test-helpers'], function (_metal, _internalTestHelpers) {\n 'use strict';\n\n /*\n This test file is designed to capture performance regressions related to\n deferred computation. Things like run loops, computed properties, and bindings\n should run the minimum amount of times to achieve best performance, so any\n bugs that cause them to get evaluated more than necessary should be put here.\n */\n\n (0, _internalTestHelpers.moduleFor)('Computed Properties - Number of times evaluated', class extends _internalTestHelpers.AbstractTestCase {\n ['@test computed properties that depend on multiple properties should run only once per run loop'](assert) {\n let obj = { a: 'a', b: 'b', c: 'c' };\n let cpCount = 0;\n let obsCount = 0;\n\n (0, _metal.defineProperty)(obj, 'abc', (0, _metal.computed)(function (key) {\n cpCount++;\n return 'computed ' + key;\n }).property('a', 'b', 'c'));\n\n (0, _metal.get)(obj, 'abc');\n\n cpCount = 0;\n\n (0, _metal.addObserver)(obj, 'abc', function () {\n obsCount++;\n });\n\n (0, _metal.beginPropertyChanges)();\n (0, _metal.set)(obj, 'a', 'aa');\n (0, _metal.set)(obj, 'b', 'bb');\n (0, _metal.set)(obj, 'c', 'cc');\n (0, _metal.endPropertyChanges)();\n\n (0, _metal.get)(obj, 'abc');\n\n assert.equal(cpCount, 1, 'The computed property is only invoked once');\n assert.equal(obsCount, 1, 'The observer is only invoked once');\n }\n\n ['@test computed properties are not executed if they are the last segment of an observer chain pain'](assert) {\n let foo = { bar: { baz: {} } };\n\n let count = 0;\n\n (0, _metal.defineProperty)(foo.bar.baz, 'bam', (0, _metal.computed)(function () {\n count++;\n }));\n\n (0, _metal.addObserver)(foo, 'bar.baz.bam', function () {});\n\n (0, _metal.notifyPropertyChange)((0, _metal.get)(foo, 'bar.baz'), 'bam');\n\n assert.equal(count, 0, 'should not have recomputed property');\n }\n });\n});","enifed('@ember/-internals/metal/tests/properties_test', ['@ember/-internals/metal', 'internal-test-helpers'], function (_metal, _internalTestHelpers) {\n 'use strict';\n\n (0, _internalTestHelpers.moduleFor)('defineProperty', class extends _internalTestHelpers.AbstractTestCase {\n ['@test toString'](assert) {\n let obj = {};\n (0, _metal.defineProperty)(obj, 'toString', undefined, function () {\n return 'FOO';\n });\n assert.equal(obj.toString(), 'FOO', 'should replace toString');\n }\n\n ['@test for data properties, didDefineProperty hook should be called if implemented'](assert) {\n assert.expect(2);\n\n let obj = {\n didDefineProperty(obj, keyName, value) {\n assert.equal(keyName, 'foo', 'key name should be foo');\n assert.equal(value, 'bar', 'value should be bar');\n }\n };\n\n (0, _metal.defineProperty)(obj, 'foo', undefined, 'bar');\n }\n\n ['@test for computed properties, didDefineProperty hook should be called if implemented'](assert) {\n assert.expect(2);\n\n let computedProperty = (0, _metal.computed)(function () {\n return this;\n });\n\n let obj = {\n didDefineProperty(obj, keyName, value) {\n assert.equal(keyName, 'foo', 'key name should be foo');\n assert.strictEqual(value, computedProperty, 'value should be passed as computed property');\n }\n };\n\n (0, _metal.defineProperty)(obj, 'foo', computedProperty);\n }\n\n ['@test for descriptor properties, didDefineProperty hook should be called if implemented'](assert) {\n assert.expect(2);\n\n let descriptor = {\n writable: true,\n configurable: false,\n enumerable: true,\n value: 42\n };\n\n let obj = {\n didDefineProperty(obj, keyName, value) {\n assert.equal(keyName, 'answer', 'key name should be answer');\n assert.strictEqual(value, descriptor, 'value should be passed as descriptor');\n }\n };\n\n (0, _metal.defineProperty)(obj, 'answer', descriptor);\n }\n });\n\n (0, _internalTestHelpers.moduleFor)('Ember.deprecateProperty', class extends _internalTestHelpers.AbstractTestCase {\n ['@test enables access to deprecated property and returns the value of the new property'](assert) {\n assert.expect(3);\n let obj = { foo: 'bar' };\n\n (0, _metal.deprecateProperty)(obj, 'baz', 'foo', { id: 'baz-deprecation', until: 'some.version' });\n\n expectDeprecation();\n assert.equal(obj.baz, obj.foo, 'baz and foo are equal');\n\n obj.foo = 'blammo';\n assert.equal(obj.baz, obj.foo, 'baz and foo are equal');\n }\n\n ['@test deprecatedKey is not enumerable'](assert) {\n assert.expect(2);\n let obj = { foo: 'bar', blammo: 'whammy' };\n\n (0, _metal.deprecateProperty)(obj, 'baz', 'foo', { id: 'baz-deprecation', until: 'some.version' });\n\n for (let prop in obj) {\n if (obj.hasOwnProperty(prop)) {\n assert.notEqual(prop, 'baz');\n }\n }\n }\n\n ['@test enables setter to deprecated property and updates the value of the new property'](assert) {\n assert.expect(3);\n let obj = { foo: 'bar' };\n\n (0, _metal.deprecateProperty)(obj, 'baz', 'foo', { id: 'baz-deprecation', until: 'some.version' });\n\n expectDeprecation();\n obj.baz = 'bloop';\n assert.equal(obj.foo, 'bloop', 'updating baz updates foo');\n assert.equal(obj.baz, obj.foo, 'baz and foo are equal');\n }\n });\n});","enifed('@ember/-internals/metal/tests/property_did_change_hook', ['@ember/-internals/metal', 'internal-test-helpers'], function (_metal, _internalTestHelpers) {\n 'use strict';\n\n (0, _internalTestHelpers.moduleFor)('PROPERTY_DID_CHANGE', class extends _internalTestHelpers.AbstractTestCase {\n ['@test alias and cp'](assert) {\n let counts = {};\n let obj = {\n child: {},\n [_metal.PROPERTY_DID_CHANGE](keyName) {\n counts[keyName] = (counts[keyName] || 0) + 1;\n }\n };\n\n (0, _metal.defineProperty)(obj, 'cost', (0, _metal.alias)('child.cost'));\n (0, _metal.defineProperty)(obj, 'tax', (0, _metal.alias)('child.tax'));\n\n (0, _metal.defineProperty)(obj, 'total', (0, _metal.computed)('cost', 'tax', {\n get() {\n return (0, _metal.get)(this, 'cost') + (0, _metal.get)(this, 'tax');\n }\n }));\n\n assert.ok(!(0, _metal.isWatching)(obj, 'child.cost'), 'precond alias target `child.cost` is not watched');\n assert.equal((0, _metal.get)(obj, 'cost'), undefined);\n // this is how PROPERTY_DID_CHANGE will get notified\n assert.ok((0, _metal.isWatching)(obj, 'child.cost'), 'alias target `child.cost` is watched after consumption');\n\n assert.ok(!(0, _metal.isWatching)(obj, 'child.tax'), 'precond alias target `child.tax` is not watched');\n assert.equal((0, _metal.get)(obj, 'tax'), undefined);\n // this is how PROPERTY_DID_CHANGE will get notified\n assert.ok((0, _metal.isWatching)(obj, 'child.tax'), 'alias target `child.cost` is watched after consumption');\n\n // increments the watching count on the alias itself to 1\n assert.ok(isNaN((0, _metal.get)(obj, 'total')), 'total is initialized');\n\n // decrements the watching count on the alias itself to 0\n (0, _metal.set)(obj, 'child', {\n cost: 399.0,\n tax: 32.93\n });\n\n // this should have called PROPERTY_DID_CHANGE for all of them\n assert.equal(counts['cost'], 1, 'PROPERTY_DID_CHANGE called with cost');\n assert.equal(counts['tax'], 1, 'PROPERTY_DID_CHANGE called with tax');\n assert.equal(counts['total'], 1, 'PROPERTY_DID_CHANGE called with total');\n\n // we should still have a dependency installed\n assert.ok((0, _metal.isWatching)(obj, 'child.cost'), 'watching child.cost');\n assert.ok((0, _metal.isWatching)(obj, 'child.tax'), 'watching child.tax');\n\n (0, _metal.set)(obj, 'child', {\n cost: 100.0,\n tax: 10.0\n });\n\n assert.equal(counts['cost'], 2, 'PROPERTY_DID_CHANGE called with cost');\n assert.equal(counts['tax'], 2, 'PROPERTY_DID_CHANGE called with tax');\n assert.equal(counts['total'], 1, 'PROPERTY_DID_CHANGE called with total');\n }\n });\n});","enifed('@ember/-internals/metal/tests/property_events_test', ['@ember/-internals/meta', '@ember/-internals/metal', 'internal-test-helpers'], function (_meta, _metal, _internalTestHelpers) {\n 'use strict';\n\n (0, _internalTestHelpers.moduleFor)('notifyPropertyChange', class extends _internalTestHelpers.AbstractTestCase {\n ['@test notifies property changes on instances'](assert) {\n class Foo {\n [_metal.PROPERTY_DID_CHANGE](prop) {\n assert.equal(prop, 'bar', 'property change notified');\n }\n }\n\n let foo = new Foo();\n\n (0, _metal.notifyPropertyChange)(foo, 'bar');\n }\n\n ['@test notifies property changes on instances with meta'](assert) {\n class Foo {\n [_metal.PROPERTY_DID_CHANGE](prop) {\n assert.equal(prop, 'bar', 'property change notified');\n }\n }\n\n let foo = new Foo();\n\n (0, _meta.meta)(foo); // setup meta\n\n (0, _metal.notifyPropertyChange)(foo, 'bar');\n }\n\n ['@test does not notify on class prototypes with meta'](assert) {\n assert.expect(0);\n\n class Foo {\n [_metal.PROPERTY_DID_CHANGE](prop) {\n assert.equal(prop, 'bar', 'property change notified');\n }\n }\n\n let foo = new Foo();\n\n (0, _meta.meta)(foo.constructor.prototype); // setup meta for prototype\n\n (0, _metal.notifyPropertyChange)(foo.constructor.prototype, 'bar');\n }\n\n ['@test does not notify on non-class prototypes with meta'](assert) {\n assert.expect(0);\n\n let foo = {\n [_metal.PROPERTY_DID_CHANGE](prop) {\n assert.equal(prop, 'baz', 'property change notified');\n }\n };\n\n let bar = Object.create(foo);\n\n (0, _meta.meta)(foo); // setup meta for prototype\n (0, _meta.meta)(bar); // setup meta for instance, switch prototype\n\n (0, _metal.notifyPropertyChange)(foo, 'baz');\n }\n });\n});","enifed('@ember/-internals/metal/tests/set_properties_test', ['@ember/-internals/metal', 'internal-test-helpers'], function (_metal, _internalTestHelpers) {\n 'use strict';\n\n (0, _internalTestHelpers.moduleFor)('setProperties', class extends _internalTestHelpers.AbstractTestCase {\n ['@test supports setting multiple attributes at once'](assert) {\n assert.deepEqual((0, _metal.setProperties)(null, null), null, 'noop for null properties and null object');\n assert.deepEqual((0, _metal.setProperties)(undefined, undefined), undefined, 'noop for undefined properties and undefined object');\n\n assert.deepEqual((0, _metal.setProperties)({}), undefined, 'noop for no properties');\n assert.deepEqual((0, _metal.setProperties)({}, undefined), undefined, 'noop for undefined');\n assert.deepEqual((0, _metal.setProperties)({}, null), null, 'noop for null');\n assert.deepEqual((0, _metal.setProperties)({}, NaN), NaN, 'noop for NaN');\n assert.deepEqual((0, _metal.setProperties)({}, {}), {}, 'meh');\n\n let props = (0, _metal.setProperties)({}, { foo: undefined });\n assert.deepEqual(props, { foo: undefined }, 'Setting undefined value');\n assert.ok('foo' in props, 'Setting undefined value');\n assert.deepEqual(Object.keys(props), ['foo'], 'Setting undefined value');\n\n assert.deepEqual((0, _metal.setProperties)({}, { foo: 1 }), { foo: 1 }, 'Set a single property');\n\n assert.deepEqual((0, _metal.setProperties)({}, { foo: 1, bar: 1 }), { foo: 1, bar: 1 }, 'Set multiple properties');\n\n assert.deepEqual((0, _metal.setProperties)({ foo: 2, baz: 2 }, { foo: 1 }), { foo: 1 }, 'Set one of multiple properties');\n\n assert.deepEqual((0, _metal.setProperties)({ foo: 2, baz: 2 }, { bar: 2 }), {\n bar: 2\n }, 'Set an additional, previously unset property');\n }\n });\n});","enifed(\"@ember/-internals/metal/tests/tracked/computed_test\", [\"@ember/-internals/metal\", \"internal-test-helpers\"], function (_metal, _internalTestHelpers) {\n \"use strict\";\n\n var __decorate = undefined && undefined.__decorate || function (decorators, target, key, desc) {\n var c = arguments.length,\n r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,\n d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n };\n\n if (false /* EMBER_METAL_TRACKED_PROPERTIES */) {\n (0, _internalTestHelpers.moduleFor)('@tracked getters', class extends _internalTestHelpers.AbstractTestCase {\n ['@test works without get'](assert) {\n let count = 0;\n class Count {\n get foo() {\n count++;\n return `computed foo`;\n }\n }\n __decorate([_metal.tracked], Count.prototype, \"foo\", null);\n let obj = new Count();\n assert.equal(obj.foo, 'computed foo', 'should return value');\n assert.equal(count, 1, 'should have invoked computed property');\n }\n ['@test defining computed property should invoke property on get'](assert) {\n let count = 0;\n class Count {\n get foo() {\n count++;\n return `computed foo`;\n }\n }\n __decorate([_metal.tracked], Count.prototype, \"foo\", null);\n let obj = new Count();\n assert.equal((0, _metal.get)(obj, 'foo'), 'computed foo', 'should return value');\n assert.equal(count, 1, 'should have invoked computed property');\n }\n ['@test defining computed property should invoke property on set'](assert) {\n let count = 0;\n class Foo {\n constructor() {\n this.__foo = '';\n }\n get foo() {\n return this.__foo;\n }\n set foo(value) {\n count++;\n this.__foo = `computed ${value}`;\n }\n }\n __decorate([_metal.tracked], Foo.prototype, \"foo\", null);\n let obj = new Foo();\n assert.equal((0, _metal.set)(obj, 'foo', 'bar'), 'bar', 'should return set value');\n assert.equal(count, 1, 'should have invoked computed property');\n assert.equal((0, _metal.get)(obj, 'foo'), 'computed bar', 'should return new value');\n }\n });\n }\n});","enifed(\"@ember/-internals/metal/tests/tracked/get_test\", [\"internal-test-helpers\", \"@ember/-internals/metal\"], function (_internalTestHelpers, _metal) {\n \"use strict\";\n\n var __decorate = undefined && undefined.__decorate || function (decorators, target, key, desc) {\n var c = arguments.length,\n r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,\n d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n };\n\n if (false /* EMBER_METAL_TRACKED_PROPERTIES */) {\n function createObj() {\n class Obj {\n constructor() {\n this.string = 'string';\n this.number = 23;\n this.boolTrue = true;\n this.boolFalse = false;\n this.nullValue = null;\n }\n }\n __decorate([_metal.tracked], Obj.prototype, \"string\", void 0);\n __decorate([_metal.tracked], Obj.prototype, \"number\", void 0);\n __decorate([_metal.tracked], Obj.prototype, \"boolTrue\", void 0);\n __decorate([_metal.tracked], Obj.prototype, \"boolFalse\", void 0);\n __decorate([_metal.tracked], Obj.prototype, \"nullValue\", void 0);\n return new Obj();\n }\n (0, _internalTestHelpers.moduleFor)('@tracked decorator: get', class extends _internalTestHelpers.AbstractTestCase {\n '@test should get arbitrary properties on an object'() {\n let obj = createObj();\n for (let key in obj) {\n this.assert.equal((0, _metal.get)(obj, key), obj[key], key);\n }\n }\n '@test should retrieve a number key on an object'() {\n class Obj {\n constructor() {\n this[1] = 'first';\n }\n }\n __decorate([_metal.tracked], Obj.prototype, 1, void 0);\n let obj = new Obj();\n this.assert.equal((0, _metal.get)(obj, '1'), 'first');\n }\n '@test should retrieve an empty key on an object'() {\n class Obj {\n constructor() {\n this[''] = 'empty';\n }\n }\n __decorate([_metal.tracked], Obj.prototype, \"\", void 0);\n let obj = new Obj();\n this.assert.equal((0, _metal.get)(obj, ''), 'empty');\n }\n '@test should get a @tracked path'() {\n class Key {\n constructor() {\n this.value = 'value';\n }\n }\n __decorate([_metal.tracked], Key.prototype, \"value\", void 0);\n class Path {\n constructor() {\n this.key = new Key();\n }\n }\n __decorate([_metal.tracked], Path.prototype, \"key\", void 0);\n class Obj {\n constructor() {\n this.path = new Path();\n }\n }\n __decorate([_metal.tracked], Obj.prototype, \"path\", void 0);\n let obj = new Obj();\n this.assert.equal((0, _metal.get)(obj, 'path.key.value'), 'value');\n }\n '@test should not access a property more than once'() {\n let count = 20;\n class Count {\n get id() {\n return ++count;\n }\n }\n __decorate([_metal.tracked], Count.prototype, \"id\", null);\n let obj = new Count();\n (0, _metal.get)(obj, 'id');\n this.assert.equal(count, 21);\n }\n });\n (0, _internalTestHelpers.moduleFor)('@tracked decorator: getWithDefault', class extends _internalTestHelpers.AbstractTestCase {\n ['@test should get arbitrary properties on an object']() {\n let obj = createObj();\n for (let key in obj) {\n this.assert.equal((0, _metal.getWithDefault)(obj, key, 'fail'), obj[key], key);\n }\n class Obj {\n constructor() {\n this.undef = undefined;\n }\n }\n __decorate([_metal.tracked], Obj.prototype, \"undef\", void 0);\n let obj2 = new Obj();\n this.assert.equal((0, _metal.getWithDefault)(obj2, 'undef', 'default'), 'default', 'explicit undefined retrieves the default');\n this.assert.equal((0, _metal.getWithDefault)(obj2, 'not-present', 'default'), 'default', 'non-present key retrieves the default');\n }\n });\n }\n});","enifed(\"@ember/-internals/metal/tests/tracked/set_test\", [\"internal-test-helpers\", \"@ember/-internals/metal\"], function (_internalTestHelpers, _metal) {\n \"use strict\";\n\n var __decorate = undefined && undefined.__decorate || function (decorators, target, key, desc) {\n var c = arguments.length,\n r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,\n d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n };\n\n\n if (false /* EMBER_METAL_TRACKED_PROPERTIES */) {\n const createObj = () => {\n class Obj {\n constructor() {\n this.string = 'string';\n this.number = 23;\n this.boolTrue = true;\n this.boolFalse = false;\n this.nullValue = null;\n this.undefinedValue = undefined;\n }\n }\n __decorate([_metal.tracked], Obj.prototype, \"string\", void 0);\n __decorate([_metal.tracked], Obj.prototype, \"number\", void 0);\n __decorate([_metal.tracked], Obj.prototype, \"boolTrue\", void 0);\n __decorate([_metal.tracked], Obj.prototype, \"boolFalse\", void 0);\n __decorate([_metal.tracked], Obj.prototype, \"nullValue\", void 0);\n __decorate([_metal.tracked], Obj.prototype, \"undefinedValue\", void 0);\n return new Obj();\n };\n (0, _internalTestHelpers.moduleFor)('@tracked set', class extends _internalTestHelpers.AbstractTestCase {\n ['@test should set arbitrary properties on an object'](assert) {\n let obj = createObj();\n class Obj {\n constructor() {\n this.undefinedValue = 'emberjs';\n }\n }\n __decorate([_metal.tracked], Obj.prototype, \"undefinedValue\", void 0);\n let newObj = new Obj();\n for (let key in obj) {\n assert.equal((0, _metal.set)(newObj, key, obj[key]), obj[key], 'should return value');\n assert.equal((0, _metal.get)(newObj, key), obj[key], 'should set value');\n }\n }\n ['@test should set a number key on an object'](assert) {\n class Obj {\n constructor() {\n this[1] = 'original';\n }\n }\n __decorate([_metal.tracked], Obj.prototype, 1, void 0);\n let obj = new Obj();\n (0, _metal.set)(obj, '1', 'first');\n assert.equal(obj[1], 'first');\n }\n });\n }\n});","enifed('@ember/-internals/metal/tests/tracked/support', ['exports', '@ember/-internals/metal'], function (exports, _metal) {\n 'use strict';\n\n exports.createTracked = createTracked;\n exports.createWithDescriptors = createWithDescriptors;\n function createTracked(values, proto = {}) {\n function Class() {\n for (let prop in values) {\n this[prop] = values[prop];\n }\n }\n\n for (let prop in values) {\n Object.defineProperty(proto, prop, (0, _metal.tracked)(proto, prop, {\n enumerable: true,\n configurable: true,\n writable: true,\n value: values[prop]\n }));\n }\n\n Class.prototype = proto;\n\n return new Class();\n }\n\n function createWithDescriptors(values) {\n function Class() {}\n\n for (let prop in values) {\n let descriptor = Object.getOwnPropertyDescriptor(values, prop);\n Object.defineProperty(Class.prototype, prop, (0, _metal.tracked)(Class.prototype, prop, descriptor));\n }\n\n return new Class();\n }\n});","enifed(\"@ember/-internals/metal/tests/tracked/validation_test\", [\"@ember/-internals/metal\", \"internal-test-helpers\"], function (_metal, _internalTestHelpers) {\n \"use strict\";\n\n var __decorate = undefined && undefined.__decorate || function (decorators, target, key, desc) {\n var c = arguments.length,\n r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,\n d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n };\n\n if (false /* EMBER_METAL_TRACKED_PROPERTIES */) {\n (0, _internalTestHelpers.moduleFor)('@tracked get validation', class extends _internalTestHelpers.AbstractTestCase {\n [`@test validators for tracked getters with dependencies should invalidate when the dependencies invalidate`](assert) {\n class Tracked {\n constructor(first, last) {\n this.first = undefined;\n this.last = undefined;\n this.first = first;\n this.last = last;\n }\n get full() {\n return `${this.first} ${this.last}`;\n }\n }\n __decorate([_metal.tracked], Tracked.prototype, \"first\", void 0);\n __decorate([_metal.tracked], Tracked.prototype, \"last\", void 0);\n __decorate([_metal.tracked], Tracked.prototype, \"full\", null);\n let obj = new Tracked('Tom', 'Dale');\n let tag = (0, _metal.tagForProperty)(obj, 'full');\n let snapshot = tag.value();\n let full = obj.full;\n assert.equal(full, 'Tom Dale', 'The full name starts correct');\n assert.equal(tag.validate(snapshot), true);\n snapshot = tag.value();\n assert.equal(tag.validate(snapshot), true);\n obj.first = 'Thomas';\n assert.equal(tag.validate(snapshot), false);\n assert.equal(obj.full, 'Thomas Dale');\n snapshot = tag.value();\n assert.equal(tag.validate(snapshot), true);\n }\n [`@test interaction with Ember object model (tracked property depending on Ember property)`](assert) {\n class Tracked {\n constructor(name) {\n this.name = name;\n }\n get full() {\n return `${(0, _metal.get)(this.name, 'first')} ${(0, _metal.get)(this.name, 'last')}`;\n }\n }\n __decorate([_metal.tracked], Tracked.prototype, \"name\", void 0);\n __decorate([_metal.tracked], Tracked.prototype, \"full\", null);\n let tom = { first: 'Tom', last: 'Dale' };\n let obj = new Tracked(tom);\n let tag = (0, _metal.tagForProperty)(obj, 'full');\n let snapshot = tag.value();\n let full = obj.full;\n assert.equal(full, 'Tom Dale');\n assert.equal(tag.validate(snapshot), true);\n snapshot = tag.value();\n assert.equal(tag.validate(snapshot), true);\n (0, _metal.set)(tom, 'first', 'Thomas');\n assert.equal(tag.validate(snapshot), false, 'invalid after setting with Ember set');\n assert.equal(obj.full, 'Thomas Dale');\n snapshot = tag.value();\n assert.equal(tag.validate(snapshot), true);\n }\n [`@test interaction with Ember object model (Ember computed property depending on tracked property)`](assert) {\n class EmberObject {\n constructor(name) {\n this.name = name;\n }\n }\n (0, _metal.defineProperty)(EmberObject.prototype, 'full', (0, _metal.computed)('name', function () {\n let name = (0, _metal.get)(this, 'name');\n return `${name.first} ${name.last}`;\n }));\n class Name {\n constructor(first, last) {\n this.first = first;\n this.last = last;\n }\n }\n __decorate([_metal.tracked], Name.prototype, \"first\", void 0);\n __decorate([_metal.tracked], Name.prototype, \"last\", void 0);\n let tom = new Name('Tom', 'Dale');\n let obj = new EmberObject(tom);\n let tag = (0, _metal.tagForProperty)(obj, 'full');\n let snapshot = tag.value();\n let full = (0, _metal.get)(obj, 'full');\n assert.equal(full, 'Tom Dale');\n assert.equal(tag.validate(snapshot), true);\n snapshot = tag.value();\n assert.equal(tag.validate(snapshot), true);\n tom.first = 'Thomas';\n assert.equal(tag.validate(snapshot), false, 'invalid after setting with tracked properties');\n assert.equal((0, _metal.get)(obj, 'full'), 'Thomas Dale');\n snapshot = tag.value();\n assert.equal(tag.validate(snapshot), true);\n }\n ['@test interaction with the Ember object model (paths going through tracked properties)'](assert) {\n let self;\n class EmberObject {\n constructor(contact) {\n this.contact = contact;\n self = this;\n }\n }\n (0, _metal.defineProperty)(EmberObject.prototype, 'full', (0, _metal.computed)('contact.name.first', 'contact.name.last', function () {\n let contact = (0, _metal.get)(self, 'contact');\n return `${(0, _metal.get)(contact.name, 'first')} ${(0, _metal.get)(contact.name, 'last')}`;\n }));\n class Contact {\n constructor(name) {\n this.name = undefined;\n this.name = name;\n }\n }\n __decorate([_metal.tracked], Contact.prototype, \"name\", void 0);\n class EmberName {\n constructor(first, last) {\n this.first = first;\n this.last = last;\n }\n }\n let tom = new EmberName('Tom', 'Dale');\n let contact = new Contact(tom);\n let obj = new EmberObject(contact);\n let tag = (0, _metal.tagForProperty)(obj, 'full');\n let snapshot = tag.value();\n let full = (0, _metal.get)(obj, 'full');\n assert.equal(full, 'Tom Dale');\n assert.equal(tag.validate(snapshot), true);\n snapshot = tag.value();\n assert.equal(tag.validate(snapshot), true);\n (0, _metal.set)(tom, 'first', 'Thomas');\n assert.equal(tag.validate(snapshot), false, 'invalid after setting with Ember.set');\n assert.equal((0, _metal.get)(obj, 'full'), 'Thomas Dale');\n snapshot = tag.value();\n tom = contact.name = new EmberName('T', 'Dale');\n assert.equal(tag.validate(snapshot), false, 'invalid after setting with Ember.set');\n assert.equal((0, _metal.get)(obj, 'full'), 'T Dale');\n snapshot = tag.value();\n (0, _metal.set)(tom, 'first', 'Tizzle');\n assert.equal(tag.validate(snapshot), false, 'invalid after setting with Ember.set');\n assert.equal((0, _metal.get)(obj, 'full'), 'Tizzle Dale');\n }\n });\n }\n});","enifed('@ember/-internals/metal/tests/watching/is_watching_test', ['@ember/-internals/metal', 'internal-test-helpers'], function (_metal, _internalTestHelpers) {\n 'use strict';\n\n function testObserver(assert, setup, teardown, key = 'key') {\n let obj = {};\n\n assert.equal((0, _metal.isWatching)(obj, key), false, 'precond - isWatching is false by default');\n setup(obj, key, 'fn');\n assert.equal((0, _metal.isWatching)(obj, key), true, 'isWatching is true when observers are added');\n teardown(obj, key, 'fn');\n assert.equal((0, _metal.isWatching)(obj, key), false, 'isWatching is false after observers are removed');\n }\n\n (0, _internalTestHelpers.moduleFor)('isWatching', class extends _internalTestHelpers.AbstractTestCase {\n ['@test isWatching is true for regular local observers'](assert) {\n testObserver(assert, (obj, key, fn) => {\n _metal.Mixin.create({\n [fn]: (0, _metal.observer)(key, function () {})\n }).apply(obj);\n }, (obj, key, fn) => (0, _metal.removeObserver)(obj, key, obj, fn));\n }\n\n ['@test isWatching is true for nonlocal observers'](assert) {\n testObserver(assert, (obj, key, fn) => {\n (0, _metal.addObserver)(obj, key, obj, fn);\n }, (obj, key, fn) => (0, _metal.removeObserver)(obj, key, obj, fn));\n }\n\n ['@test isWatching is true for chained observers'](assert) {\n testObserver(assert, function (obj, key, fn) {\n (0, _metal.addObserver)(obj, key + '.bar', obj, fn);\n }, function (obj, key, fn) {\n (0, _metal.removeObserver)(obj, key + '.bar', obj, fn);\n });\n }\n\n ['@test isWatching is true for computed properties'](assert) {\n testObserver(assert, (obj, key, fn) => {\n (0, _metal.defineProperty)(obj, fn, (0, _metal.computed)(function () {}).property(key));\n (0, _metal.get)(obj, fn);\n }, (obj, key, fn) => (0, _metal.defineProperty)(obj, fn, null));\n }\n\n ['@test isWatching is true for chained computed properties'](assert) {\n testObserver(assert, (obj, key, fn) => {\n (0, _metal.defineProperty)(obj, fn, (0, _metal.computed)(function () {}).property(key + '.bar'));\n (0, _metal.get)(obj, fn);\n }, (obj, key, fn) => (0, _metal.defineProperty)(obj, fn, null));\n }\n\n // can't watch length on Array - it is special...\n // But you should be able to watch a length property of an object\n [\"@test isWatching is true for 'length' property on object\"](assert) {\n testObserver(assert, (obj, key, fn) => {\n (0, _metal.defineProperty)(obj, 'length', null, '26.2 miles');\n (0, _metal.addObserver)(obj, 'length', obj, fn);\n }, (obj, key, fn) => (0, _metal.removeObserver)(obj, 'length', obj, fn), 'length');\n }\n });\n});","enifed('@ember/-internals/metal/tests/watching/unwatch_test', ['@ember/-internals/metal', 'internal-test-helpers'], function (_metal, _internalTestHelpers) {\n 'use strict';\n\n let didCount;\n\n function addListeners(obj, keyPath) {\n (0, _metal.addListener)(obj, keyPath + ':change', () => didCount++);\n }\n\n (0, _internalTestHelpers.moduleFor)('unwatch', class extends _internalTestHelpers.AbstractTestCase {\n beforeEach() {\n didCount = 0;\n }\n\n ['@test unwatching a computed property - regular get/set'](assert) {\n let obj = {};\n\n (0, _metal.defineProperty)(obj, 'foo', (0, _metal.computed)({\n get() {\n return this.__foo;\n },\n set(keyName, value) {\n this.__foo = value;\n return this.__foo;\n }\n }));\n addListeners(obj, 'foo');\n\n (0, _metal.watch)(obj, 'foo');\n (0, _metal.set)(obj, 'foo', 'bar');\n assert.equal(didCount, 1, 'should have invoked didCount');\n\n (0, _metal.unwatch)(obj, 'foo');\n didCount = 0;\n (0, _metal.set)(obj, 'foo', 'BAZ');\n assert.equal(didCount, 0, 'should NOT have invoked didCount');\n }\n\n ['@test unwatching a regular property - regular get/set'](assert) {\n let obj = { foo: 'BIFF' };\n addListeners(obj, 'foo');\n\n (0, _metal.watch)(obj, 'foo');\n (0, _metal.set)(obj, 'foo', 'bar');\n assert.equal(didCount, 1, 'should have invoked didCount');\n\n (0, _metal.unwatch)(obj, 'foo');\n didCount = 0;\n (0, _metal.set)(obj, 'foo', 'BAZ');\n assert.equal(didCount, 0, 'should NOT have invoked didCount');\n }\n\n ['@test unwatching should be nested'](assert) {\n let obj = { foo: 'BIFF' };\n addListeners(obj, 'foo');\n\n (0, _metal.watch)(obj, 'foo');\n (0, _metal.watch)(obj, 'foo');\n (0, _metal.set)(obj, 'foo', 'bar');\n assert.equal(didCount, 1, 'should have invoked didCount');\n\n (0, _metal.unwatch)(obj, 'foo');\n didCount = 0;\n (0, _metal.set)(obj, 'foo', 'BAZ');\n assert.equal(didCount, 1, 'should NOT have invoked didCount');\n\n (0, _metal.unwatch)(obj, 'foo');\n didCount = 0;\n (0, _metal.set)(obj, 'foo', 'BAZ');\n assert.equal(didCount, 0, 'should NOT have invoked didCount');\n }\n\n ['@test unwatching \"length\" property on an object'](assert) {\n let obj = { foo: 'RUN' };\n addListeners(obj, 'length');\n\n // Can watch length when it is undefined\n (0, _metal.watch)(obj, 'length');\n (0, _metal.set)(obj, 'length', '10k');\n assert.equal(didCount, 1, 'should have invoked didCount');\n\n // Should stop watching despite length now being defined (making object 'array-like')\n (0, _metal.unwatch)(obj, 'length');\n didCount = 0;\n (0, _metal.set)(obj, 'length', '5k');\n assert.equal(didCount, 0, 'should NOT have invoked didCount');\n }\n\n ['@test unwatching should not destroy non MANDATORY_SETTER descriptor'](assert) {\n let obj = {\n get foo() {\n return 'RUN';\n }\n };\n\n assert.equal(obj.foo, 'RUN', 'obj.foo');\n (0, _metal.watch)(obj, 'foo');\n assert.equal(obj.foo, 'RUN', 'obj.foo after watch');\n (0, _metal.unwatch)(obj, 'foo');\n assert.equal(obj.foo, 'RUN', 'obj.foo after unwatch');\n }\n });\n});","enifed('@ember/-internals/metal/tests/watching/watch_test', ['@ember/-internals/environment', '@ember/-internals/metal', '@ember/-internals/meta', 'internal-test-helpers'], function (_environment, _metal, _meta, _internalTestHelpers) {\n 'use strict';\n\n let didCount, didKeys, originalLookup;\n\n function addListeners(obj, keyPath) {\n (0, _metal.addListener)(obj, keyPath + ':change', function () {\n didCount++;\n didKeys.push(keyPath);\n });\n }\n\n (0, _internalTestHelpers.moduleFor)('watch', class extends _internalTestHelpers.AbstractTestCase {\n beforeEach() {\n didCount = 0;\n didKeys = [];\n\n originalLookup = _environment.context.lookup;\n _environment.context.lookup = {};\n }\n\n afterEach() {\n _environment.context.lookup = originalLookup;\n }\n\n ['@test watching a computed property'](assert) {\n let obj = {};\n (0, _metal.defineProperty)(obj, 'foo', (0, _metal.computed)({\n get() {\n return this.__foo;\n },\n set(keyName, value) {\n if (value !== undefined) {\n this.__foo = value;\n }\n return this.__foo;\n }\n }));\n addListeners(obj, 'foo');\n\n (0, _metal.watch)(obj, 'foo');\n (0, _metal.set)(obj, 'foo', 'bar');\n assert.equal(didCount, 1, 'should have invoked didCount');\n }\n\n ['@test watching a regular defined property'](assert) {\n let obj = { foo: 'baz' };\n addListeners(obj, 'foo');\n\n (0, _metal.watch)(obj, 'foo');\n assert.equal((0, _metal.get)(obj, 'foo'), 'baz', 'should have original prop');\n\n (0, _metal.set)(obj, 'foo', 'bar');\n assert.equal(didCount, 1, 'should have invoked didCount');\n\n assert.equal((0, _metal.get)(obj, 'foo'), 'bar', 'should get new value');\n assert.equal(obj.foo, 'bar', 'property should be accessible on obj');\n }\n\n ['@test watching a regular undefined property'](assert) {\n let obj = {};\n addListeners(obj, 'foo');\n\n (0, _metal.watch)(obj, 'foo');\n\n assert.equal('foo' in obj, false, 'precond undefined');\n\n (0, _metal.set)(obj, 'foo', 'bar');\n\n assert.equal(didCount, 1, 'should have invoked didCount');\n\n assert.equal((0, _metal.get)(obj, 'foo'), 'bar', 'should get new value');\n assert.equal(obj.foo, 'bar', 'property should be accessible on obj');\n }\n\n ['@test watches should inherit'](assert) {\n let obj = { foo: 'baz' };\n let objB = Object.create(obj);\n\n addListeners(obj, 'foo');\n (0, _metal.watch)(obj, 'foo');\n assert.equal((0, _metal.get)(obj, 'foo'), 'baz', 'should have original prop');\n\n (0, _metal.set)(objB, 'foo', 'bar');\n (0, _metal.set)(obj, 'foo', 'baz');\n assert.equal(didCount, 1, 'should have invoked didCount once only');\n }\n\n ['@test watching an object THEN defining it should work also'](assert) {\n let obj = {};\n addListeners(obj, 'foo');\n\n (0, _metal.watch)(obj, 'foo');\n\n (0, _metal.defineProperty)(obj, 'foo');\n (0, _metal.set)(obj, 'foo', 'bar');\n\n assert.equal((0, _metal.get)(obj, 'foo'), 'bar', 'should have set');\n assert.equal(didCount, 1, 'should have invoked didChange once');\n }\n\n ['@test watching a chain then defining the property'](assert) {\n let obj = {};\n let foo = { bar: 'bar' };\n addListeners(obj, 'foo.bar');\n addListeners(foo, 'bar');\n\n (0, _metal.watch)(obj, 'foo.bar');\n\n (0, _metal.defineProperty)(obj, 'foo', undefined, foo);\n (0, _metal.set)(foo, 'bar', 'baz');\n\n assert.deepEqual(didKeys, ['foo.bar', 'bar'], 'should have invoked didChange with bar, foo.bar');\n assert.equal(didCount, 2, 'should have invoked didChange twice');\n }\n\n ['@test watching a chain then defining the nested property'](assert) {\n let bar = {};\n let obj = { foo: bar };\n let baz = { baz: 'baz' };\n addListeners(obj, 'foo.bar.baz');\n addListeners(baz, 'baz');\n\n (0, _metal.watch)(obj, 'foo.bar.baz');\n\n (0, _metal.defineProperty)(bar, 'bar', undefined, baz);\n (0, _metal.set)(baz, 'baz', 'BOO');\n\n assert.deepEqual(didKeys, ['foo.bar.baz', 'baz'], 'should have invoked didChange with bar, foo.bar');\n assert.equal(didCount, 2, 'should have invoked didChange twice');\n }\n\n ['@test watching an object value then unwatching should restore old value'](assert) {\n let obj = { foo: { bar: { baz: { biff: 'BIFF' } } } };\n addListeners(obj, 'foo.bar.baz.biff');\n\n (0, _metal.watch)(obj, 'foo.bar.baz.biff');\n\n let foo = (0, _metal.get)(obj, 'foo');\n assert.equal((0, _metal.get)((0, _metal.get)((0, _metal.get)(foo, 'bar'), 'baz'), 'biff'), 'BIFF', 'biff should exist');\n\n (0, _metal.unwatch)(obj, 'foo.bar.baz.biff');\n assert.equal((0, _metal.get)((0, _metal.get)((0, _metal.get)(foo, 'bar'), 'baz'), 'biff'), 'BIFF', 'biff should exist');\n }\n\n ['@test when watching another object, destroy should remove chain watchers from the other object'](assert) {\n let objA = {};\n let objB = { foo: 'bar' };\n objA.b = objB;\n addListeners(objA, 'b.foo');\n\n (0, _metal.watch)(objA, 'b.foo');\n\n let meta_objB = (0, _meta.meta)(objB);\n let chainNode = (0, _meta.meta)(objA).readableChains().chains.b.chains.foo;\n\n assert.equal(meta_objB.peekWatching('foo'), 1, 'should be watching foo');\n assert.equal(meta_objB.readableChainWatchers().has('foo', chainNode), true, 'should have chain watcher');\n\n (0, _meta.deleteMeta)(objA);\n\n assert.equal(meta_objB.peekWatching('foo'), 0, 'should not be watching foo');\n assert.equal(meta_objB.readableChainWatchers().has('foo', chainNode), false, 'should not have chain watcher');\n }\n\n // TESTS for length property\n\n ['@test watching \"length\" property on an object'](assert) {\n let obj = { length: '26.2 miles' };\n addListeners(obj, 'length');\n\n (0, _metal.watch)(obj, 'length');\n assert.equal((0, _metal.get)(obj, 'length'), '26.2 miles', 'should have original prop');\n\n (0, _metal.set)(obj, 'length', '10k');\n assert.equal(didCount, 1, 'should have invoked didCount');\n\n assert.equal((0, _metal.get)(obj, 'length'), '10k', 'should get new value');\n assert.equal(obj.length, '10k', 'property should be accessible on obj');\n }\n\n ['@test watching \"length\" property on an array'](assert) {\n let arr = [];\n addListeners(arr, 'length');\n\n (0, _metal.watch)(arr, 'length');\n assert.equal((0, _metal.get)(arr, 'length'), 0, 'should have original prop');\n\n (0, _metal.set)(arr, 'length', '10');\n assert.equal(didCount, 1, 'should NOT have invoked didCount');\n\n assert.equal((0, _metal.get)(arr, 'length'), 10, 'should get new value');\n assert.equal(arr.length, 10, 'property should be accessible on arr');\n }\n\n ['@test watch + ES5 getter'](assert) {\n let parent = { b: 1 };\n let child = {\n get b() {\n return parent.b;\n }\n };\n\n assert.equal(parent.b, 1, 'parent.b should be 1');\n assert.equal(child.b, 1, 'child.b should be 1');\n assert.equal((0, _metal.get)(child, 'b'), 1, 'get(child, \"b\") should be 1');\n\n (0, _metal.watch)(child, 'b');\n\n assert.equal(parent.b, 1, 'parent.b should be 1 (after watch)');\n assert.equal(child.b, 1, 'child.b should be 1 (after watch)');\n\n assert.equal((0, _metal.get)(child, 'b'), 1, 'get(child, \"b\") should be 1 (after watch)');\n }\n\n ['@test watch + set + no-descriptor'](assert) {\n let child = {};\n\n assert.equal(child.b, undefined, 'child.b ');\n assert.equal((0, _metal.get)(child, 'b'), undefined, 'get(child, \"b\")');\n\n (0, _metal.watch)(child, 'b');\n (0, _metal.set)(child, 'b', 1);\n\n assert.equal(child.b, 1, 'child.b (after watch)');\n assert.equal((0, _metal.get)(child, 'b'), 1, 'get(child, \"b\") (after watch)');\n }\n });\n});","enifed('@ember/-internals/routing/tests/ext/controller_test', ['@ember/-internals/owner', '@ember/controller', 'internal-test-helpers'], function (_owner, _controller, _internalTestHelpers) {\n 'use strict';\n\n (0, _internalTestHelpers.moduleFor)('@ember/-internals/routing/ext/controller', class extends _internalTestHelpers.AbstractTestCase {\n [\"@test transitionToRoute considers an engine's mountPoint\"](assert) {\n let router = {\n transitionTo(route) {\n return route;\n }\n };\n\n let engineInstance = (0, _internalTestHelpers.buildOwner)({\n ownerOptions: {\n routable: true,\n mountPoint: 'foo.bar'\n }\n });\n\n let controller = _controller.default.create({ target: router });\n (0, _owner.setOwner)(controller, engineInstance);\n\n assert.strictEqual(controller.transitionToRoute('application'), 'foo.bar.application', 'properly prefixes application route');\n assert.strictEqual(controller.transitionToRoute('posts'), 'foo.bar.posts', 'properly prefixes child routes');\n assert.throws(() => controller.transitionToRoute('/posts'), 'throws when trying to use a url');\n\n let queryParams = {};\n assert.strictEqual(controller.transitionToRoute(queryParams), queryParams, 'passes query param only transitions through');\n }\n\n [\"@test replaceRoute considers an engine's mountPoint\"](assert) {\n let router = {\n replaceWith(route) {\n return route;\n }\n };\n\n let engineInstance = (0, _internalTestHelpers.buildOwner)({\n ownerOptions: {\n routable: true,\n mountPoint: 'foo.bar'\n }\n });\n\n let controller = _controller.default.create({ target: router });\n (0, _owner.setOwner)(controller, engineInstance);\n\n assert.strictEqual(controller.replaceRoute('application'), 'foo.bar.application', 'properly prefixes application route');\n assert.strictEqual(controller.replaceRoute('posts'), 'foo.bar.posts', 'properly prefixes child routes');\n assert.throws(() => controller.replaceRoute('/posts'), 'throws when trying to use a url');\n\n let queryParams = {};\n assert.strictEqual(controller.replaceRoute(queryParams), queryParams, 'passes query param only transitions through');\n }\n });\n});","enifed('@ember/-internals/routing/tests/location/auto_location_test', ['@ember/-internals/owner', '@ember/polyfills', '@ember/-internals/browser-environment', '@ember/runloop', '@ember/-internals/metal', '@ember/-internals/routing/lib/location/auto_location', '@ember/-internals/routing/lib/location/history_location', '@ember/-internals/routing/lib/location/hash_location', '@ember/-internals/routing/lib/location/none_location', 'internal-test-helpers'], function (_owner, _polyfills, _browserEnvironment, _runloop, _metal, _auto_location, _history_location, _hash_location, _none_location, _internalTestHelpers) {\n 'use strict';\n\n function mockBrowserLocation(overrides, assert) {\n return (0, _polyfills.assign)({\n href: 'http://test.com/',\n pathname: '/',\n hash: '',\n search: '',\n replace() {\n assert.ok(false, 'location.replace should not be called during testing');\n }\n }, overrides);\n }\n\n function mockBrowserHistory(overrides, assert) {\n return (0, _polyfills.assign)({\n pushState() {\n assert.ok(false, 'history.pushState should not be called during testing');\n },\n replaceState() {\n assert.ok(false, 'history.replaceState should not be called during testing');\n }\n }, overrides);\n }\n\n function createLocation(location, history) {\n owner = (0, _internalTestHelpers.buildOwner)();\n\n owner.register('location:history', _history_location.default);\n owner.register('location:hash', _hash_location.default);\n owner.register('location:none', _none_location.default);\n\n let autolocation = _auto_location.default.create({\n [_owner.OWNER]: owner,\n location: location,\n history: history,\n global: {}\n });\n\n return autolocation;\n }\n\n let location, owner;\n\n (0, _internalTestHelpers.moduleFor)('AutoLocation', class extends _internalTestHelpers.AbstractTestCase {\n teardown() {\n if (owner) {\n (0, _runloop.run)(owner, 'destroy');\n owner = location = undefined;\n }\n }\n\n ['@test AutoLocation should have the `global`'](assert) {\n let location = _auto_location.default.create();\n\n assert.ok(location.global, 'has a global defined');\n assert.strictEqual(location.global, _browserEnvironment.window, 'has the environments window global');\n }\n\n [\"@test AutoLocation should return concrete implementation's value for `getURL`\"](assert) {\n let browserLocation = mockBrowserLocation({}, assert);\n let browserHistory = mockBrowserHistory({}, assert);\n\n location = createLocation(browserLocation, browserHistory);\n location.detect();\n\n let concreteImplementation = (0, _metal.get)(location, 'concreteImplementation');\n\n concreteImplementation.getURL = function () {\n return '/lincoln/park';\n };\n\n assert.equal(location.getURL(), '/lincoln/park');\n }\n\n ['@test AutoLocation should use a HistoryLocation instance when pushStates is supported'](assert) {\n let browserLocation = mockBrowserLocation({}, assert);\n let browserHistory = mockBrowserHistory({}, assert);\n\n location = createLocation(browserLocation, browserHistory);\n location.detect();\n\n assert.ok((0, _metal.get)(location, 'concreteImplementation') instanceof _history_location.default);\n }\n\n ['@test AutoLocation should use a HashLocation instance when pushStates are not supported, but hashchange events are and the URL is already in the HashLocation format'](assert) {\n let browserLocation = mockBrowserLocation({\n hash: '#/testd'\n }, assert);\n\n location = createLocation(browserLocation);\n location.global = {\n onhashchange() {}\n };\n\n location.detect();\n assert.ok((0, _metal.get)(location, 'concreteImplementation') instanceof _hash_location.default);\n }\n\n ['@test AutoLocation should use a NoneLocation instance when neither history nor hashchange are supported.'](assert) {\n location = createLocation(mockBrowserLocation({}, assert));\n location.detect();\n\n assert.ok((0, _metal.get)(location, 'concreteImplementation') instanceof _none_location.default);\n }\n\n [\"@test AutoLocation should use an index path (i.e. '/') without any location.hash as OK for HashLocation\"](assert) {\n let browserLocation = mockBrowserLocation({\n href: 'http://test.com/',\n pathname: '/',\n hash: '',\n search: '',\n replace() {\n assert.ok(false, 'location.replace should not be called');\n }\n }, assert);\n\n location = createLocation(browserLocation);\n location.global = {\n onhashchange() {}\n };\n\n location.detect();\n\n assert.ok((0, _metal.get)(location, 'concreteImplementation') instanceof _hash_location.default, 'uses a HashLocation');\n }\n\n ['@test AutoLocation should transform the URL for hashchange-only browsers viewing a HistoryLocation-formatted path'](assert) {\n assert.expect(3);\n\n let browserLocation = mockBrowserLocation({\n hash: '',\n hostname: 'test.com',\n href: 'http://test.com/test',\n pathname: '/test',\n protocol: 'http:',\n port: '',\n search: '',\n replace(path) {\n assert.equal(path, 'http://test.com/#/test', 'location.replace should be called with normalized HashLocation path');\n }\n }, assert);\n\n let location = createLocation(browserLocation);\n location.global = {\n onhashchange() {}\n };\n\n location.detect();\n\n assert.ok((0, _metal.get)(location, 'concreteImplementation') instanceof _none_location.default, 'NoneLocation should be used while we attempt to location.replace()');\n assert.equal((0, _metal.get)(location, 'cancelRouterSetup'), true, 'cancelRouterSetup should be set so the router knows.');\n }\n\n ['@test AutoLocation should replace the URL for pushState-supported browsers viewing a HashLocation-formatted url'](assert) {\n assert.expect(2);\n let browserLocation = mockBrowserLocation({\n hash: '#/test',\n hostname: 'test.com',\n href: 'http://test.com/#/test',\n pathname: '/',\n protocol: 'http:',\n port: '',\n search: ''\n }, assert);\n\n let browserHistory = mockBrowserHistory({\n replaceState(state, title, path) {\n assert.equal(path, '/test', 'history.replaceState should be called with normalized HistoryLocation url');\n }\n }, assert);\n\n let location = createLocation(browserLocation, browserHistory);\n location.detect();\n\n assert.ok((0, _metal.get)(location, 'concreteImplementation'), _history_location.default);\n }\n\n ['@test AutoLocation requires any rootURL given to end in a trailing forward slash'](assert) {\n let browserLocation = mockBrowserLocation({}, assert);\n let expectedMsg = /rootURL must end with a trailing forward slash e.g. \"\\/app\\/\"/;\n\n location = createLocation(browserLocation);\n location.rootURL = 'app';\n\n expectAssertion(function () {\n location.detect();\n }, expectedMsg);\n\n location.rootURL = '/app';\n expectAssertion(function () {\n location.detect();\n }, expectedMsg);\n\n // Note the trailing whitespace\n location.rootURL = '/app/ ';\n expectAssertion(function () {\n location.detect();\n }, expectedMsg);\n }\n\n ['@test AutoLocation provides its rootURL to the concreteImplementation'](assert) {\n let browserLocation = mockBrowserLocation({\n pathname: '/some/subdir/derp'\n }, assert);\n let browserHistory = mockBrowserHistory({}, assert);\n\n location = createLocation(browserLocation, browserHistory);\n location.rootURL = '/some/subdir/';\n\n location.detect();\n\n let concreteLocation = (0, _metal.get)(location, 'concreteImplementation');\n assert.equal(location.rootURL, concreteLocation.rootURL);\n }\n\n ['@test getHistoryPath() should return a normalized, HistoryLocation-supported path'](assert) {\n let browserLocation = mockBrowserLocation({\n href: 'http://test.com/app/about?foo=bar#foo',\n pathname: '/app/about',\n search: '?foo=bar',\n hash: '#foo'\n }, assert);\n\n assert.equal((0, _auto_location.getHistoryPath)('/app/', browserLocation), '/app/about?foo=bar#foo', 'URLs already in HistoryLocation form should come out the same');\n\n browserLocation = mockBrowserLocation({\n href: 'http://test.com/app/#/about?foo=bar#foo',\n pathname: '/app/',\n search: '',\n hash: '#/about?foo=bar#foo'\n }, assert);\n assert.equal((0, _auto_location.getHistoryPath)('/app/', browserLocation), '/app/about?foo=bar#foo', 'HashLocation formed URLs should be normalized');\n\n browserLocation = mockBrowserLocation({\n href: 'http://test.com/app/#about?foo=bar#foo',\n pathname: '/app/',\n search: '',\n hash: '#about?foo=bar#foo'\n }, assert);\n assert.equal((0, _auto_location.getHistoryPath)('/app', browserLocation), '/app/#about?foo=bar#foo', \"URLs with a hash not following #/ convention shouldn't be normalized as a route\");\n }\n\n ['@test getHashPath() should return a normalized, HashLocation-supported path'](assert) {\n let browserLocation = mockBrowserLocation({\n href: 'http://test.com/app/#/about?foo=bar#foo',\n pathname: '/app/',\n search: '',\n hash: '#/about?foo=bar#foo'\n }, assert);\n assert.equal((0, _auto_location.getHashPath)('/app/', browserLocation), '/app/#/about?foo=bar#foo', 'URLs already in HistoryLocation form should come out the same');\n\n browserLocation = mockBrowserLocation({\n href: 'http://test.com/app/about?foo=bar#foo',\n pathname: '/app/about',\n search: '?foo=bar',\n hash: '#foo'\n }, assert);\n assert.equal((0, _auto_location.getHashPath)('/app/', browserLocation), '/app/#/about?foo=bar#foo', 'HistoryLocation formed URLs should be normalized');\n\n browserLocation = mockBrowserLocation({\n href: 'http://test.com/app/#about?foo=bar#foo',\n pathname: '/app/',\n search: '',\n hash: '#about?foo=bar#foo'\n }, assert);\n\n assert.equal((0, _auto_location.getHashPath)('/app/', browserLocation), '/app/#/#about?foo=bar#foo', \"URLs with a hash not following #/ convention shouldn't be normalized as a route\");\n }\n });\n});","enifed('@ember/-internals/routing/tests/location/hash_location_test', ['@ember/runloop', '@ember/-internals/metal', '@ember/-internals/routing/lib/location/hash_location', 'internal-test-helpers'], function (_runloop, _metal, _hash_location, _internalTestHelpers) {\n 'use strict';\n\n let location;\n\n function createLocation(options, assert) {\n let HashTestLocation = _hash_location.default.extend({\n _location: {\n href: 'http://test.com/',\n pathname: '/',\n hash: '',\n search: '',\n replace() {\n assert.ok(false, 'location.replace should not be called during testing');\n }\n }\n });\n\n if (!options) {\n options = {};\n }\n location = HashTestLocation.create(options);\n }\n\n function mockBrowserLocation(path) {\n // This is a neat trick to auto-magically extract the hostname from any\n // url by letting the browser do the work ;)\n let tmp = document.createElement('a');\n tmp.href = path;\n\n let protocol = !tmp.protocol || tmp.protocol === ':' ? 'http' : tmp.protocol;\n let pathname = tmp.pathname.match(/^\\//) ? tmp.pathname : '/' + tmp.pathname;\n\n return {\n hash: tmp.hash,\n host: tmp.host || 'localhost',\n hostname: tmp.hostname || 'localhost',\n href: tmp.href,\n pathname: pathname,\n port: tmp.port || '',\n protocol: protocol,\n search: tmp.search\n };\n }\n\n function triggerHashchange() {\n var event = document.createEvent('HTMLEvents');\n event.initEvent('hashchange', true, false);\n window.dispatchEvent(event);\n }\n\n (0, _internalTestHelpers.moduleFor)('HashLocation', class extends _internalTestHelpers.AbstractTestCase {\n teardown() {\n (0, _runloop.run)(function () {\n if (location) {\n location.destroy();\n }\n });\n }\n\n ['@test HashLocation.getURL() returns the current url'](assert) {\n createLocation({\n _location: mockBrowserLocation('/#/foo/bar')\n }, assert);\n\n assert.equal(location.getURL(), '/foo/bar');\n }\n\n ['@test HashLocation.getURL() includes extra hashes'](assert) {\n createLocation({\n _location: mockBrowserLocation('/#/foo#bar#car')\n }, assert);\n\n assert.equal(location.getURL(), '/foo#bar#car');\n }\n\n ['@test HashLocation.getURL() assumes location.hash without #/ prefix is not a route path'](assert) {\n createLocation({\n _location: mockBrowserLocation('/#foo#bar')\n }, assert);\n\n assert.equal(location.getURL(), '/#foo#bar');\n }\n\n ['@test HashLocation.getURL() returns a normal forward slash when there is no location.hash'](assert) {\n createLocation({\n _location: mockBrowserLocation('/')\n }, assert);\n\n assert.equal(location.getURL(), '/');\n }\n\n ['@test HashLocation.setURL() correctly sets the url'](assert) {\n createLocation({}, assert);\n\n location.setURL('/bar');\n\n assert.equal((0, _metal.get)(location, 'location.hash'), '/bar');\n assert.equal((0, _metal.get)(location, 'lastSetURL'), '/bar');\n }\n\n ['@test HashLocation.replaceURL() correctly replaces to the path with a page reload'](assert) {\n assert.expect(2);\n\n createLocation({\n _location: {\n replace(path) {\n assert.equal(path, '#/foo');\n }\n }\n }, assert);\n\n location.replaceURL('/foo');\n\n assert.equal((0, _metal.get)(location, 'lastSetURL'), '/foo');\n }\n\n ['@test HashLocation.onUpdateURL callback executes as expected'](assert) {\n assert.expect(1);\n\n createLocation({\n _location: mockBrowserLocation('/#/foo/bar')\n }, assert);\n\n let callback = function (param) {\n assert.equal(param, '/foo/bar', 'path is passed as param');\n };\n\n location.onUpdateURL(callback);\n\n triggerHashchange();\n }\n\n [\"@test HashLocation.onUpdateURL doesn't execute callback if lastSetURL === path\"](assert) {\n assert.expect(0);\n\n createLocation({\n _location: {\n hash: '#/foo/bar'\n },\n lastSetURL: '/foo/bar'\n }, assert);\n\n let callback = function () {\n assert.ok(false, 'callback should not be called');\n };\n\n location.onUpdateURL(callback);\n\n triggerHashchange();\n }\n\n ['@test HashLocation.formatURL() prepends a # to the provided string'](assert) {\n createLocation({}, assert);\n\n assert.equal(location.formatURL('/foo#bar'), '#/foo#bar');\n }\n\n ['@test HashLocation.willDestroy() cleans up hashchange event listener'](assert) {\n assert.expect(1);\n\n createLocation({}, assert);\n\n let callback = function () {\n assert.ok(true, 'should invoke callback once');\n };\n\n location.onUpdateURL(callback);\n\n triggerHashchange();\n\n (0, _runloop.run)(location, 'destroy');\n location = null;\n\n triggerHashchange();\n }\n });\n});","enifed('@ember/-internals/routing/tests/location/history_location_test', ['@ember/runloop', '@ember/-internals/metal', '@ember/-internals/routing/lib/location/history_location', 'internal-test-helpers'], function (_runloop, _metal, _history_location, _internalTestHelpers) {\n 'use strict';\n\n let FakeHistory, HistoryTestLocation, location;\n\n function createLocation(options) {\n if (!options) {\n options = {};\n }\n location = HistoryTestLocation.create(options);\n }\n\n function mockBrowserLocation(path) {\n // This is a neat trick to auto-magically extract the hostname from any\n // url by letting the browser do the work ;)\n let tmp = document.createElement('a');\n tmp.href = path;\n\n let protocol = !tmp.protocol || tmp.protocol === ':' ? 'http' : tmp.protocol;\n let pathname = tmp.pathname.match(/^\\//) ? tmp.pathname : '/' + tmp.pathname;\n\n return {\n hash: tmp.hash,\n host: tmp.host || 'localhost',\n hostname: tmp.hostname || 'localhost',\n href: tmp.href,\n pathname: pathname,\n port: tmp.port || '',\n protocol: protocol,\n search: tmp.search\n };\n }\n\n (0, _internalTestHelpers.moduleFor)('HistoryLocation', class extends _internalTestHelpers.AbstractTestCase {\n constructor() {\n super();\n\n FakeHistory = {\n state: null,\n _states: [],\n replaceState(state) {\n this.state = state;\n this._states[0] = state;\n },\n pushState(state) {\n this.state = state;\n this._states.unshift(state);\n }\n };\n\n HistoryTestLocation = _history_location.default.extend({\n history: FakeHistory\n });\n }\n\n teardown() {\n (0, _runloop.run)(() => {\n if (location) {\n location.destroy();\n }\n });\n }\n\n ['@test HistoryLocation initState does not get fired on init'](assert) {\n assert.expect(1);\n\n HistoryTestLocation.reopen({\n init() {\n assert.ok(true, 'init was called');\n this._super(...arguments);\n },\n initState() {\n assert.ok(false, 'initState() should not be called automatically');\n }\n });\n\n createLocation();\n }\n\n [\"@test webkit doesn't fire popstate on page load\"](assert) {\n assert.expect(1);\n\n HistoryTestLocation.reopen({\n initState() {\n this._super(...arguments);\n // these two should be equal to be able\n // to successfully detect webkit initial popstate\n assert.equal(this._previousURL, this.getURL());\n }\n });\n\n createLocation();\n location.initState();\n }\n\n ['@test base URL is removed when retrieving the current pathname'](assert) {\n assert.expect(1);\n\n HistoryTestLocation.reopen({\n init() {\n this._super(...arguments);\n\n (0, _metal.set)(this, 'location', mockBrowserLocation('/base/foo/bar'));\n (0, _metal.set)(this, 'baseURL', '/base/');\n },\n\n initState() {\n this._super(...arguments);\n\n assert.equal(this.getURL(), '/foo/bar');\n }\n });\n\n createLocation();\n location.initState();\n }\n\n ['@test base URL is preserved when moving around'](assert) {\n assert.expect(2);\n\n HistoryTestLocation.reopen({\n init() {\n this._super(...arguments);\n\n (0, _metal.set)(this, 'location', mockBrowserLocation('/base/foo/bar'));\n (0, _metal.set)(this, 'baseURL', '/base/');\n }\n });\n\n createLocation();\n location.initState();\n location.setURL('/one/two');\n\n assert.equal(location._historyState.path, '/base/one/two');\n assert.ok(location._historyState.uuid);\n }\n\n ['@test setURL continues to set even with a null state (iframes may set this)'](assert) {\n createLocation();\n location.initState();\n\n FakeHistory.pushState(null);\n location.setURL('/three/four');\n\n assert.equal(location._historyState.path, '/three/four');\n assert.ok(location._historyState.uuid);\n }\n\n ['@test replaceURL continues to set even with a null state (iframes may set this)'](assert) {\n createLocation();\n location.initState();\n\n FakeHistory.pushState(null);\n location.replaceURL('/three/four');\n\n assert.equal(location._historyState.path, '/three/four');\n assert.ok(location._historyState.uuid);\n }\n\n ['@test HistoryLocation.getURL() returns the current url, excluding both rootURL and baseURL'](assert) {\n HistoryTestLocation.reopen({\n init() {\n this._super(...arguments);\n\n (0, _metal.set)(this, 'location', mockBrowserLocation('/base/foo/bar'));\n (0, _metal.set)(this, 'rootURL', '/app/');\n (0, _metal.set)(this, 'baseURL', '/base/');\n }\n });\n\n createLocation();\n\n assert.equal(location.getURL(), '/foo/bar');\n }\n\n ['@test HistoryLocation.getURL() returns the current url, does not remove rootURL if its not at start of url'](assert) {\n HistoryTestLocation.reopen({\n init() {\n this._super(...arguments);\n\n (0, _metal.set)(this, 'location', mockBrowserLocation('/foo/bar/baz'));\n (0, _metal.set)(this, 'rootURL', '/bar/');\n }\n });\n\n createLocation();\n\n assert.equal(location.getURL(), '/foo/bar/baz');\n }\n\n ['@test HistoryLocation.getURL() will not remove the rootURL when only a partial match'](assert) {\n HistoryTestLocation.reopen({\n init() {\n this._super(...arguments);\n (0, _metal.set)(this, 'location', mockBrowserLocation('/bars/baz'));\n (0, _metal.set)(this, 'rootURL', '/bar/');\n }\n });\n\n createLocation();\n\n assert.equal(location.getURL(), '/bars/baz');\n }\n\n ['@test HistoryLocation.getURL() returns the current url, does not remove baseURL if its not at start of url'](assert) {\n HistoryTestLocation.reopen({\n init() {\n this._super(...arguments);\n\n (0, _metal.set)(this, 'location', mockBrowserLocation('/foo/bar/baz'));\n (0, _metal.set)(this, 'baseURL', '/bar/');\n }\n });\n\n createLocation();\n\n assert.equal(location.getURL(), '/foo/bar/baz');\n }\n\n ['@test HistoryLocation.getURL() will not remove the baseURL when only a partial match'](assert) {\n HistoryTestLocation.reopen({\n init() {\n this._super(...arguments);\n (0, _metal.set)(this, 'location', mockBrowserLocation('/bars/baz'));\n (0, _metal.set)(this, 'baseURL', '/bar/');\n }\n });\n\n createLocation();\n\n assert.equal(location.getURL(), '/bars/baz');\n }\n\n ['@test HistoryLocation.getURL() includes location.search'](assert) {\n HistoryTestLocation.reopen({\n init() {\n this._super(...arguments);\n (0, _metal.set)(this, 'location', mockBrowserLocation('/foo/bar?time=morphin'));\n }\n });\n\n createLocation();\n\n assert.equal(location.getURL(), '/foo/bar?time=morphin');\n }\n\n ['@test HistoryLocation.getURL() includes location.hash'](assert) {\n HistoryTestLocation.reopen({\n init() {\n this._super(...arguments);\n (0, _metal.set)(this, 'location', mockBrowserLocation('/foo/bar#pink-power-ranger'));\n }\n });\n\n createLocation();\n\n assert.equal(location.getURL(), '/foo/bar#pink-power-ranger');\n }\n\n ['@test HistoryLocation.getURL() includes location.hash and location.search'](assert) {\n HistoryTestLocation.reopen({\n init() {\n this._super(...arguments);\n (0, _metal.set)(this, 'location', mockBrowserLocation('/foo/bar?time=morphin#pink-power-ranger'));\n }\n });\n\n createLocation();\n\n assert.equal(location.getURL(), '/foo/bar?time=morphin#pink-power-ranger');\n }\n\n ['@test HistoryLocation.getURL() drops duplicate slashes'](assert) {\n HistoryTestLocation.reopen({\n init() {\n this._super(...arguments);\n let location = mockBrowserLocation('//');\n location.pathname = '//'; // mockBrowserLocation does not allow for `//`, so force it\n (0, _metal.set)(this, 'location', location);\n }\n });\n\n createLocation();\n\n assert.equal(location.getURL(), '/');\n }\n\n ['@test Existing state is preserved on init'](assert) {\n let existingState = {\n path: '/route/path',\n uuid: 'abcd'\n };\n\n FakeHistory.state = existingState;\n\n HistoryTestLocation.reopen({\n init() {\n this._super(...arguments);\n (0, _metal.set)(this, 'location', mockBrowserLocation('/route/path'));\n }\n });\n\n createLocation();\n location.initState();\n assert.deepEqual(location.getState(), existingState);\n }\n });\n});","enifed('@ember/-internals/routing/tests/location/none_location_test', ['@ember/runloop', '@ember/-internals/metal', '@ember/-internals/routing/lib/location/none_location', 'internal-test-helpers'], function (_runloop, _metal, _none_location, _internalTestHelpers) {\n 'use strict';\n\n let NoneTestLocation, location;\n\n function createLocation(options) {\n if (!options) {\n options = {};\n }\n location = NoneTestLocation.create(options);\n }\n\n (0, _internalTestHelpers.moduleFor)('NoneLocation', class extends _internalTestHelpers.AbstractTestCase {\n constructor() {\n super();\n NoneTestLocation = _none_location.default.extend({});\n }\n\n teardown() {\n (0, _runloop.run)(() => {\n if (location) {\n location.destroy();\n }\n });\n }\n\n ['@test NoneLocation.formatURL() returns the current url always appending rootURL'](assert) {\n NoneTestLocation.reopen({\n init() {\n this._super(...arguments);\n (0, _metal.set)(this, 'rootURL', '/en/');\n }\n });\n\n createLocation();\n\n assert.equal(location.formatURL('/foo/bar'), '/en/foo/bar');\n }\n\n ['@test NoneLocation.getURL() returns the current path minus rootURL'](assert) {\n NoneTestLocation.reopen({\n init() {\n this._super(...arguments);\n (0, _metal.set)(this, 'rootURL', '/foo/');\n (0, _metal.set)(this, 'path', '/foo/bar');\n }\n });\n\n createLocation();\n\n assert.equal(location.getURL(), '/bar');\n }\n\n ['@test NoneLocation.getURL() will remove the rootURL only from the beginning of a url'](assert) {\n NoneTestLocation.reopen({\n init() {\n this._super(...arguments);\n (0, _metal.set)(this, 'rootURL', '/bar/');\n (0, _metal.set)(this, 'path', '/foo/bar/baz');\n }\n });\n\n createLocation();\n\n assert.equal(location.getURL(), '/foo/bar/baz');\n }\n\n ['@test NoneLocation.getURL() will not remove the rootURL when only a partial match'](assert) {\n NoneTestLocation.reopen({\n init() {\n this._super(...arguments);\n (0, _metal.set)(this, 'rootURL', '/bar/');\n (0, _metal.set)(this, 'path', '/bars/baz');\n }\n });\n\n createLocation();\n\n assert.equal(location.getURL(), '/bars/baz');\n }\n });\n});","enifed('@ember/-internals/routing/tests/location/util_test', ['@ember/polyfills', '@ember/-internals/routing/lib/location/util', 'internal-test-helpers'], function (_polyfills, _util, _internalTestHelpers) {\n 'use strict';\n\n function mockBrowserLocation(overrides, assert) {\n return (0, _polyfills.assign)({\n href: 'http://test.com/',\n pathname: '/',\n hash: '',\n search: '',\n replace() {\n assert.ok(false, 'location.replace should not be called during testing');\n }\n }, overrides);\n }\n\n (0, _internalTestHelpers.moduleFor)('Location Utilities', class extends _internalTestHelpers.AbstractTestCase {\n ['@test replacePath cannot be used to redirect to a different origin'](assert) {\n assert.expect(1);\n\n let expectedURL;\n\n let location = {\n protocol: 'http:',\n hostname: 'emberjs.com',\n port: '1337',\n\n replace(url) {\n assert.equal(url, expectedURL);\n }\n };\n\n expectedURL = 'http://emberjs.com:1337//google.com';\n (0, _util.replacePath)(location, '//google.com');\n }\n\n ['@test getPath() should normalize location.pathname, making sure it always returns a leading slash'](assert) {\n let location = mockBrowserLocation({ pathname: 'test' }, assert);\n assert.equal((0, _util.getPath)(location), '/test', 'When there is no leading slash, one is added.');\n\n location = mockBrowserLocation({ pathname: '/test' }, assert);\n assert.equal((0, _util.getPath)(location), '/test', \"When a leading slash is already there, it isn't added again\");\n }\n\n ['@test getQuery() should return location.search as-is'](assert) {\n let location = mockBrowserLocation({ search: '?foo=bar' }, assert);\n assert.equal((0, _util.getQuery)(location), '?foo=bar');\n }\n\n ['@test getFullPath() should return full pathname including query and hash'](assert) {\n let location = mockBrowserLocation({\n href: 'http://test.com/about?foo=bar#foo',\n pathname: '/about',\n search: '?foo=bar',\n hash: '#foo'\n }, assert);\n\n assert.equal((0, _util.getFullPath)(location), '/about?foo=bar#foo');\n }\n\n ['@test Feature-Detecting onhashchange'](assert) {\n assert.equal((0, _util.supportsHashChange)(undefined, { onhashchange() {} }), true, 'When not in IE, use onhashchange existence as evidence of the feature');\n assert.equal((0, _util.supportsHashChange)(undefined, {}), false, 'When not in IE, use onhashchange absence as evidence of the feature absence');\n assert.equal((0, _util.supportsHashChange)(7, { onhashchange() {} }), false, 'When in IE7 compatibility mode, never report existence of the feature');\n assert.equal((0, _util.supportsHashChange)(8, { onhashchange() {} }), true, 'When in IE8+, use onhashchange existence as evidence of the feature');\n }\n\n ['@test Feature-detecting the history API'](assert) {\n assert.equal((0, _util.supportsHistory)('', { pushState: true }), true, 'returns true if not Android Gingerbread and history.pushState exists');\n assert.equal((0, _util.supportsHistory)('', {}), false, \"returns false if history.pushState doesn't exist\");\n assert.equal((0, _util.supportsHistory)('', undefined), false, \"returns false if history doesn't exist\");\n\n assert.equal((0, _util.supportsHistory)('Mozilla/5.0 (Linux; U; Android 2.3.5; en-us; HTC Vision Build/GRI40) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1', { pushState: true }), false, 'returns false if Android 2.x stock browser (not Chrome) claiming to support pushState');\n\n assert.equal((0, _util.supportsHistory)('Mozilla/5.0 (Linux; U; Android 4.0.3; nl-nl; GT-N7000 Build/IML74K) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30', { pushState: true }), false, 'returns false for Android 4.0.x stock browser (not Chrome) claiming to support pushState');\n\n assert.equal((0, _util.supportsHistory)('Mozilla/5.0 (Linux; U; Android 20.3.5; en-us; HTC Vision Build/GRI40) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1', { pushState: true }), true, 'returns true if Android version begins with 2, but is greater than 2');\n\n assert.equal((0, _util.supportsHistory)('Mozilla/5.0 (Linux; Android 4.0.4; Galaxy Nexus Build/IMM76B) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.133 Mobile Safari/535.19', { pushState: true }), true, 'returns true for Chrome (not stock browser) on Android 4.0.x');\n\n // Windows Phone UA and History API: https://github.com/Modernizr/Modernizr/issues/1471\n assert.equal((0, _util.supportsHistory)('Mozilla/5.0 (Mobile; Windows Phone 8.1; Android 4.0; ARM; Trident/7.0; Touch; rv:11.0; IEMobile/11.0; Microsoft; Virtual) like iPhone OS 7_0_3 Mac OS X AppleWebKit/537 (KHTML, like Gecko) Mobile Safari/537', { pushState: true }), true, 'returns true for Windows Phone 8.1 with misleading user agent string');\n }\n });\n});","enifed('@ember/-internals/routing/tests/system/cache_test', ['@ember/-internals/routing/lib/system/cache', 'internal-test-helpers'], function (_cache, _internalTestHelpers) {\n 'use strict';\n\n (0, _internalTestHelpers.moduleFor)('BucketCache', class extends _internalTestHelpers.AbstractTestCase {\n constructor() {\n super();\n\n this.cache = new _cache.default();\n }\n\n ['@test has - returns false when bucket is not in cache'](assert) {\n assert.strictEqual(this.cache.has('foo'), false);\n assert.strictEqual(this.cache.has('constructor'), false);\n }\n\n ['@test has - returns true when bucket is in cache'](assert) {\n let token = {};\n\n this.cache.stash('foo', 'bar', token);\n this.cache.stash('constructor', 'bar', token);\n\n assert.strictEqual(this.cache.has('foo'), true);\n assert.strictEqual(this.cache.has('constructor'), true);\n }\n\n ['@test lookup - returns stashed value if key does exist in bucket'](assert) {\n let token = {};\n let defaultValue = {};\n\n this.cache.stash('foo', 'bar', token);\n\n assert.strictEqual(this.cache.lookup('foo', 'bar', defaultValue), token);\n }\n\n ['@test lookup - returns default value if key does not exist in bucket'](assert) {\n let token = {};\n let defaultValue = {};\n\n this.cache.stash('foo', 'bar', token);\n\n assert.strictEqual(this.cache.lookup('foo', 'boo', defaultValue), defaultValue);\n assert.strictEqual(this.cache.lookup('foo', 'constructor', defaultValue), defaultValue);\n }\n\n ['@test lookup - returns default value if bucket does not exist'](assert) {\n let defaultValue = {};\n\n assert.strictEqual(this.cache.lookup('boo', 'bar', defaultValue), defaultValue);\n assert.strictEqual(this.cache.lookup('constructor', 'bar', defaultValue), defaultValue);\n }\n });\n});","enifed('@ember/-internals/routing/tests/system/controller_for_test', ['@ember/controller', '@ember/-internals/routing/lib/system/controller_for', '@ember/-internals/routing/lib/system/generate_controller', 'internal-test-helpers', '@ember/debug'], function (_controller, _controller_for, _generate_controller, _internalTestHelpers, _debug) {\n 'use strict';\n\n const originalDebug = (0, _debug.getDebugFunction)('debug');\n const noop = function () {};\n\n (0, _internalTestHelpers.moduleFor)('controllerFor', class extends _internalTestHelpers.ApplicationTestCase {\n constructor() {\n (0, _debug.setDebugFunction)('debug', noop);\n super();\n }\n\n teardown() {\n (0, _debug.setDebugFunction)('debug', originalDebug);\n }\n\n ['@test controllerFor should lookup for registered controllers'](assert) {\n this.add('controller:app', _controller.default.extend());\n\n return this.visit('/').then(() => {\n let appInstance = this.applicationInstance;\n let appController = appInstance.lookup('controller:app');\n let controller = (0, _controller_for.default)(appInstance, 'app');\n assert.equal(appController, controller, 'should find app controller');\n });\n }\n });\n\n (0, _internalTestHelpers.moduleFor)('generateController', class extends _internalTestHelpers.ApplicationTestCase {\n constructor() {\n (0, _debug.setDebugFunction)('debug', noop);\n super();\n }\n\n teardown() {\n (0, _debug.setDebugFunction)('debug', originalDebug);\n }\n\n ['@test generateController should return Controller'](assert) {\n return this.visit('/').then(() => {\n let controller = (0, _generate_controller.default)(this.applicationInstance, 'home');\n assert.ok(controller instanceof _controller.default, 'should return controller');\n });\n }\n\n ['@test generateController should return controller:basic if resolved'](assert) {\n let BasicController = _controller.default.extend();\n this.add('controller:basic', BasicController);\n\n return this.visit('/').then(() => {\n let controller = (0, _generate_controller.default)(this.applicationInstance, 'home');\n assert.ok(controller instanceof BasicController, 'should return controller');\n });\n }\n\n ['@test generateController should return controller:basic if registered'](assert) {\n let BasicController = _controller.default.extend();\n this.application.register('controller:basic', BasicController);\n\n return this.visit('/').then(() => {\n let controller = (0, _generate_controller.default)(this.applicationInstance, 'home');\n\n assert.ok(controller instanceof BasicController, 'should return base class of controller');\n });\n }\n });\n});","enifed('@ember/-internals/routing/tests/system/dsl_test', ['@ember/-internals/owner', '@ember/-internals/routing/lib/system/router', 'internal-test-helpers'], function (_owner, _router, _internalTestHelpers) {\n 'use strict';\n\n let Router;\n\n (0, _internalTestHelpers.moduleFor)('Ember Router DSL', class extends _internalTestHelpers.AbstractTestCase {\n constructor() {\n super();\n Router = _router.default.extend();\n }\n\n teardown() {\n Router = null;\n }\n\n ['@test should fail when using a reserved route name'](assert) {\n let reservedNames = ['basic', 'application'];\n\n assert.expect(reservedNames.length);\n\n reservedNames.forEach(reservedName => {\n expectAssertion(() => {\n Router = _router.default.extend();\n\n Router.map(function () {\n this.route(reservedName);\n });\n\n let router = Router.create();\n router._initRouterJs();\n }, \"'\" + reservedName + \"' cannot be used as a route name.\");\n });\n }\n\n ['@test [GH#16642] better error when using a colon in a route name']() {\n expectAssertion(() => {\n Router = _router.default.extend();\n\n Router.map(function () {\n this.route('resource/:id');\n });\n\n let router = Router.create();\n router._initRouterJs();\n }, \"'resource/:id' is not a valid route name. It cannot contain a ':'. You may want to use the 'path' option instead.\");\n }\n\n ['@test should retain resource namespace if nested with routes'](assert) {\n Router = Router.map(function () {\n this.route('bleep', function () {\n this.route('bloop', function () {\n this.route('blork');\n });\n });\n });\n\n let router = Router.create();\n router._initRouterJs();\n\n assert.ok(router._routerMicrolib.recognizer.names['bleep'], 'parent name was used as base of nested routes');\n assert.ok(router._routerMicrolib.recognizer.names['bleep.bloop'], 'parent name was used as base of nested routes');\n assert.ok(router._routerMicrolib.recognizer.names['bleep.bloop.blork'], 'parent name was used as base of nested routes');\n }\n\n ['@test should add loading and error routes if _isRouterMapResult is true'](assert) {\n Router.map(function () {\n this.route('blork');\n });\n\n let router = Router.create({\n _hasModuleBasedResolver() {\n return true;\n }\n });\n\n router._initRouterJs();\n\n assert.ok(router._routerMicrolib.recognizer.names['blork'], 'main route was created');\n assert.ok(router._routerMicrolib.recognizer.names['blork_loading'], 'loading route was added');\n assert.ok(router._routerMicrolib.recognizer.names['blork_error'], 'error route was added');\n }\n\n ['@test should not add loading and error routes if _isRouterMapResult is false'](assert) {\n Router.map(function () {\n this.route('blork');\n });\n\n let router = Router.create();\n router._initRouterJs(false);\n\n assert.ok(router._routerMicrolib.recognizer.names['blork'], 'main route was created');\n assert.ok(!router._routerMicrolib.recognizer.names['blork_loading'], 'loading route was not added');\n assert.ok(!router._routerMicrolib.recognizer.names['blork_error'], 'error route was not added');\n }\n\n ['@test should reset namespace of loading and error routes for routes with resetNamespace'](assert) {\n Router.map(function () {\n this.route('blork', function () {\n this.route('blorp');\n this.route('bleep', { resetNamespace: true });\n });\n });\n\n let router = Router.create({\n _hasModuleBasedResolver() {\n return true;\n }\n });\n\n router._initRouterJs();\n\n assert.ok(router._routerMicrolib.recognizer.names['blork.blorp'], 'nested route was created');\n assert.ok(router._routerMicrolib.recognizer.names['blork.blorp_loading'], 'nested loading route was added');\n assert.ok(router._routerMicrolib.recognizer.names['blork.blorp_error'], 'nested error route was added');\n\n assert.ok(router._routerMicrolib.recognizer.names['bleep'], 'reset route was created');\n assert.ok(router._routerMicrolib.recognizer.names['bleep_loading'], 'reset loading route was added');\n assert.ok(router._routerMicrolib.recognizer.names['bleep_error'], 'reset error route was added');\n\n assert.ok(!router._routerMicrolib.recognizer.names['blork.bleep'], 'nested reset route was not created');\n assert.ok(!router._routerMicrolib.recognizer.names['blork.bleep_loading'], 'nested reset loading route was not added');\n assert.ok(!router._routerMicrolib.recognizer.names['blork.bleep_error'], 'nested reset error route was not added');\n }\n\n ['@test should throw an error when defining a route serializer outside an engine'](assert) {\n Router.map(function () {\n assert.throws(() => {\n this.route('posts', { serialize: function () {} });\n }, /Defining a route serializer on route 'posts' outside an Engine is not allowed/);\n });\n\n Router.create()._initRouterJs();\n }\n });\n\n (0, _internalTestHelpers.moduleFor)('Ember Router DSL with engines', class extends _internalTestHelpers.AbstractTestCase {\n constructor() {\n super();\n Router = _router.default.extend();\n }\n\n teardown() {\n Router = null;\n }\n\n ['@test should allow mounting of engines'](assert) {\n assert.expect(3);\n\n Router = Router.map(function () {\n this.route('bleep', function () {\n this.route('bloop', function () {\n this.mount('chat');\n });\n });\n });\n\n let engineInstance = (0, _internalTestHelpers.buildOwner)({\n ownerOptions: { routable: true }\n });\n\n let router = Router.create();\n (0, _owner.setOwner)(router, engineInstance);\n router._initRouterJs();\n\n assert.ok(router._routerMicrolib.recognizer.names['bleep'], 'parent name was used as base of nested routes');\n assert.ok(router._routerMicrolib.recognizer.names['bleep.bloop'], 'parent name was used as base of nested routes');\n assert.ok(router._routerMicrolib.recognizer.names['bleep.bloop.chat'], 'parent name was used as base of mounted engine');\n }\n\n ['@test should allow mounting of engines at a custom path'](assert) {\n assert.expect(1);\n\n Router = Router.map(function () {\n this.route('bleep', function () {\n this.route('bloop', function () {\n this.mount('chat', { path: 'custom-chat' });\n });\n });\n });\n\n let engineInstance = (0, _internalTestHelpers.buildOwner)({\n ownerOptions: { routable: true }\n });\n\n let router = Router.create();\n (0, _owner.setOwner)(router, engineInstance);\n router._initRouterJs();\n\n assert.deepEqual(router._routerMicrolib.recognizer.names['bleep.bloop.chat'].segments.slice(1, 4).map(s => s.value), ['bleep', 'bloop', 'custom-chat'], 'segments are properly associated with mounted engine');\n }\n\n ['@test should allow aliasing of engine names with `as`'](assert) {\n assert.expect(1);\n\n Router = Router.map(function () {\n this.route('bleep', function () {\n this.route('bloop', function () {\n this.mount('chat', { as: 'blork' });\n });\n });\n });\n\n let engineInstance = (0, _internalTestHelpers.buildOwner)({\n ownerOptions: { routable: true }\n });\n\n let router = Router.create();\n (0, _owner.setOwner)(router, engineInstance);\n router._initRouterJs();\n\n assert.deepEqual(router._routerMicrolib.recognizer.names['bleep.bloop.blork'].segments.slice(1, 4).map(s => s.value), ['bleep', 'bloop', 'blork'], 'segments are properly associated with mounted engine with aliased name');\n }\n\n ['@test should add loading and error routes to a mount if _isRouterMapResult is true'](assert) {\n Router.map(function () {\n this.mount('chat');\n });\n\n let engineInstance = (0, _internalTestHelpers.buildOwner)({\n ownerOptions: { routable: true }\n });\n\n let router = Router.create({\n _hasModuleBasedResolver() {\n return true;\n }\n });\n (0, _owner.setOwner)(router, engineInstance);\n router._initRouterJs();\n\n assert.ok(router._routerMicrolib.recognizer.names['chat'], 'main route was created');\n assert.ok(router._routerMicrolib.recognizer.names['chat_loading'], 'loading route was added');\n assert.ok(router._routerMicrolib.recognizer.names['chat_error'], 'error route was added');\n }\n\n ['@test should add loading and error routes to a mount alias if _isRouterMapResult is true'](assert) {\n Router.map(function () {\n this.mount('chat', { as: 'shoutbox' });\n });\n\n let engineInstance = (0, _internalTestHelpers.buildOwner)({\n ownerOptions: { routable: true }\n });\n\n let router = Router.create({\n _hasModuleBasedResolver() {\n return true;\n }\n });\n (0, _owner.setOwner)(router, engineInstance);\n router._initRouterJs();\n\n assert.ok(router._routerMicrolib.recognizer.names['shoutbox'], 'main route was created');\n assert.ok(router._routerMicrolib.recognizer.names['shoutbox_loading'], 'loading route was added');\n assert.ok(router._routerMicrolib.recognizer.names['shoutbox_error'], 'error route was added');\n }\n\n ['@test should not add loading and error routes to a mount if _isRouterMapResult is false'](assert) {\n Router.map(function () {\n this.mount('chat');\n });\n\n let engineInstance = (0, _internalTestHelpers.buildOwner)({\n ownerOptions: { routable: true }\n });\n\n let router = Router.create();\n (0, _owner.setOwner)(router, engineInstance);\n router._initRouterJs(false);\n\n assert.ok(router._routerMicrolib.recognizer.names['chat'], 'main route was created');\n assert.ok(!router._routerMicrolib.recognizer.names['chat_loading'], 'loading route was not added');\n assert.ok(!router._routerMicrolib.recognizer.names['chat_error'], 'error route was not added');\n }\n\n ['@test should reset namespace of loading and error routes for mounts with resetNamespace'](assert) {\n Router.map(function () {\n this.route('news', function () {\n this.mount('chat');\n this.mount('blog', { resetNamespace: true });\n });\n });\n\n let engineInstance = (0, _internalTestHelpers.buildOwner)({\n ownerOptions: { routable: true }\n });\n\n let router = Router.create({\n _hasModuleBasedResolver() {\n return true;\n }\n });\n (0, _owner.setOwner)(router, engineInstance);\n router._initRouterJs();\n\n assert.ok(router._routerMicrolib.recognizer.names['news.chat'], 'nested route was created');\n assert.ok(router._routerMicrolib.recognizer.names['news.chat_loading'], 'nested loading route was added');\n assert.ok(router._routerMicrolib.recognizer.names['news.chat_error'], 'nested error route was added');\n\n assert.ok(router._routerMicrolib.recognizer.names['blog'], 'reset route was created');\n assert.ok(router._routerMicrolib.recognizer.names['blog_loading'], 'reset loading route was added');\n assert.ok(router._routerMicrolib.recognizer.names['blog_error'], 'reset error route was added');\n\n assert.ok(!router._routerMicrolib.recognizer.names['news.blog'], 'nested reset route was not created');\n assert.ok(!router._routerMicrolib.recognizer.names['news.blog_loading'], 'nested reset loading route was not added');\n assert.ok(!router._routerMicrolib.recognizer.names['news.blog_error'], 'nested reset error route was not added');\n }\n });\n});","enifed('@ember/-internals/routing/tests/system/route_test', ['@ember/-internals/owner', 'internal-test-helpers', '@ember/service', '@ember/-internals/runtime', '@ember/-internals/routing/lib/system/route'], function (_owner, _internalTestHelpers, _service, _runtime, _route) {\n 'use strict';\n\n let route, routeOne, routeTwo, lookupHash;\n\n (0, _internalTestHelpers.moduleFor)('Route', class extends _internalTestHelpers.AbstractTestCase {\n constructor() {\n super();\n route = _route.default.create();\n }\n\n teardown() {\n super.teardown();\n (0, _internalTestHelpers.runDestroy)(route);\n route = routeOne = routeTwo = lookupHash = undefined;\n }\n\n ['@test default store utilizes the container to acquire the model factory'](assert) {\n assert.expect(4);\n\n let Post = _runtime.Object.extend();\n let post = {};\n\n Post.reopenClass({\n find() {\n return post;\n }\n });\n\n let ownerOptions = {\n ownerOptions: {\n hasRegistration() {\n return true;\n },\n factoryFor(fullName) {\n assert.equal(fullName, 'model:post', 'correct factory was looked up');\n\n return {\n class: Post,\n create() {\n return Post.create();\n }\n };\n }\n }\n };\n\n let owner = (0, _internalTestHelpers.buildOwner)(ownerOptions);\n (0, _owner.setOwner)(route, owner);\n\n route.set('_qp', null);\n\n assert.equal(route.model({ post_id: 1 }), post);\n assert.equal(route.findModel('post', 1), post, '#findModel returns the correct post');\n\n (0, _internalTestHelpers.runDestroy)(owner);\n }\n\n [\"@test 'store' can be injected by data persistence frameworks\"](assert) {\n assert.expect(8);\n (0, _internalTestHelpers.runDestroy)(route);\n\n let owner = (0, _internalTestHelpers.buildOwner)();\n\n let post = {\n id: 1\n };\n\n let Store = _runtime.Object.extend({\n find(type, value) {\n assert.ok(true, 'injected model was called');\n assert.equal(type, 'post', 'correct type was called');\n assert.equal(value, 1, 'correct value was called');\n return post;\n }\n });\n\n owner.register('route:index', _route.default);\n owner.register('store:main', Store);\n\n owner.inject('route', 'store', 'store:main');\n\n route = owner.lookup('route:index');\n\n assert.equal(route.model({ post_id: 1 }), post, '#model returns the correct post');\n assert.equal(route.findModel('post', 1), post, '#findModel returns the correct post');\n\n (0, _internalTestHelpers.runDestroy)(owner);\n }\n\n [\"@test assert if 'store.find' method is not found\"]() {\n (0, _internalTestHelpers.runDestroy)(route);\n\n let owner = (0, _internalTestHelpers.buildOwner)();\n let Post = _runtime.Object.extend();\n\n owner.register('route:index', _route.default);\n owner.register('model:post', Post);\n\n route = owner.lookup('route:index');\n\n expectAssertion(function () {\n route.findModel('post', 1);\n }, 'Post has no method `find`.');\n\n (0, _internalTestHelpers.runDestroy)(owner);\n }\n\n ['@test asserts if model class is not found']() {\n (0, _internalTestHelpers.runDestroy)(route);\n\n let owner = (0, _internalTestHelpers.buildOwner)();\n owner.register('route:index', _route.default);\n\n route = owner.lookup('route:index');\n\n expectAssertion(function () {\n route.model({ post_id: 1 });\n }, /You used the dynamic segment post_id in your route undefined, but .Post did not exist and you did not override your route\\'s `model` hook./);\n\n (0, _internalTestHelpers.runDestroy)(owner);\n }\n\n [\"@test 'store' does not need to be injected\"](assert) {\n (0, _internalTestHelpers.runDestroy)(route);\n\n let owner = (0, _internalTestHelpers.buildOwner)();\n\n owner.register('route:index', _route.default);\n\n route = owner.lookup('route:index');\n\n ignoreAssertion(function () {\n route.model({ post_id: 1 });\n });\n\n assert.ok(true, 'no error was raised');\n\n (0, _internalTestHelpers.runDestroy)(owner);\n }\n\n [\"@test modelFor doesn't require the router\"](assert) {\n let owner = (0, _internalTestHelpers.buildOwner)();\n (0, _owner.setOwner)(route, owner);\n\n let foo = { name: 'foo' };\n\n let FooRoute = _route.default.extend({\n currentModel: foo\n });\n\n owner.register('route:foo', FooRoute);\n\n assert.strictEqual(route.modelFor('foo'), foo);\n\n (0, _internalTestHelpers.runDestroy)(owner);\n }\n\n [\"@test modelFor doesn't require the routerMicrolib\"](assert) {\n let route = _route.default.create({\n _router: { _routerMicrolib: null }\n });\n\n let owner = (0, _internalTestHelpers.buildOwner)();\n (0, _owner.setOwner)(route, owner);\n\n let foo = { name: 'foo' };\n\n let FooRoute = _route.default.extend({\n currentModel: foo\n });\n\n owner.register('route:foo', FooRoute);\n\n assert.strictEqual(route.modelFor('foo'), foo);\n\n (0, _internalTestHelpers.runDestroy)(owner);\n }\n\n ['@test .send just calls an action if the router is absent'](assert) {\n assert.expect(7);\n let route = _route.default.extend({\n actions: {\n returnsTrue(foo, bar) {\n assert.equal(foo, 1);\n assert.equal(bar, 2);\n assert.equal(this, route);\n return true;\n },\n\n returnsFalse() {\n assert.ok(true, 'returnsFalse was called');\n return false;\n }\n }\n }).create();\n\n assert.equal(route.send('returnsTrue', 1, 2), true);\n assert.equal(route.send('returnsFalse'), false);\n assert.equal(route.send('nonexistent', 1, 2, 3), undefined);\n\n (0, _internalTestHelpers.runDestroy)(route);\n }\n\n ['@test .send just calls an action if the routers internal router property is absent'](assert) {\n assert.expect(7);\n let route = _route.default.extend({\n router: {},\n actions: {\n returnsTrue(foo, bar) {\n assert.equal(foo, 1);\n assert.equal(bar, 2);\n assert.equal(this, route);\n return true;\n },\n\n returnsFalse() {\n assert.ok(true, 'returnsFalse was called');\n return false;\n }\n }\n }).create();\n\n assert.equal(true, route.send('returnsTrue', 1, 2));\n assert.equal(false, route.send('returnsFalse'));\n assert.equal(undefined, route.send('nonexistent', 1, 2, 3));\n\n (0, _internalTestHelpers.runDestroy)(route);\n }\n\n ['@test .send asserts if called on a destroyed route']() {\n route.routeName = 'rip-alley';\n (0, _internalTestHelpers.runDestroy)(route);\n\n expectAssertion(() => {\n route.send('trigger-me-dead');\n }, \"Attempted to call .send() with the action 'trigger-me-dead' on the destroyed route 'rip-alley'.\");\n }\n });\n\n (0, _internalTestHelpers.moduleFor)('Route serialize', class extends _internalTestHelpers.AbstractTestCase {\n constructor() {\n super();\n route = _route.default.create();\n }\n\n teardown() {\n (0, _internalTestHelpers.runDestroy)(route);\n }\n\n ['@test returns the models properties if params does not include *_id'](assert) {\n let model = { id: 2, firstName: 'Ned', lastName: 'Ryerson' };\n\n assert.deepEqual(route.serialize(model, ['firstName', 'lastName']), { firstName: 'Ned', lastName: 'Ryerson' }, 'serialized correctly');\n }\n\n ['@test returns model.id if params include *_id'](assert) {\n let model = { id: 2 };\n\n assert.deepEqual(route.serialize(model, ['post_id']), { post_id: 2 }, 'serialized correctly');\n }\n\n ['@test returns checks for existence of model.post_id before trying model.id'](assert) {\n let model = { post_id: 3 };\n\n assert.deepEqual(route.serialize(model, ['post_id']), { post_id: 3 }, 'serialized correctly');\n }\n\n ['@test returns undefined if model is not set'](assert) {\n assert.equal(route.serialize(undefined, ['post_id']), undefined, 'serialized correctly');\n }\n });\n\n (0, _internalTestHelpers.moduleFor)('Route interaction', class extends _internalTestHelpers.AbstractTestCase {\n constructor() {\n super();\n\n let owner = {\n lookup(fullName) {\n return lookupHash[fullName];\n }\n };\n\n routeOne = _route.default.create({ routeName: 'one' });\n routeTwo = _route.default.create({ routeName: 'two' });\n\n (0, _owner.setOwner)(routeOne, owner);\n (0, _owner.setOwner)(routeTwo, owner);\n\n lookupHash = {\n 'route:one': routeOne,\n 'route:two': routeTwo\n };\n }\n\n teardown() {\n (0, _internalTestHelpers.runDestroy)(routeOne);\n (0, _internalTestHelpers.runDestroy)(routeTwo);\n }\n\n ['@test route._qp does not crash if the controller has no QP, or setProperties'](assert) {\n lookupHash['controller:test'] = {};\n\n routeOne.controllerName = 'test';\n let qp = routeOne.get('_qp');\n\n assert.deepEqual(qp.map, {}, 'map should be empty');\n assert.deepEqual(qp.propertyNames, [], 'property names should be empty');\n assert.deepEqual(qp.qps, [], 'qps is should be empty');\n }\n\n [\"@test controllerFor uses route's controllerName if specified\"](assert) {\n let testController = {};\n lookupHash['controller:test'] = testController;\n\n routeOne.controllerName = 'test';\n\n assert.equal(routeTwo.controllerFor('one'), testController);\n }\n });\n\n (0, _internalTestHelpers.moduleFor)('Route injected properties', class extends _internalTestHelpers.AbstractTestCase {\n ['@test services can be injected into routes'](assert) {\n let owner = (0, _internalTestHelpers.buildOwner)();\n\n owner.register('route:application', _route.default.extend({\n authService: (0, _service.inject)('auth')\n }));\n\n owner.register('service:auth', _service.default.extend());\n\n let appRoute = owner.lookup('route:application');\n let authService = owner.lookup('service:auth');\n\n assert.equal(authService, appRoute.get('authService'), 'service.auth is injected');\n }\n });\n\n (0, _internalTestHelpers.moduleFor)('Route with engines', class extends _internalTestHelpers.AbstractTestCase {\n [\"@test paramsFor considers an engine's mountPoint\"](assert) {\n let router = {\n _deserializeQueryParams() {},\n _routerMicrolib: {\n state: {\n routeInfos: [{ name: 'posts' }],\n params: {\n 'foo.bar': { a: 'b' },\n 'foo.bar.posts': { c: 'd' }\n }\n }\n }\n };\n\n let engineInstance = (0, _internalTestHelpers.buildOwner)({\n ownerOptions: {\n routable: true,\n\n mountPoint: 'foo.bar',\n\n lookup(name) {\n if (name === 'route:posts') {\n return postsRoute;\n } else if (name === 'route:application') {\n return applicationRoute;\n }\n }\n }\n });\n\n let applicationRoute = _route.default.create({\n _router: router,\n routeName: 'application',\n fullRouteName: 'foo.bar'\n });\n let postsRoute = _route.default.create({\n _router: router,\n routeName: 'posts',\n fullRouteName: 'foo.bar.posts'\n });\n let route = _route.default.create({ _router: router });\n\n (0, _owner.setOwner)(applicationRoute, engineInstance);\n (0, _owner.setOwner)(postsRoute, engineInstance);\n (0, _owner.setOwner)(route, engineInstance);\n\n assert.deepEqual(route.paramsFor('application'), { a: 'b' }, 'params match for root `application` route in engine');\n assert.deepEqual(route.paramsFor('posts'), { c: 'd' }, 'params match for `posts` route in engine');\n }\n\n [\"@test modelFor considers an engine's mountPoint\"](assert) {\n let applicationModel = { id: '1' };\n let postsModel = { id: '2' };\n\n let router = {\n _routerMicrolib: {\n activeTransition: {\n resolvedModels: {\n 'foo.bar': applicationModel,\n 'foo.bar.posts': postsModel\n }\n }\n }\n };\n\n let engineInstance = (0, _internalTestHelpers.buildOwner)({\n ownerOptions: {\n routable: true,\n\n mountPoint: 'foo.bar',\n\n lookup(name) {\n if (name === 'route:posts') {\n return postsRoute;\n } else if (name === 'route:application') {\n return applicationRoute;\n }\n }\n }\n });\n\n let applicationRoute = _route.default.create({\n _router: router,\n routeName: 'application'\n });\n let postsRoute = _route.default.create({\n _router: router,\n routeName: 'posts'\n });\n let route = _route.default.create({ _router: router });\n\n (0, _owner.setOwner)(applicationRoute, engineInstance);\n (0, _owner.setOwner)(postsRoute, engineInstance);\n (0, _owner.setOwner)(route, engineInstance);\n\n assert.strictEqual(route.modelFor('application'), applicationModel);\n assert.strictEqual(route.modelFor('posts'), postsModel);\n }\n\n [\"@test transitionTo considers an engine's mountPoint\"](assert) {\n let router = {\n transitionTo(route) {\n return route;\n }\n };\n\n let engineInstance = (0, _internalTestHelpers.buildOwner)({\n ownerOptions: {\n routable: true,\n mountPoint: 'foo.bar'\n }\n });\n\n let route = _route.default.create({ _router: router });\n (0, _owner.setOwner)(route, engineInstance);\n\n assert.strictEqual(route.transitionTo('application'), 'foo.bar.application', 'properly prefixes application route');\n assert.strictEqual(route.transitionTo('posts'), 'foo.bar.posts', 'properly prefixes child routes');\n assert.throws(() => route.transitionTo('/posts'), 'throws when trying to use a url');\n\n let queryParams = {};\n assert.strictEqual(route.transitionTo(queryParams), queryParams, 'passes query param only transitions through');\n }\n\n [\"@test intermediateTransitionTo considers an engine's mountPoint\"](assert) {\n let lastRoute;\n let router = {\n intermediateTransitionTo(route) {\n lastRoute = route;\n }\n };\n\n let engineInstance = (0, _internalTestHelpers.buildOwner)({\n ownerOptions: {\n routable: true,\n mountPoint: 'foo.bar'\n }\n });\n\n let route = _route.default.create({ _router: router });\n (0, _owner.setOwner)(route, engineInstance);\n\n route.intermediateTransitionTo('application');\n assert.strictEqual(lastRoute, 'foo.bar.application', 'properly prefixes application route');\n\n route.intermediateTransitionTo('posts');\n assert.strictEqual(lastRoute, 'foo.bar.posts', 'properly prefixes child routes');\n\n assert.throws(() => route.intermediateTransitionTo('/posts'), 'throws when trying to use a url');\n\n let queryParams = {};\n route.intermediateTransitionTo(queryParams);\n assert.strictEqual(lastRoute, queryParams, 'passes query param only transitions through');\n }\n\n [\"@test replaceWith considers an engine's mountPoint\"](assert) {\n let router = {\n replaceWith(route) {\n return route;\n }\n };\n\n let engineInstance = (0, _internalTestHelpers.buildOwner)({\n ownerOptions: {\n routable: true,\n mountPoint: 'foo.bar'\n }\n });\n\n let route = _route.default.create({ _router: router });\n (0, _owner.setOwner)(route, engineInstance);\n\n assert.strictEqual(route.replaceWith('application'), 'foo.bar.application', 'properly prefixes application route');\n assert.strictEqual(route.replaceWith('posts'), 'foo.bar.posts', 'properly prefixes child routes');\n assert.throws(() => route.replaceWith('/posts'), 'throws when trying to use a url');\n\n let queryParams = {};\n assert.strictEqual(route.replaceWith(queryParams), queryParams, 'passes query param only transitions through');\n }\n\n ['@test `router` is a deprecated one-way alias to `_router`'](assert) {\n let router = {};\n let route = _route.default.create({ _router: router });\n expectDeprecation(function () {\n return assert.equal(route.router, router);\n }, 'Route#router is an intimate API that has been renamed to Route#_router. However you might want to consider using the router service');\n }\n });\n});","enifed('@ember/-internals/routing/tests/system/router_test', ['@ember/-internals/owner', '@ember/-internals/routing/lib/location/hash_location', '@ember/-internals/routing/lib/location/history_location', '@ember/-internals/routing/lib/location/auto_location', '@ember/-internals/routing/lib/location/none_location', '@ember/-internals/routing/lib/system/router', 'internal-test-helpers'], function (_owner, _hash_location, _history_location, _auto_location, _none_location, _router, _internalTestHelpers) {\n 'use strict';\n\n let owner;\n\n function createRouter(settings, options = {}) {\n let CustomRouter = _router.default.extend();\n let router = CustomRouter.create(settings);\n\n if (!options.skipOwner) {\n (0, _owner.setOwner)(router, owner);\n }\n\n if (!options.disableSetup) {\n router.setupRouter();\n }\n\n return router;\n }\n\n (0, _internalTestHelpers.moduleFor)('Ember Router', class extends _internalTestHelpers.AbstractTestCase {\n constructor() {\n super();\n owner = (0, _internalTestHelpers.buildOwner)();\n\n //register the HashLocation (the default)\n owner.register('location:hash', _hash_location.default);\n owner.register('location:history', _history_location.default);\n owner.register('location:auto', _auto_location.default);\n owner.register('location:none', _none_location.default);\n }\n\n teardown() {\n (0, _internalTestHelpers.runDestroy)(owner);\n owner = null;\n }\n\n ['@test can create a router without an owner'](assert) {\n createRouter(undefined, { disableSetup: true, skipOwner: true });\n\n assert.ok(true, 'no errors were thrown when creating without a container');\n }\n\n ['@test [GH#15237] EmberError is imported correctly'](assert) {\n // If we get the right message it means Error is being imported correctly.\n assert.throws(function () {\n (0, _router.triggerEvent)(null, false, []);\n }, /because your app hasn't finished transitioning/);\n }\n\n ['@test should not create a router.js instance upon init'](assert) {\n let router = createRouter(undefined, { disableSetup: true });\n\n assert.ok(!router._routerMicrolib);\n }\n\n ['@test should not reify location until setupRouter is called'](assert) {\n let router = createRouter(undefined, { disableSetup: true });\n assert.equal(typeof router.location, 'string', 'location is specified as a string');\n\n router.setupRouter();\n\n assert.equal(typeof router.location, 'object', 'location is reified into an object');\n }\n\n ['@test should destroy its location upon destroying the routers owner.'](assert) {\n let router = createRouter();\n let location = router.get('location');\n\n (0, _internalTestHelpers.runDestroy)(owner);\n\n assert.ok(location.isDestroyed, 'location should be destroyed');\n }\n\n ['@test should instantiate its location with its `rootURL`'](assert) {\n let router = createRouter({\n rootURL: '/rootdir/'\n });\n let location = router.get('location');\n\n assert.equal(location.get('rootURL'), '/rootdir/');\n }\n\n ['@test replacePath should be called with the right path'](assert) {\n assert.expect(1);\n\n let location = owner.lookup('location:auto');\n\n let browserLocation = {\n href: 'http://test.com/rootdir/welcome',\n origin: 'http://test.com',\n pathname: '/rootdir/welcome',\n hash: '',\n search: '',\n replace(url) {\n assert.equal(url, 'http://test.com/rootdir/#/welcome');\n }\n };\n\n location.location = browserLocation;\n location.global = { onhashchange() {} };\n location.history = null;\n\n createRouter({\n location: 'auto',\n rootURL: '/rootdir/'\n });\n }\n\n ['@test Router._routePath should consume identical prefixes'](assert) {\n createRouter();\n\n function routePath() {\n let routeInfos = Array.prototype.slice.call(arguments).map(function (s) {\n return { name: s };\n });\n routeInfos.unshift({ name: 'ignored' });\n\n return _router.default._routePath(routeInfos);\n }\n\n assert.equal(routePath('foo'), 'foo');\n assert.equal(routePath('foo', 'bar', 'baz'), 'foo.bar.baz');\n assert.equal(routePath('foo', 'foo.bar'), 'foo.bar');\n assert.equal(routePath('foo', 'foo.bar', 'foo.bar.baz'), 'foo.bar.baz');\n assert.equal(routePath('foo', 'foo.bar', 'foo.bar.baz.wow'), 'foo.bar.baz.wow');\n assert.equal(routePath('foo', 'foo.bar.baz.wow'), 'foo.bar.baz.wow');\n assert.equal(routePath('foo.bar', 'bar.baz.wow'), 'foo.bar.baz.wow');\n\n // This makes no sense, not trying to handle it, just\n // making sure it doesn't go boom.\n assert.equal(routePath('foo.bar.baz', 'foo'), 'foo.bar.baz.foo');\n }\n\n ['@test Router should cancel routing setup when the Location class says so via cancelRouterSetup'](assert) {\n assert.expect(0);\n\n let router;\n let FakeLocation = {\n cancelRouterSetup: true,\n create() {\n return this;\n }\n };\n\n owner.register('location:fake', FakeLocation);\n\n router = createRouter({\n location: 'fake',\n\n _setupRouter() {\n assert.ok(false, '_setupRouter should not be called');\n }\n });\n\n router.startRouting();\n }\n\n [\"@test AutoLocation should replace the url when it's not in the preferred format\"](assert) {\n assert.expect(1);\n\n let location = owner.lookup('location:auto');\n\n location.location = {\n href: 'http://test.com/rootdir/welcome',\n origin: 'http://test.com',\n pathname: '/rootdir/welcome',\n hash: '',\n search: '',\n replace(url) {\n assert.equal(url, 'http://test.com/rootdir/#/welcome');\n }\n };\n location.history = null;\n location.global = {\n onhashchange() {}\n };\n\n createRouter({\n location: 'auto',\n rootURL: '/rootdir/'\n });\n }\n\n ['@test Router#handleURL should remove any #hashes before doing URL transition'](assert) {\n assert.expect(2);\n\n let router = createRouter({\n _doURLTransition(routerJsMethod, url) {\n assert.equal(routerJsMethod, 'handleURL');\n assert.equal(url, '/foo/bar?time=morphin');\n }\n });\n\n router.handleURL('/foo/bar?time=morphin#pink-power-ranger');\n }\n\n ['@test Router#triggerEvent allows actions to bubble when returning true'](assert) {\n assert.expect(2);\n\n let routeInfos = [{\n name: 'application',\n route: {\n actions: {\n loading() {\n assert.ok(false, 'loading not handled by application route');\n }\n }\n }\n }, {\n name: 'about',\n route: {\n actions: {\n loading() {\n assert.ok(true, 'loading handled by about route');\n return false;\n }\n }\n }\n }, {\n name: 'about.me',\n route: {\n actions: {\n loading() {\n assert.ok(true, 'loading handled by about.me route');\n return true;\n }\n }\n }\n }];\n\n (0, _router.triggerEvent)(routeInfos, false, ['loading']);\n }\n\n ['@test Router#triggerEvent ignores handlers that have not loaded yet'](assert) {\n assert.expect(1);\n\n let routeInfos = [{\n name: 'about',\n route: {\n actions: {\n loading() {\n assert.ok(true, 'loading handled by about route');\n }\n }\n }\n }, {\n name: 'about.me',\n route: undefined\n }];\n\n (0, _router.triggerEvent)(routeInfos, false, ['loading']);\n }\n\n ['@test transitionTo should throw an error when called after owner is destroyed']() {\n let router = createRouter();\n\n (0, _internalTestHelpers.runDestroy)(router);\n\n router.currentRouteName = 'route-a';\n\n expectAssertion(function () {\n router.transitionTo('route-b');\n }, \"A transition was attempted from 'route-a' to 'route-b' but the application instance has already been destroyed.\");\n\n expectAssertion(function () {\n router.transitionTo('./route-b/1');\n }, \"A transition was attempted from 'route-a' to './route-b/1' but the application instance has already been destroyed.\");\n }\n });\n});","enifed('@ember/-internals/routing/tests/utils_test', ['@ember/-internals/routing/lib/utils', 'internal-test-helpers'], function (_utils, _internalTestHelpers) {\n 'use strict';\n\n (0, _internalTestHelpers.moduleFor)('Routing query parameter utils - normalizeControllerQueryParams', class extends _internalTestHelpers.AbstractTestCase {\n ['@test converts array style into verbose object style'](assert) {\n let paramName = 'foo';\n let params = [paramName];\n let normalized = (0, _utils.normalizeControllerQueryParams)(params);\n\n assert.ok(normalized[paramName], 'turns the query param name into key');\n assert.equal(normalized[paramName].as, null, \"includes a blank alias in 'as' key\");\n assert.equal(normalized[paramName].scope, 'model', 'defaults scope to model');\n }\n\n [\"@test converts object style [{foo: 'an_alias'}]\"](assert) {\n let paramName = 'foo';\n let params = [{ foo: 'an_alias' }];\n let normalized = (0, _utils.normalizeControllerQueryParams)(params);\n\n assert.ok(normalized[paramName], 'retains the query param name as key');\n assert.equal(normalized[paramName].as, 'an_alias', \"includes the provided alias in 'as' key\");\n assert.equal(normalized[paramName].scope, 'model', 'defaults scope to model');\n }\n\n [\"@test retains maximally verbose object style [{foo: {as: 'foo'}}]\"](assert) {\n let paramName = 'foo';\n let params = [{ foo: { as: 'an_alias' } }];\n let normalized = (0, _utils.normalizeControllerQueryParams)(params);\n\n assert.ok(normalized[paramName], 'retains the query param name as key');\n assert.equal(normalized[paramName].as, 'an_alias', \"includes the provided alias in 'as' key\");\n assert.equal(normalized[paramName].scope, 'model', 'defaults scope to model');\n }\n });\n});","enifed('@ember/-internals/runtime/tests/array/any-test', ['@ember/-internals/runtime/lib/mixins/array', 'internal-test-helpers', '@ember/-internals/runtime/tests/helpers/array'], function (_array, _internalTestHelpers, _array2) {\n 'use strict';\n\n class AnyTests extends _internalTestHelpers.AbstractTestCase {\n '@test any should should invoke callback on each item as long as you return false'() {\n let obj = this.newObject();\n let ary = this.toArray(obj);\n let found = [];\n let result;\n\n result = obj.any(function (i) {\n found.push(i);\n return false;\n });\n\n this.assert.equal(result, false, 'return value of obj.any');\n this.assert.deepEqual(found, ary, 'items passed during any() should match');\n }\n\n '@test any should stop invoking when you return true'() {\n let obj = this.newObject();\n let ary = this.toArray(obj);\n let cnt = ary.length - 2;\n let exp = cnt;\n let found = [];\n let result;\n\n result = obj.any(function (i) {\n found.push(i);\n return --cnt <= 0;\n });\n this.assert.equal(result, true, 'return value of obj.any');\n this.assert.equal(found.length, exp, 'should invoke proper number of times');\n this.assert.deepEqual(found, ary.slice(0, -2), 'items passed during any() should match');\n }\n\n '@test any should return true if any object matches the callback'() {\n let obj = (0, _array.A)([0, 1, 2]);\n let result;\n\n result = obj.any(i => !!i);\n this.assert.equal(result, true, 'return value of obj.any');\n }\n\n '@test any should produce correct results even if the matching element is undefined'(assert) {\n let obj = (0, _array.A)([undefined]);\n let result;\n\n result = obj.any(() => true);\n assert.equal(result, true, 'return value of obj.any');\n }\n }\n\n (0, _array2.runArrayTests)('any', AnyTests);\n});","enifed('@ember/-internals/runtime/tests/array/compact-test', ['internal-test-helpers', '@ember/-internals/runtime/tests/helpers/array'], function (_internalTestHelpers, _array) {\n 'use strict';\n\n class CompactTests extends _internalTestHelpers.AbstractTestCase {\n '@test removes null and undefined values from enumerable'() {\n let obj = this.newObject([null, 1, false, '', undefined, 0, null]);\n let ary = obj.compact();\n this.assert.deepEqual(ary, [1, false, '', 0]);\n }\n }\n\n (0, _array.runArrayTests)('compact', CompactTests);\n});","enifed('@ember/-internals/runtime/tests/array/every-test', ['internal-test-helpers', '@ember/-internals/runtime/tests/helpers/array', '@ember/-internals/runtime/lib/system/object'], function (_internalTestHelpers, _array, _object) {\n 'use strict';\n\n class EveryTest extends _internalTestHelpers.AbstractTestCase {\n '@test every should should invoke callback on each item as long as you return true'() {\n let obj = this.newObject();\n let ary = this.toArray(obj);\n let found = [];\n let result;\n\n result = obj.every(function (i) {\n found.push(i);\n return true;\n });\n this.assert.equal(result, true, 'return value of obj.every');\n this.assert.deepEqual(found, ary, 'items passed during every() should match');\n }\n\n '@test every should stop invoking when you return false'() {\n let obj = this.newObject();\n let ary = this.toArray(obj);\n let cnt = ary.length - 2;\n let exp = cnt;\n let found = [];\n let result;\n\n result = obj.every(function (i) {\n found.push(i);\n return --cnt > 0;\n });\n this.assert.equal(result, false, 'return value of obj.every');\n this.assert.equal(found.length, exp, 'should invoke proper number of times');\n this.assert.deepEqual(found, ary.slice(0, -2), 'items passed during every() should match');\n }\n }\n\n class IsEveryTest extends _internalTestHelpers.AbstractTestCase {\n '@test should return true of every property matches'() {\n let obj = this.newObject([{ foo: 'foo', bar: 'BAZ' }, _object.default.create({ foo: 'foo', bar: 'bar' })]);\n\n this.assert.equal(obj.isEvery('foo', 'foo'), true, 'isEvery(foo)');\n this.assert.equal(obj.isEvery('bar', 'bar'), false, 'isEvery(bar)');\n }\n\n '@test should return true of every property is true'() {\n let obj = this.newObject([{ foo: 'foo', bar: true }, _object.default.create({ foo: 'bar', bar: false })]);\n\n // different values - all eval to true\n this.assert.equal(obj.isEvery('foo'), true, 'isEvery(foo)');\n this.assert.equal(obj.isEvery('bar'), false, 'isEvery(bar)');\n }\n\n '@test should return true if every property matches null'() {\n let obj = this.newObject([{ foo: null, bar: 'BAZ' }, _object.default.create({ foo: null, bar: null })]);\n\n this.assert.equal(obj.isEvery('foo', null), true, \"isEvery('foo', null)\");\n this.assert.equal(obj.isEvery('bar', null), false, \"isEvery('bar', null)\");\n }\n\n '@test should return true if every property is undefined'() {\n let obj = this.newObject([{ foo: undefined, bar: 'BAZ' }, _object.default.create({ bar: undefined })]);\n\n this.assert.equal(obj.isEvery('foo', undefined), true, \"isEvery('foo', undefined)\");\n this.assert.equal(obj.isEvery('bar', undefined), false, \"isEvery('bar', undefined)\");\n }\n }\n\n (0, _array.runArrayTests)('every', EveryTest);\n (0, _array.runArrayTests)('isEvery', IsEveryTest);\n});","enifed('@ember/-internals/runtime/tests/array/filter-test', ['@ember/-internals/runtime/lib/system/object', 'internal-test-helpers', '@ember/-internals/runtime/tests/helpers/array'], function (_object, _internalTestHelpers, _array) {\n 'use strict';\n\n class FilterTest extends _internalTestHelpers.AbstractTestCase {\n '@test filter should invoke on each item'() {\n let obj = this.newObject();\n let ary = this.toArray(obj);\n let cnt = ary.length - 2;\n let found = [];\n let result;\n\n // return true on all but the last two\n result = obj.filter(function (i) {\n found.push(i);\n return --cnt >= 0;\n });\n this.assert.deepEqual(found, ary, 'should have invoked on each item');\n this.assert.deepEqual(result, ary.slice(0, -2), 'filtered array should exclude items');\n }\n }\n\n class FilterByTest extends _internalTestHelpers.AbstractTestCase {\n '@test should filter based on object'() {\n let obj, ary;\n\n ary = [{ foo: 'foo', bar: 'BAZ' }, _object.default.create({ foo: 'foo', bar: 'bar' })];\n\n obj = this.newObject(ary);\n\n this.assert.deepEqual(obj.filterBy('foo', 'foo'), ary, 'filterBy(foo)');\n this.assert.deepEqual(obj.filterBy('bar', 'bar'), [ary[1]], 'filterBy(bar)');\n }\n\n '@test should include in result if property is true'() {\n let obj, ary;\n\n ary = [{ foo: 'foo', bar: true }, _object.default.create({ foo: 'bar', bar: false })];\n\n obj = this.newObject(ary);\n\n // different values - all eval to true\n this.assert.deepEqual(obj.filterBy('foo'), ary, 'filterBy(foo)');\n this.assert.deepEqual(obj.filterBy('bar'), [ary[0]], 'filterBy(bar)');\n }\n\n '@test should filter on second argument if provided'() {\n let obj, ary;\n\n ary = [{ name: 'obj1', foo: 3 }, _object.default.create({ name: 'obj2', foo: 2 }), { name: 'obj3', foo: 2 }, _object.default.create({ name: 'obj4', foo: 3 })];\n\n obj = this.newObject(ary);\n\n this.assert.deepEqual(obj.filterBy('foo', 3), [ary[0], ary[3]], \"filterBy('foo', 3)')\");\n }\n\n '@test should correctly filter null second argument'() {\n let obj, ary;\n\n ary = [{ name: 'obj1', foo: 3 }, _object.default.create({ name: 'obj2', foo: null }), { name: 'obj3', foo: null }, _object.default.create({ name: 'obj4', foo: 3 })];\n\n obj = this.newObject(ary);\n\n this.assert.deepEqual(obj.filterBy('foo', null), [ary[1], ary[2]], \"filterBy('foo', 3)')\");\n }\n\n '@test should not return all objects on undefined second argument'() {\n let obj, ary;\n\n ary = [{ name: 'obj1', foo: 3 }, _object.default.create({ name: 'obj2', foo: 2 })];\n\n obj = this.newObject(ary);\n\n this.assert.deepEqual(obj.filterBy('foo', undefined), [], \"filterBy('foo', 3)')\");\n }\n\n '@test should correctly filter explicit undefined second argument'() {\n let obj, ary;\n\n ary = [{ name: 'obj1', foo: 3 }, _object.default.create({ name: 'obj2', foo: 3 }), { name: 'obj3', foo: undefined }, _object.default.create({ name: 'obj4', foo: undefined }), { name: 'obj5' }, _object.default.create({ name: 'obj6' })];\n\n obj = this.newObject(ary);\n\n this.assert.deepEqual(obj.filterBy('foo', undefined), ary.slice(2), \"filterBy('foo', 3)')\");\n }\n\n '@test should not match undefined properties without second argument'() {\n let obj, ary;\n\n ary = [{ name: 'obj1', foo: 3 }, _object.default.create({ name: 'obj2', foo: 3 }), { name: 'obj3', foo: undefined }, _object.default.create({ name: 'obj4', foo: undefined }), { name: 'obj5' }, _object.default.create({ name: 'obj6' })];\n\n obj = this.newObject(ary);\n\n this.assert.deepEqual(obj.filterBy('foo'), ary.slice(0, 2), \"filterBy('foo', 3)')\");\n }\n }\n\n (0, _array.runArrayTests)('filter', FilterTest);\n (0, _array.runArrayTests)('filter', FilterByTest);\n});","enifed('@ember/-internals/runtime/tests/array/find-test', ['@ember/-internals/runtime/lib/system/object', 'internal-test-helpers', '@ember/-internals/runtime/tests/helpers/array'], function (_object, _internalTestHelpers, _array) {\n 'use strict';\n\n class FindTests extends _internalTestHelpers.AbstractTestCase {\n '@test find should invoke callback on each item as long as you return false'() {\n let obj = this.newObject();\n let ary = this.toArray(obj);\n let found = [];\n let result;\n\n result = obj.find(function (i) {\n found.push(i);\n return false;\n });\n this.assert.equal(result, undefined, 'return value of obj.find');\n this.assert.deepEqual(found, ary, 'items passed during find() should match');\n }\n\n '@test every should stop invoking when you return true'() {\n let obj = this.newObject();\n let ary = this.toArray(obj);\n let cnt = ary.length - 2;\n let exp = cnt;\n let found = [];\n let result;\n\n result = obj.find(function (i) {\n found.push(i);\n return --cnt >= 0;\n });\n this.assert.equal(result, ary[exp - 1], 'return value of obj.find');\n this.assert.equal(found.length, exp, 'should invoke proper number of times');\n this.assert.deepEqual(found, ary.slice(0, -2), 'items passed during find() should match');\n }\n }\n\n class FindByTests extends _internalTestHelpers.AbstractTestCase {\n '@test should return first object of property matches'() {\n let ary, obj;\n\n ary = [{ foo: 'foo', bar: 'BAZ' }, _object.default.create({ foo: 'foo', bar: 'bar' })];\n\n obj = this.newObject(ary);\n\n this.assert.equal(obj.findBy('foo', 'foo'), ary[0], 'findBy(foo)');\n this.assert.equal(obj.findBy('bar', 'bar'), ary[1], 'findBy(bar)');\n }\n\n '@test should return first object with truthy prop'() {\n let ary, obj;\n\n ary = [{ foo: 'foo', bar: false }, _object.default.create({ foo: 'bar', bar: true })];\n\n obj = this.newObject(ary);\n\n // different values - all eval to true\n this.assert.equal(obj.findBy('foo'), ary[0], 'findBy(foo)');\n this.assert.equal(obj.findBy('bar'), ary[1], 'findBy(bar)');\n }\n\n '@test should return first null property match'() {\n let ary, obj;\n\n ary = [{ foo: null, bar: 'BAZ' }, _object.default.create({ foo: null, bar: null })];\n\n obj = this.newObject(ary);\n\n this.assert.equal(obj.findBy('foo', null), ary[0], \"findBy('foo', null)\");\n this.assert.equal(obj.findBy('bar', null), ary[1], \"findBy('bar', null)\");\n }\n\n '@test should return first undefined property match'() {\n let ary, obj;\n\n ary = [{ foo: undefined, bar: 'BAZ' }, _object.default.create({})];\n\n obj = this.newObject(ary);\n\n this.assert.equal(obj.findBy('foo', undefined), ary[0], \"findBy('foo', undefined)\");\n this.assert.equal(obj.findBy('bar', undefined), ary[1], \"findBy('bar', undefined)\");\n }\n }\n\n (0, _array.runArrayTests)('find', FindTests);\n (0, _array.runArrayTests)('findBy', FindByTests);\n});","enifed('@ember/-internals/runtime/tests/array/firstObject-test', ['@ember/-internals/metal', 'internal-test-helpers', '@ember/-internals/runtime/tests/helpers/array'], function (_metal, _internalTestHelpers, _array) {\n 'use strict';\n\n class FirstObjectTests extends _internalTestHelpers.AbstractTestCase {\n '@test returns first item in enumerable'() {\n let obj = this.newObject();\n this.assert.equal((0, _metal.get)(obj, 'firstObject'), this.toArray(obj)[0]);\n }\n\n '@test returns undefined if enumerable is empty'() {\n let obj = this.newObject([]);\n this.assert.equal((0, _metal.get)(obj, 'firstObject'), undefined);\n }\n\n '@test can not be set'() {\n let obj = this.newObject([]);\n\n this.assert.equal((0, _metal.get)(obj, 'firstObject'), this.toArray(obj)[0]);\n\n this.assert.throws(() => {\n (0, _metal.set)(obj, 'firstObject', 'foo!');\n }, /Cannot set read-only property \"firstObject\" on object/);\n }\n }\n\n (0, _array.runArrayTests)('firstObject', FirstObjectTests);\n});","enifed('@ember/-internals/runtime/tests/array/forEach-test', ['@ember/-internals/utils', '@ember/-internals/metal', 'internal-test-helpers', '@ember/-internals/runtime/tests/helpers/array'], function (_utils, _metal, _internalTestHelpers, _array) {\n 'use strict';\n\n class ForEachTests extends _internalTestHelpers.AbstractTestCase {\n '@test forEach should iterate over list'() {\n let obj = this.newObject();\n let ary = this.toArray(obj);\n let found = [];\n\n obj.forEach(i => found.push(i));\n this.assert.deepEqual(found, ary, 'items passed during forEach should match');\n }\n\n '@test forEach should iterate over list after mutation'() {\n if ((0, _metal.get)(this, 'canTestMutation')) {\n this.assert.expect(0);\n return;\n }\n\n let obj = this.newObject();\n let ary = this.toArray(obj);\n let found = [];\n\n obj.forEach(i => found.push(i));\n this.assert.deepEqual(found, ary, 'items passed during forEach should match');\n\n this.mutate(obj);\n ary = this.toArray(obj);\n found = [];\n\n obj.forEach(i => found.push(i));\n this.assert.deepEqual(found, ary, 'items passed during forEach should match');\n }\n\n '@test 2nd target parameter'() {\n let obj = this.newObject();\n let target = this;\n\n obj.forEach(() => {\n // ES6TODO: When transpiled we will end up with \"use strict\" which disables automatically binding to the global context.\n // Therefore, the following test can never pass in strict mode unless we modify the `map` function implementation to\n // use `Ember.lookup` if target is not specified.\n //\n // equal(guidFor(this), guidFor(global), 'should pass the global object as this if no context');\n });\n\n obj.forEach(() => {\n this.assert.equal((0, _utils.guidFor)(this), (0, _utils.guidFor)(target), 'should pass target as this if context');\n }, target);\n }\n\n '@test callback params'() {\n let obj = this.newObject();\n let ary = this.toArray(obj);\n let loc = 0;\n\n obj.forEach((item, idx, enumerable) => {\n this.assert.equal(item, ary[loc], 'item param');\n this.assert.equal(idx, loc, 'idx param');\n this.assert.equal((0, _utils.guidFor)(enumerable), (0, _utils.guidFor)(obj), 'enumerable param');\n loc++;\n });\n }\n }\n\n (0, _array.runArrayTests)('forEach', ForEachTests);\n});","enifed('@ember/-internals/runtime/tests/array/includes-test', ['internal-test-helpers', '@ember/-internals/runtime/tests/helpers/array'], function (_internalTestHelpers, _array) {\n 'use strict';\n\n class IncludesTests extends _internalTestHelpers.AbstractTestCase {\n '@test includes returns correct value if startAt is positive'() {\n let data = (0, _array.newFixture)(3);\n let obj = this.newObject(data);\n\n this.assert.equal(obj.includes(data[1], 1), true, 'should return true if included');\n this.assert.equal(obj.includes(data[0], 1), false, 'should return false if not included');\n }\n\n '@test includes returns correct value if startAt is negative'() {\n let data = (0, _array.newFixture)(3);\n let obj = this.newObject(data);\n\n this.assert.equal(obj.includes(data[1], -2), true, 'should return true if included');\n this.assert.equal(obj.includes(data[0], -2), false, 'should return false if not included');\n }\n\n '@test includes returns true if startAt + length is still negative'() {\n let data = (0, _array.newFixture)(1);\n let obj = this.newObject(data);\n\n this.assert.equal(obj.includes(data[0], -2), true, 'should return true if included');\n this.assert.equal(obj.includes((0, _array.newFixture)(1), -2), false, 'should return false if not included');\n }\n\n '@test includes returns false if startAt out of bounds'() {\n let data = (0, _array.newFixture)(1);\n let obj = this.newObject(data);\n\n this.assert.equal(obj.includes(data[0], 2), false, 'should return false if startAt >= length');\n this.assert.equal(obj.includes((0, _array.newFixture)(1), 2), false, 'should return false if startAt >= length');\n }\n }\n\n (0, _array.runArrayTests)('includes', IncludesTests);\n});","enifed('@ember/-internals/runtime/tests/array/indexOf-test', ['internal-test-helpers', '@ember/-internals/runtime/tests/helpers/array'], function (_internalTestHelpers, _array) {\n 'use strict';\n\n class IndexOfTests extends _internalTestHelpers.AbstractTestCase {\n '@test should return index of object'() {\n let expected = (0, _array.newFixture)(3);\n let obj = this.newObject(expected);\n let len = 3;\n\n for (let idx = 0; idx < len; idx++) {\n this.assert.equal(obj.indexOf(expected[idx]), idx, `obj.indexOf(${expected[idx]}) should match idx`);\n }\n }\n\n '@test should return -1 when requesting object not in index'() {\n let obj = this.newObject((0, _array.newFixture)(3));\n let foo = {};\n\n this.assert.equal(obj.indexOf(foo), -1, 'obj.indexOf(foo) should be < 0');\n }\n }\n\n (0, _array.runArrayTests)('indexOf', IndexOfTests);\n});","enifed('@ember/-internals/runtime/tests/array/invoke-test', ['@ember/-internals/runtime/index', 'internal-test-helpers', '@ember/-internals/runtime/tests/helpers/array'], function (_index, _internalTestHelpers, _array) {\n 'use strict';\n\n class InvokeTests extends _internalTestHelpers.AbstractTestCase {\n '@test invoke should call on each object that implements'() {\n let cnt, ary, obj;\n\n function F(amt) {\n cnt += amt === undefined ? 1 : amt;\n }\n cnt = 0;\n ary = [{ foo: F }, _index.Object.create({ foo: F }),\n\n // NOTE: does not impl foo - invoke should just skip\n _index.Object.create({ bar: F }), { foo: F }];\n\n obj = this.newObject(ary);\n obj.invoke('foo');\n this.assert.equal(cnt, 3, 'should have invoked 3 times');\n\n cnt = 0;\n obj.invoke('foo', 2);\n this.assert.equal(cnt, 6, 'should have invoked 3 times, passing param');\n }\n\n '@test invoke should return an array containing the results of each invoked method'(assert) {\n let obj = this.newObject([{\n foo() {\n return 'one';\n }\n }, {}, // intentionally not including `foo` method\n {\n foo() {\n return 'two';\n }\n }]);\n\n let result = obj.invoke('foo');\n assert.deepEqual(result, ['one', undefined, 'two']);\n }\n\n '@test invoke should return an extended array (aka Ember.A)'(assert) {\n let obj = this.newObject([{ foo() {} }, { foo() {} }]);\n\n let result = obj.invoke('foo');\n\n assert.ok(_index.NativeArray.detect(result), 'NativeArray has been applied');\n }\n }\n\n (0, _array.runArrayTests)('invoke', InvokeTests);\n});","enifed('@ember/-internals/runtime/tests/array/isAny-test', ['@ember/-internals/runtime/lib/system/object', 'internal-test-helpers', '@ember/-internals/runtime/tests/helpers/array'], function (_object, _internalTestHelpers, _array) {\n 'use strict';\n\n class IsAnyTests extends _internalTestHelpers.AbstractTestCase {\n '@test should return true of any property matches'() {\n let obj = this.newObject([{ foo: 'foo', bar: 'BAZ' }, _object.default.create({ foo: 'foo', bar: 'bar' })]);\n\n this.assert.equal(obj.isAny('foo', 'foo'), true, 'isAny(foo)');\n this.assert.equal(obj.isAny('bar', 'bar'), true, 'isAny(bar)');\n this.assert.equal(obj.isAny('bar', 'BIFF'), false, 'isAny(BIFF)');\n }\n\n '@test should return true of any property is true'() {\n let obj = this.newObject([{ foo: 'foo', bar: true }, _object.default.create({ foo: 'bar', bar: false })]);\n\n // different values - all eval to true\n this.assert.equal(obj.isAny('foo'), true, 'isAny(foo)');\n this.assert.equal(obj.isAny('bar'), true, 'isAny(bar)');\n this.assert.equal(obj.isAny('BIFF'), false, 'isAny(biff)');\n }\n\n '@test should return true if any property matches null'() {\n let obj = this.newObject([{ foo: null, bar: 'bar' }, _object.default.create({ foo: 'foo', bar: null })]);\n\n this.assert.equal(obj.isAny('foo', null), true, \"isAny('foo', null)\");\n this.assert.equal(obj.isAny('bar', null), true, \"isAny('bar', null)\");\n }\n\n '@test should return true if any property is undefined'() {\n let obj = this.newObject([{ foo: undefined, bar: 'bar' }, _object.default.create({ foo: 'foo' })]);\n\n this.assert.equal(obj.isAny('foo', undefined), true, \"isAny('foo', undefined)\");\n this.assert.equal(obj.isAny('bar', undefined), true, \"isAny('bar', undefined)\");\n }\n\n '@test should not match undefined properties without second argument'() {\n let obj = this.newObject([{ foo: undefined }, _object.default.create({})]);\n\n this.assert.equal(obj.isAny('foo'), false, \"isAny('foo', undefined)\");\n }\n }\n\n (0, _array.runArrayTests)('isAny', IsAnyTests);\n});","enifed('@ember/-internals/runtime/tests/array/lastIndexOf-test', ['@ember/-internals/metal', 'internal-test-helpers', '@ember/-internals/runtime/tests/helpers/array'], function (_metal, _internalTestHelpers, _array) {\n 'use strict';\n\n class LastIndexOfTests extends _internalTestHelpers.AbstractTestCase {\n \"@test should return index of object's last occurrence\"() {\n let expected = (0, _array.newFixture)(3);\n let obj = this.newObject(expected);\n let len = 3;\n\n for (let idx = 0; idx < len; idx++) {\n this.assert.equal(obj.lastIndexOf(expected[idx]), idx, `obj.lastIndexOf(${expected[idx]}) should match idx`);\n }\n }\n\n \"@test should return index of object's last occurrence even startAt search location is equal to length\"() {\n let expected = (0, _array.newFixture)(3);\n let obj = this.newObject(expected);\n let len = 3;\n\n for (let idx = 0; idx < len; idx++) {\n this.assert.equal(obj.lastIndexOf(expected[idx], len), idx, `obj.lastIndexOfs(${expected[idx]}) should match idx`);\n }\n }\n\n \"@test should return index of object's last occurrence even startAt search location is greater than length\"() {\n let expected = (0, _array.newFixture)(3);\n let obj = this.newObject(expected);\n let len = 3;\n\n for (let idx = 0; idx < len; idx++) {\n this.assert.equal(obj.lastIndexOf(expected[idx], len + 1), idx, `obj.lastIndexOf(${expected[idx]}) should match idx`);\n }\n }\n\n '@test should return -1 when no match is found'() {\n let obj = this.newObject((0, _array.newFixture)(3));\n let foo = {};\n\n this.assert.equal(obj.lastIndexOf(foo), -1, 'obj.lastIndexOf(foo) should be -1');\n }\n\n '@test should return -1 when no match is found even startAt search location is equal to length'() {\n let obj = this.newObject((0, _array.newFixture)(3));\n let foo = {};\n\n this.assert.equal(obj.lastIndexOf(foo, (0, _metal.get)(obj, 'length')), -1, 'obj.lastIndexOf(foo) should be -1');\n }\n\n '@test should return -1 when no match is found even startAt search location is greater than length'() {\n let obj = this.newObject((0, _array.newFixture)(3));\n let foo = {};\n\n this.assert.equal(obj.lastIndexOf(foo, (0, _metal.get)(obj, 'length') + 1), -1, 'obj.lastIndexOf(foo) should be -1');\n }\n }\n\n (0, _array.runArrayTests)('lastIndexOf', LastIndexOfTests);\n});","enifed('@ember/-internals/runtime/tests/array/lastObject-test', ['internal-test-helpers', '@ember/-internals/runtime/tests/helpers/array', '@ember/-internals/metal'], function (_internalTestHelpers, _array, _metal) {\n 'use strict';\n\n class LastObjectTests extends _internalTestHelpers.AbstractTestCase {\n '@test returns last item in enumerable'() {\n let obj = this.newObject();\n let ary = this.toArray(obj);\n\n this.assert.equal((0, _metal.get)(obj, 'lastObject'), ary[ary.length - 1]);\n }\n\n '@test returns undefined if enumerable is empty'() {\n let obj = this.newObject([]);\n\n this.assert.equal((0, _metal.get)(obj, 'lastObject'), undefined);\n }\n\n '@test can not be set'() {\n let obj = this.newObject();\n let ary = this.toArray(obj);\n\n this.assert.equal((0, _metal.get)(obj, 'lastObject'), ary[ary.length - 1]);\n\n this.assert.throws(function () {\n (0, _metal.set)(obj, 'lastObject', 'foo!');\n }, /Cannot set read-only property \"lastObject\" on object/);\n }\n }\n\n (0, _array.runArrayTests)('lastObject', LastObjectTests);\n});","enifed('@ember/-internals/runtime/tests/array/map-test', ['@ember/-internals/utils', 'internal-test-helpers', '@ember/-internals/runtime/tests/helpers/array', '@ember/-internals/metal'], function (_utils, _internalTestHelpers, _array, _metal) {\n 'use strict';\n\n const mapFunc = item => item ? item.toString() : null;\n\n class MapTests extends _internalTestHelpers.AbstractTestCase {\n '@test map should iterate over list'() {\n let obj = this.newObject();\n let ary = this.toArray(obj).map(mapFunc);\n let found = [];\n\n found = obj.map(mapFunc);\n this.assert.deepEqual(found, ary, 'mapped arrays should match');\n }\n\n '@test map should iterate over list after mutation'() {\n if ((0, _metal.get)(this, 'canTestMutation')) {\n this.assert.expect(0);\n return;\n }\n\n let obj = this.newObject();\n let ary = this.toArray(obj).map(mapFunc);\n let found;\n\n found = obj.map(mapFunc);\n this.assert.deepEqual(found, ary, 'items passed during forEach should match');\n\n this.mutate(obj);\n ary = this.toArray(obj).map(mapFunc);\n found = obj.map(mapFunc);\n this.assert.deepEqual(found, ary, 'items passed during forEach should match');\n }\n\n '@test 2nd target parameter'() {\n let obj = this.newObject();\n let target = this;\n\n obj.map(() => {\n // ES6TODO: When transpiled we will end up with \"use strict\" which disables automatically binding to the global context.\n // Therefore, the following test can never pass in strict mode unless we modify the `map` function implementation to\n // use `Ember.lookup` if target is not specified.\n //\n // equal(guidFor(this), guidFor(global), 'should pass the global object as this if no context');\n });\n\n obj.map(() => {\n this.assert.equal((0, _utils.guidFor)(this), (0, _utils.guidFor)(target), 'should pass target as this if context');\n }, target);\n }\n\n '@test callback params'() {\n let obj = this.newObject();\n let ary = this.toArray(obj);\n let loc = 0;\n\n obj.map((item, idx, enumerable) => {\n this.assert.equal(item, ary[loc], 'item param');\n this.assert.equal(idx, loc, 'idx param');\n this.assert.equal((0, _utils.guidFor)(enumerable), (0, _utils.guidFor)(obj), 'enumerable param');\n loc++;\n });\n }\n }\n\n (0, _array.runArrayTests)('map', MapTests);\n});","enifed('@ember/-internals/runtime/tests/array/mapBy-test', ['internal-test-helpers', '@ember/-internals/runtime/tests/helpers/array'], function (_internalTestHelpers, _array) {\n 'use strict';\n\n class MapByTests extends _internalTestHelpers.AbstractTestCase {\n '@test get value of each property'() {\n let obj = this.newObject([{ a: 1 }, { a: 2 }]);\n this.assert.equal(obj.mapBy('a').join(''), '12');\n }\n\n '@test should work also through getEach alias'() {\n let obj = this.newObject([{ a: 1 }, { a: 2 }]);\n this.assert.equal(obj.getEach('a').join(''), '12');\n }\n }\n\n (0, _array.runArrayTests)('mapBy', MapByTests);\n});","enifed('@ember/-internals/runtime/tests/array/objectAt-test', ['internal-test-helpers', '@ember/-internals/runtime/tests/helpers/array'], function (_internalTestHelpers, _array) {\n 'use strict';\n\n class ObjectAtTests extends _internalTestHelpers.AbstractTestCase {\n '@test should return object at specified index'() {\n let expected = (0, _array.newFixture)(3);\n let obj = this.newObject(expected);\n let len = expected.length;\n\n for (let idx = 0; idx < len; idx++) {\n this.assert.equal(obj.objectAt(idx), expected[idx], `obj.objectAt(${idx}) should match`);\n }\n }\n\n '@test should return undefined when requesting objects beyond index'() {\n let obj;\n\n obj = this.newObject((0, _array.newFixture)(3));\n this.assert.equal(obj.objectAt(obj, 5), undefined, 'should return undefined for obj.objectAt(5) when len = 3');\n\n obj = this.newObject([]);\n this.assert.equal(obj.objectAt(obj, 0), undefined, 'should return undefined for obj.objectAt(0) when len = 0');\n }\n }\n\n (0, _array.runArrayTests)('objectAt', ObjectAtTests);\n});","enifed('@ember/-internals/runtime/tests/array/reduce-test', ['internal-test-helpers', '@ember/-internals/runtime/tests/helpers/array'], function (_internalTestHelpers, _array) {\n 'use strict';\n\n class ReduceTests extends _internalTestHelpers.AbstractTestCase {\n '@test collects a summary value from an enumeration'() {\n let obj = this.newObject([1, 2, 3]);\n let res = obj.reduce((previousValue, item) => previousValue + item, 0);\n this.assert.equal(res, 6);\n }\n\n '@test passes index of item to callback'() {\n let obj = this.newObject([1, 2, 3]);\n let res = obj.reduce((previousValue, item, index) => previousValue + index, 0);\n this.assert.equal(res, 3);\n }\n\n '@test passes enumerable object to callback'() {\n let obj = this.newObject([1, 2, 3]);\n let res = obj.reduce((previousValue, item, index, enumerable) => enumerable, 0);\n this.assert.equal(res, obj);\n }\n }\n\n (0, _array.runArrayTests)('reduce', ReduceTests);\n});","enifed('@ember/-internals/runtime/tests/array/reject-test', ['internal-test-helpers', '@ember/-internals/runtime/tests/helpers/array', '@ember/-internals/runtime/lib/system/object'], function (_internalTestHelpers, _array, _object) {\n 'use strict';\n\n class RejectTest extends _internalTestHelpers.AbstractTestCase {\n '@test should reject any item that does not meet the condition'() {\n let obj = this.newObject([1, 2, 3, 4]);\n let result;\n\n result = obj.reject(i => i < 3);\n this.assert.deepEqual(result, [3, 4], 'reject the correct items');\n }\n\n '@test should be the inverse of filter'() {\n let obj = this.newObject([1, 2, 3, 4]);\n let isEven = i => i % 2 === 0;\n let filtered, rejected;\n\n filtered = obj.filter(isEven);\n rejected = obj.reject(isEven);\n\n this.assert.deepEqual(filtered, [2, 4], 'filtered evens');\n this.assert.deepEqual(rejected, [1, 3], 'rejected evens');\n }\n }\n\n class RejectByTest extends _internalTestHelpers.AbstractTestCase {\n '@test should reject based on object'() {\n let obj, ary;\n\n ary = [{ foo: 'foo', bar: 'BAZ' }, _object.default.create({ foo: 'foo', bar: 'bar' })];\n\n obj = this.newObject(ary);\n\n this.assert.deepEqual(obj.rejectBy('foo', 'foo'), [], 'rejectBy(foo)');\n this.assert.deepEqual(obj.rejectBy('bar', 'bar'), [ary[0]], 'rejectBy(bar)');\n }\n\n '@test should include in result if property is false'() {\n let obj, ary;\n\n ary = [{ foo: false, bar: true }, _object.default.create({ foo: false, bar: false })];\n\n obj = this.newObject(ary);\n\n this.assert.deepEqual(obj.rejectBy('foo'), ary, 'rejectBy(foo)');\n this.assert.deepEqual(obj.rejectBy('bar'), [ary[1]], 'rejectBy(bar)');\n }\n\n '@test should reject on second argument if provided'() {\n let obj, ary;\n\n ary = [{ name: 'obj1', foo: 3 }, _object.default.create({ name: 'obj2', foo: 2 }), { name: 'obj3', foo: 2 }, _object.default.create({ name: 'obj4', foo: 3 })];\n\n obj = this.newObject(ary);\n\n this.assert.deepEqual(obj.rejectBy('foo', 3), [ary[1], ary[2]], \"rejectBy('foo', 3)')\");\n }\n\n '@test should correctly reject null second argument'() {\n let obj, ary;\n\n ary = [{ name: 'obj1', foo: 3 }, _object.default.create({ name: 'obj2', foo: null }), { name: 'obj3', foo: null }, _object.default.create({ name: 'obj4', foo: 3 })];\n\n obj = this.newObject(ary);\n\n this.assert.deepEqual(obj.rejectBy('foo', null), [ary[0], ary[3]], \"rejectBy('foo', null)')\");\n }\n\n '@test should correctly reject undefined second argument'() {\n let obj, ary;\n\n ary = [{ name: 'obj1', foo: 3 }, _object.default.create({ name: 'obj2', foo: 2 })];\n\n obj = this.newObject(ary);\n\n this.assert.deepEqual(obj.rejectBy('bar', undefined), [], \"rejectBy('bar', undefined)')\");\n }\n\n '@test should correctly reject explicit undefined second argument'() {\n let obj, ary;\n\n ary = [{ name: 'obj1', foo: 3 }, _object.default.create({ name: 'obj2', foo: 3 }), { name: 'obj3', foo: undefined }, _object.default.create({ name: 'obj4', foo: undefined }), { name: 'obj5' }, _object.default.create({ name: 'obj6' })];\n\n obj = this.newObject(ary);\n\n this.assert.deepEqual(obj.rejectBy('foo', undefined), ary.slice(0, 2), \"rejectBy('foo', undefined)')\");\n }\n\n '@test should match undefined, null, or false properties without second argument'() {\n let obj, ary;\n\n ary = [{ name: 'obj1', foo: 3 }, _object.default.create({ name: 'obj2', foo: 3 }), { name: 'obj3', foo: undefined }, _object.default.create({ name: 'obj4', foo: undefined }), { name: 'obj5' }, _object.default.create({ name: 'obj6' }), { name: 'obj7', foo: null }, _object.default.create({ name: 'obj8', foo: null }), { name: 'obj9', foo: false }, _object.default.create({ name: 'obj10', foo: false })];\n\n obj = this.newObject(ary);\n\n this.assert.deepEqual(obj.rejectBy('foo'), ary.slice(2), \"rejectBy('foo')')\");\n }\n }\n\n (0, _array.runArrayTests)('reject', RejectTest);\n (0, _array.runArrayTests)('rejectBy', RejectByTest);\n});","enifed('@ember/-internals/runtime/tests/array/sortBy-test', ['@ember/-internals/metal', 'internal-test-helpers', '@ember/-internals/runtime/tests/helpers/array'], function (_metal, _internalTestHelpers, _array) {\n 'use strict';\n\n class SortByTests extends _internalTestHelpers.AbstractTestCase {\n '@test sort by value of property'() {\n let obj = this.newObject([{ a: 2 }, { a: 1 }]);\n let sorted = obj.sortBy('a');\n\n this.assert.equal((0, _metal.get)(sorted[0], 'a'), 1);\n this.assert.equal((0, _metal.get)(sorted[1], 'a'), 2);\n }\n\n '@test supports multiple propertyNames'() {\n let obj = this.newObject([{ a: 1, b: 2 }, { a: 1, b: 1 }]);\n let sorted = obj.sortBy('a', 'b');\n\n this.assert.equal((0, _metal.get)(sorted[0], 'b'), 1);\n this.assert.equal((0, _metal.get)(sorted[1], 'b'), 2);\n }\n }\n\n (0, _array.runArrayTests)('sortBy', SortByTests);\n});","enifed('@ember/-internals/runtime/tests/array/toArray-test', ['internal-test-helpers', '@ember/-internals/runtime/tests/helpers/array'], function (_internalTestHelpers, _array) {\n 'use strict';\n\n class ToArrayTests extends _internalTestHelpers.AbstractTestCase {\n '@test toArray should convert to an array'() {\n let obj = this.newObject();\n this.assert.deepEqual(obj.toArray(), this.toArray(obj));\n }\n }\n\n (0, _array.runArrayTests)('toArray', ToArrayTests);\n});","enifed('@ember/-internals/runtime/tests/array/uniq-test', ['internal-test-helpers', '@ember/-internals/runtime/tests/helpers/array'], function (_internalTestHelpers, _array) {\n 'use strict';\n\n class UniqTests extends _internalTestHelpers.AbstractTestCase {\n '@test should return new instance with duplicates removed'() {\n let before, after, obj, ret;\n\n after = (0, _array.newFixture)(3);\n before = [after[0], after[1], after[2], after[1], after[0]];\n obj = this.newObject(before);\n before = obj.toArray(); // in case of set before will be different...\n\n ret = obj.uniq();\n this.assert.deepEqual(this.toArray(ret), after, 'should have removed item');\n this.assert.deepEqual(this.toArray(obj), before, 'should not have changed original');\n }\n\n '@test should return duplicate of same content if no duplicates found'() {\n let item, obj, ret;\n obj = this.newObject((0, _array.newFixture)(3));\n ret = obj.uniq(item);\n this.assert.ok(ret !== obj, 'should not be same object');\n this.assert.deepEqual(this.toArray(ret), this.toArray(obj), 'should be the same content');\n }\n }\n\n (0, _array.runArrayTests)('uniq', UniqTests);\n});","enifed('@ember/-internals/runtime/tests/array/uniqBy-test', ['internal-test-helpers', '@ember/-internals/runtime/tests/helpers/array'], function (_internalTestHelpers, _array) {\n 'use strict';\n\n class UniqByTests extends _internalTestHelpers.AbstractTestCase {\n '@test should return new instance with duplicates removed'() {\n let numbers = this.newObject([{ id: 1, value: 'one' }, { id: 2, value: 'two' }, { id: 1, value: 'one' }]);\n this.assert.deepEqual(numbers.uniqBy('id'), [{ id: 1, value: 'one' }, { id: 2, value: 'two' }]);\n }\n\n '@test supports function as key'() {\n let numbers = this.newObject([{ id: 1, value: 'boom' }, { id: 2, value: 'boom' }, { id: 1, value: 'doom' }]);\n\n let keyFunction = val => {\n this.assert.equal(arguments.length, 1);\n return val.value;\n };\n\n this.assert.deepEqual(numbers.uniqBy(keyFunction), [{ id: 1, value: 'boom' }, { id: 1, value: 'doom' }]);\n }\n }\n\n (0, _array.runArrayTests)('uniqBy', UniqByTests);\n});","enifed('@ember/-internals/runtime/tests/array/without-test', ['internal-test-helpers', '@ember/-internals/runtime/tests/helpers/array'], function (_internalTestHelpers, _array) {\n 'use strict';\n\n class WithoutTests extends _internalTestHelpers.AbstractTestCase {\n '@test should return new instance with item removed'() {\n let before, after, obj, ret;\n\n before = (0, _array.newFixture)(3);\n after = [before[0], before[2]];\n obj = this.newObject(before);\n\n ret = obj.without(before[1]);\n this.assert.deepEqual(this.toArray(ret), after, 'should have removed item');\n this.assert.deepEqual(this.toArray(obj), before, 'should not have changed original');\n }\n\n '@test should remove NaN value'() {\n let before, after, obj, ret;\n\n before = [...(0, _array.newFixture)(2), NaN];\n after = [before[0], before[1]];\n obj = this.newObject(before);\n\n ret = obj.without(NaN);\n this.assert.deepEqual(this.toArray(ret), after, 'should have removed item');\n }\n\n '@test should return same instance if object not found'() {\n let item, obj, ret;\n\n item = (0, _array.newFixture)(1)[0];\n obj = this.newObject((0, _array.newFixture)(3));\n\n ret = obj.without(item);\n this.assert.equal(ret, obj, 'should be same instance');\n }\n }\n\n (0, _array.runArrayTests)('without', WithoutTests);\n});","enifed('@ember/-internals/runtime/tests/copyable-array/copy-test', ['internal-test-helpers', '@ember/-internals/runtime/tests/helpers/array'], function (_internalTestHelpers, _array) {\n 'use strict';\n\n class CopyTest extends _internalTestHelpers.AbstractTestCase {\n '@test should return an equivalent copy'() {\n let obj = this.newObject();\n let copy = obj.copy();\n this.assert.ok(this.isEqual(obj, copy), 'old object and new object should be equivalent');\n }\n }\n\n (0, _array.runArrayTests)('copy', CopyTest, 'CopyableNativeArray', 'CopyableArray');\n});","enifed('@ember/-internals/runtime/tests/core/compare_test', ['@ember/-internals/runtime/lib/type-of', '@ember/-internals/runtime/lib/system/object', '@ember/-internals/runtime/lib/compare', '@ember/-internals/runtime/lib/mixins/comparable', 'internal-test-helpers'], function (_typeOf, _object, _compare, _comparable, _internalTestHelpers) {\n 'use strict';\n\n let data = [];\n let Comp = _object.default.extend(_comparable.default);\n\n Comp.reopenClass({\n compare(obj) {\n return obj.get('val');\n }\n });\n\n (0, _internalTestHelpers.moduleFor)('Ember.compare()', class extends _internalTestHelpers.AbstractTestCase {\n beforeEach() {\n data[0] = null;\n data[1] = false;\n data[2] = true;\n data[3] = -12;\n data[4] = 3.5;\n data[5] = 'a string';\n data[6] = 'another string';\n data[7] = 'last string';\n data[8] = [1, 2];\n data[9] = [1, 2, 3];\n data[10] = [1, 3];\n data[11] = { a: 'hash' };\n data[12] = _object.default.create();\n data[13] = function (a) {\n return a;\n };\n data[14] = new Date('2012/01/01');\n data[15] = new Date('2012/06/06');\n }\n\n ['@test ordering should work'](assert) {\n let suspect, comparable, failureMessage, suspectIndex, comparableIndex;\n\n for (suspectIndex = 0; suspectIndex < data.length; suspectIndex++) {\n suspect = data[suspectIndex];\n\n assert.equal((0, _compare.default)(suspect, suspect), 0, suspectIndex + ' should equal itself');\n\n for (comparableIndex = suspectIndex + 1; comparableIndex < data.length; comparableIndex++) {\n comparable = data[comparableIndex];\n\n failureMessage = 'data[' + suspectIndex + '] (' + (0, _typeOf.typeOf)(suspect) + ') should be smaller than data[' + comparableIndex + '] (' + (0, _typeOf.typeOf)(comparable) + ')';\n\n assert.equal((0, _compare.default)(suspect, comparable), -1, failureMessage);\n }\n }\n }\n\n ['@test comparables should return values in the range of -1, 0, 1'](assert) {\n let negOne = Comp.create({\n val: -1\n });\n\n let zero = Comp.create({\n val: 0\n });\n\n let one = Comp.create({\n val: 1\n });\n\n assert.equal((0, _compare.default)(negOne, 'a'), -1, 'First item comparable - returns -1 (not negated)');\n assert.equal((0, _compare.default)(zero, 'b'), 0, 'First item comparable - returns 0 (not negated)');\n assert.equal((0, _compare.default)(one, 'c'), 1, 'First item comparable - returns 1 (not negated)');\n\n assert.equal((0, _compare.default)('a', negOne), 1, 'Second item comparable - returns -1 (negated)');\n assert.equal((0, _compare.default)('b', zero), 0, 'Second item comparable - returns 0 (negated)');\n assert.equal((0, _compare.default)('c', one), -1, 'Second item comparable - returns 1 (negated)');\n }\n });\n});","enifed('@ember/-internals/runtime/tests/core/copy_test', ['@ember/-internals/runtime/lib/copy', 'internal-test-helpers'], function (_copy, _internalTestHelpers) {\n 'use strict';\n\n (0, _internalTestHelpers.moduleFor)('Ember Copy Method', class extends _internalTestHelpers.AbstractTestCase {\n ['@test Ember.copy null'](assert) {\n let obj = { field: null };\n let copied = null;\n expectDeprecation(() => {\n copied = (0, _copy.default)(obj, true);\n }, 'Use ember-copy addon instead of copy method and Copyable mixin.');\n assert.equal(copied.field, null, 'null should still be null');\n }\n\n ['@test Ember.copy date'](assert) {\n let date = new Date(2014, 7, 22);\n let dateCopy = null;\n expectDeprecation(() => {\n dateCopy = (0, _copy.default)(date);\n }, 'Use ember-copy addon instead of copy method and Copyable mixin.');\n assert.equal(date.getTime(), dateCopy.getTime(), 'dates should be equivalent');\n }\n\n ['@test Ember.copy null prototype object'](assert) {\n let obj = Object.create(null);\n\n obj.foo = 'bar';\n let copied = null;\n expectDeprecation(() => {\n copied = (0, _copy.default)(obj);\n }, 'Use ember-copy addon instead of copy method and Copyable mixin.');\n\n assert.equal(copied.foo, 'bar', 'bar should still be bar');\n }\n\n ['@test Ember.copy Array'](assert) {\n let array = [1, null, new Date(2015, 9, 9), 'four'];\n let arrayCopy = null;\n expectDeprecation(() => {\n arrayCopy = (0, _copy.default)(array);\n }, 'Use ember-copy addon instead of copy method and Copyable mixin.');\n\n assert.deepEqual(array, arrayCopy, 'array content cloned successfully in new array');\n }\n\n ['@test Ember.copy cycle detection'](assert) {\n let obj = {\n foo: {\n bar: 'bar'\n }\n };\n obj.foo.foo = obj.foo;\n let cycleCopy = null;\n expectDeprecation(() => {\n cycleCopy = (0, _copy.default)(obj, true);\n }, 'Use ember-copy addon instead of copy method and Copyable mixin.');\n\n assert.equal(cycleCopy.foo.bar, 'bar');\n assert.notEqual(cycleCopy.foo.foo, obj.foo.foo);\n assert.strictEqual(cycleCopy.foo.foo, cycleCopy.foo.foo);\n }\n });\n});","enifed('@ember/-internals/runtime/tests/core/isEqual_test', ['@ember/-internals/runtime/lib/is-equal', 'internal-test-helpers'], function (_isEqual, _internalTestHelpers) {\n 'use strict';\n\n (0, _internalTestHelpers.moduleFor)('isEqual', class extends _internalTestHelpers.AbstractTestCase {\n ['@test undefined and null'](assert) {\n assert.ok((0, _isEqual.default)(undefined, undefined), 'undefined is equal to undefined');\n assert.ok(!(0, _isEqual.default)(undefined, null), 'undefined is not equal to null');\n assert.ok((0, _isEqual.default)(null, null), 'null is equal to null');\n assert.ok(!(0, _isEqual.default)(null, undefined), 'null is not equal to undefined');\n }\n\n ['@test strings should be equal'](assert) {\n assert.ok(!(0, _isEqual.default)('Hello', 'Hi'), 'different Strings are unequal');\n assert.ok((0, _isEqual.default)('Hello', 'Hello'), 'same Strings are equal');\n }\n\n ['@test numericals should be equal'](assert) {\n assert.ok((0, _isEqual.default)(24, 24), 'same numbers are equal');\n assert.ok(!(0, _isEqual.default)(24, 21), 'different numbers are inequal');\n }\n\n ['@test dates should be equal'](assert) {\n assert.ok((0, _isEqual.default)(new Date(1985, 7, 22), new Date(1985, 7, 22)), 'same dates are equal');\n assert.ok(!(0, _isEqual.default)(new Date(2014, 7, 22), new Date(1985, 7, 22)), 'different dates are not equal');\n }\n\n ['@test array should be equal'](assert) {\n // NOTE: We don't test for array contents -- that would be too expensive.\n assert.ok(!(0, _isEqual.default)([1, 2], [1, 2]), 'two array instances with the same values should not be equal');\n assert.ok(!(0, _isEqual.default)([1, 2], [1]), 'two array instances with different values should not be equal');\n }\n\n ['@test first object implements isEqual should use it'](assert) {\n assert.ok((0, _isEqual.default)({\n isEqual() {\n return true;\n }\n }, null), 'should return true always');\n\n let obj = {\n isEqual() {\n return false;\n }\n };\n assert.equal((0, _isEqual.default)(obj, obj), false, 'should return false because isEqual returns false');\n }\n });\n});","enifed('@ember/-internals/runtime/tests/core/is_array_test', ['@ember/-internals/runtime/lib/mixins/array', '@ember/-internals/runtime/lib/system/array_proxy', '@ember/-internals/runtime/lib/system/object', '@ember/-internals/browser-environment', 'internal-test-helpers'], function (_array, _array_proxy, _object, _browserEnvironment, _internalTestHelpers) {\n 'use strict';\n\n const global = undefined;\n\n (0, _internalTestHelpers.moduleFor)('Ember Type Checking', class extends _internalTestHelpers.AbstractTestCase {\n ['@test Ember.isArray'](assert) {\n let numarray = [1, 2, 3];\n let number = 23;\n let strarray = ['Hello', 'Hi'];\n let string = 'Hello';\n let object = {};\n let length = { length: 12 };\n let strangeLength = { length: 'yes' };\n let fn = function () {};\n let arrayProxy = _array_proxy.default.create({ content: (0, _array.A)() });\n\n assert.equal((0, _array.isArray)(numarray), true, '[1,2,3]');\n assert.equal((0, _array.isArray)(number), false, '23');\n assert.equal((0, _array.isArray)(strarray), true, '[\"Hello\", \"Hi\"]');\n assert.equal((0, _array.isArray)(string), false, '\"Hello\"');\n assert.equal((0, _array.isArray)(object), false, '{}');\n assert.equal((0, _array.isArray)(length), true, '{ length: 12 }');\n assert.equal((0, _array.isArray)(strangeLength), false, '{ length: \"yes\" }');\n assert.equal((0, _array.isArray)(global), false, 'global');\n assert.equal((0, _array.isArray)(fn), false, 'function() {}');\n assert.equal((0, _array.isArray)(arrayProxy), true, '[]');\n }\n\n '@test Ember.isArray does not trigger proxy assertion when probing for length GH#16495'(assert) {\n let instance = _object.default.extend({\n // intentionally returning non-null / non-undefined\n unknownProperty() {\n return false;\n }\n }).create();\n\n assert.equal((0, _array.isArray)(instance), false);\n }\n\n ['@test Ember.isArray(fileList)'](assert) {\n if (_browserEnvironment.window && typeof _browserEnvironment.window.FileList === 'function') {\n let fileListElement = document.createElement('input');\n fileListElement.type = 'file';\n let fileList = fileListElement.files;\n assert.equal((0, _array.isArray)(fileList), false, 'fileList');\n } else {\n assert.ok(true, 'FileList is not present on window');\n }\n }\n });\n});","enifed('@ember/-internals/runtime/tests/core/is_empty_test', ['@ember/-internals/metal', '@ember/-internals/runtime/lib/system/array_proxy', '@ember/-internals/runtime/lib/mixins/array', 'internal-test-helpers'], function (_metal, _array_proxy, _array, _internalTestHelpers) {\n 'use strict';\n\n (0, _internalTestHelpers.moduleFor)('Ember.isEmpty', class extends _internalTestHelpers.AbstractTestCase {\n ['@test Ember.isEmpty'](assert) {\n let arrayProxy = _array_proxy.default.create({ content: (0, _array.A)() });\n\n assert.equal(true, (0, _metal.isEmpty)(arrayProxy), 'for an ArrayProxy that has empty content');\n }\n });\n});","enifed('@ember/-internals/runtime/tests/core/type_of_test', ['@ember/-internals/runtime/lib/type-of', '@ember/-internals/runtime/lib/system/object', '@ember/-internals/browser-environment', 'internal-test-helpers'], function (_typeOf, _object, _browserEnvironment, _internalTestHelpers) {\n 'use strict';\n\n (0, _internalTestHelpers.moduleFor)('Ember Type Checking', class extends _internalTestHelpers.AbstractTestCase {\n ['@test Ember.typeOf'](assert) {\n let MockedDate = function () {};\n MockedDate.prototype = new Date();\n\n let mockedDate = new MockedDate();\n let date = new Date();\n let error = new Error('boum');\n let object = { a: 'b' };\n let a = null;\n let arr = [1, 2, 3];\n let obj = {};\n let instance = _object.default.create({ method() {} });\n\n assert.equal((0, _typeOf.typeOf)(), 'undefined', 'undefined');\n assert.equal((0, _typeOf.typeOf)(null), 'null', 'null');\n assert.equal((0, _typeOf.typeOf)('Cyril'), 'string', 'Cyril');\n assert.equal((0, _typeOf.typeOf)(101), 'number', '101');\n assert.equal((0, _typeOf.typeOf)(true), 'boolean', 'true');\n assert.equal((0, _typeOf.typeOf)([1, 2, 90]), 'array', '[1,2,90]');\n assert.equal((0, _typeOf.typeOf)(/abc/), 'regexp', '/abc/');\n assert.equal((0, _typeOf.typeOf)(date), 'date', 'new Date()');\n assert.equal((0, _typeOf.typeOf)(mockedDate), 'date', 'mocked date');\n assert.equal((0, _typeOf.typeOf)(error), 'error', 'error');\n assert.equal((0, _typeOf.typeOf)(object), 'object', 'object');\n assert.equal((0, _typeOf.typeOf)(undefined), 'undefined', 'item of type undefined');\n assert.equal((0, _typeOf.typeOf)(a), 'null', 'item of type null');\n assert.equal((0, _typeOf.typeOf)(arr), 'array', 'item of type array');\n assert.equal((0, _typeOf.typeOf)(obj), 'object', 'item of type object');\n assert.equal((0, _typeOf.typeOf)(instance), 'instance', 'item of type instance');\n assert.equal((0, _typeOf.typeOf)(instance.method), 'function', 'item of type function');\n assert.equal((0, _typeOf.typeOf)(_object.default.extend()), 'class', 'item of type class');\n assert.equal((0, _typeOf.typeOf)(new Error()), 'error', 'item of type error');\n }\n\n ['@test Ember.typeOf(fileList)'](assert) {\n if (_browserEnvironment.window && typeof _browserEnvironment.window.FileList === 'function') {\n let fileListElement = document.createElement('input');\n fileListElement.type = 'file';\n let fileList = fileListElement.files;\n assert.equal((0, _typeOf.typeOf)(fileList), 'filelist', 'item of type filelist');\n } else {\n assert.ok(true, 'FileList is not present on window');\n }\n }\n });\n});","enifed('@ember/-internals/runtime/tests/ext/function_test', ['@ember/-internals/environment', '@ember/-internals/metal', '@ember/-internals/runtime/lib/system/object', '@ember/-internals/runtime/lib/mixins/evented', 'internal-test-helpers'], function (_environment, _metal, _object, _evented, _internalTestHelpers) {\n 'use strict';\n\n (0, _internalTestHelpers.moduleFor)('Function.prototype.observes() helper', class extends _internalTestHelpers.AbstractTestCase {\n ['@test global observer helper takes multiple params'](assert) {\n if (!_environment.ENV.EXTEND_PROTOTYPES.Function) {\n assert.ok('undefined' === typeof Function.prototype.observes, 'Function.prototype helper disabled');\n return;\n }\n\n let MyMixin = _metal.Mixin.create({\n count: 0,\n\n foo: function () {\n (0, _metal.set)(this, 'count', (0, _metal.get)(this, 'count') + 1);\n }.observes('bar', 'baz')\n });\n\n let obj = (0, _metal.mixin)({}, MyMixin);\n assert.equal((0, _metal.get)(obj, 'count'), 0, 'should not invoke observer immediately');\n\n (0, _metal.set)(obj, 'bar', 'BAZ');\n (0, _metal.set)(obj, 'baz', 'BAZ');\n assert.equal((0, _metal.get)(obj, 'count'), 2, 'should invoke observer after change');\n }\n });\n\n (0, _internalTestHelpers.moduleFor)('Function.prototype.on() helper', class extends _internalTestHelpers.AbstractTestCase {\n ['@test sets up an event listener, and can trigger the function on multiple events'](assert) {\n if (!_environment.ENV.EXTEND_PROTOTYPES.Function) {\n assert.ok('undefined' === typeof Function.prototype.on, 'Function.prototype helper disabled');\n return;\n }\n\n let MyMixin = _metal.Mixin.create({\n count: 0,\n\n foo: function () {\n (0, _metal.set)(this, 'count', (0, _metal.get)(this, 'count') + 1);\n }.on('bar', 'baz')\n });\n\n let obj = (0, _metal.mixin)({}, _evented.default, MyMixin);\n assert.equal((0, _metal.get)(obj, 'count'), 0, 'should not invoke listener immediately');\n\n obj.trigger('bar');\n obj.trigger('baz');\n assert.equal((0, _metal.get)(obj, 'count'), 2, 'should invoke listeners when events trigger');\n }\n\n ['@test can be chained with observes'](assert) {\n if (!_environment.ENV.EXTEND_PROTOTYPES.Function) {\n assert.ok('Function.prototype helper disabled');\n return;\n }\n\n let MyMixin = _metal.Mixin.create({\n count: 0,\n bay: 'bay',\n foo: function () {\n (0, _metal.set)(this, 'count', (0, _metal.get)(this, 'count') + 1);\n }.observes('bay').on('bar')\n });\n\n let obj = (0, _metal.mixin)({}, _evented.default, MyMixin);\n assert.equal((0, _metal.get)(obj, 'count'), 0, 'should not invoke listener immediately');\n\n (0, _metal.set)(obj, 'bay', 'BAY');\n obj.trigger('bar');\n assert.equal((0, _metal.get)(obj, 'count'), 2, 'should invoke observer and listener');\n }\n });\n\n (0, _internalTestHelpers.moduleFor)('Function.prototype.property() helper', class extends _internalTestHelpers.AbstractTestCase {\n ['@test sets up a ComputedProperty'](assert) {\n if (!_environment.ENV.EXTEND_PROTOTYPES.Function) {\n assert.ok('undefined' === typeof Function.prototype.property, 'Function.prototype helper disabled');\n return;\n }\n\n let MyClass = _object.default.extend({\n firstName: null,\n lastName: null,\n fullName: function () {\n return (0, _metal.get)(this, 'firstName') + ' ' + (0, _metal.get)(this, 'lastName');\n }.property('firstName', 'lastName')\n });\n\n let obj = MyClass.create({ firstName: 'Fred', lastName: 'Flinstone' });\n assert.equal((0, _metal.get)(obj, 'fullName'), 'Fred Flinstone', 'should return the computed value');\n\n (0, _metal.set)(obj, 'firstName', 'Wilma');\n assert.equal((0, _metal.get)(obj, 'fullName'), 'Wilma Flinstone', 'should return the new computed value');\n\n (0, _metal.set)(obj, 'lastName', '');\n assert.equal((0, _metal.get)(obj, 'fullName'), 'Wilma ', 'should return the new computed value');\n }\n });\n});","enifed('@ember/-internals/runtime/tests/ext/rsvp_test', ['@ember/runloop', '@ember/-internals/error-handling', '@ember/-internals/runtime/lib/ext/rsvp', '@ember/debug', 'internal-test-helpers'], function (_runloop, _errorHandling, _rsvp, _debug, _internalTestHelpers) {\n 'use strict';\n\n const ORIGINAL_ONERROR = (0, _errorHandling.getOnerror)();\n\n (0, _internalTestHelpers.moduleFor)('Ember.RSVP', class extends _internalTestHelpers.AbstractTestCase {\n afterEach() {\n (0, _errorHandling.setOnerror)(ORIGINAL_ONERROR);\n }\n\n ['@test Ensure that errors thrown from within a promise are sent to the console'](assert) {\n let error = new Error('Error thrown in a promise for testing purposes.');\n\n try {\n (0, _runloop.run)(function () {\n new _rsvp.default.Promise(function () {\n throw error;\n });\n });\n assert.ok(false, 'expected assertion to be thrown');\n } catch (e) {\n assert.equal(e, error, 'error was re-thrown');\n }\n }\n\n ['@test TransitionAborted errors are not re-thrown'](assert) {\n assert.expect(1);\n let fakeTransitionAbort = { name: 'TransitionAborted' };\n\n (0, _runloop.run)(_rsvp.default, 'reject', fakeTransitionAbort);\n\n assert.ok(true, 'did not throw an error when dealing with TransitionAborted');\n }\n\n ['@test Can reject with non-Error object'](assert) {\n let wasEmberTesting = (0, _debug.isTesting)();\n (0, _debug.setTesting)(false);\n assert.expect(1);\n\n try {\n (0, _runloop.run)(_rsvp.default, 'reject', 'foo');\n } catch (e) {\n assert.equal(e, 'foo', 'should throw with rejection message');\n } finally {\n (0, _debug.setTesting)(wasEmberTesting);\n }\n }\n\n ['@test Can reject with no arguments'](assert) {\n let wasEmberTesting = (0, _debug.isTesting)();\n (0, _debug.setTesting)(false);\n assert.expect(1);\n\n try {\n (0, _runloop.run)(_rsvp.default, 'reject');\n } catch (e) {\n assert.ok(false, 'should not throw');\n } finally {\n (0, _debug.setTesting)(wasEmberTesting);\n }\n\n assert.ok(true);\n }\n\n ['@test rejections like jqXHR which have errorThrown property work'](assert) {\n assert.expect(2);\n\n let wasEmberTesting = (0, _debug.isTesting)();\n let wasOnError = (0, _errorHandling.getOnerror)();\n\n try {\n (0, _debug.setTesting)(false);\n (0, _errorHandling.setOnerror)(error => {\n assert.equal(error, actualError, 'expected the real error on the jqXHR');\n assert.equal(error.__reason_with_error_thrown__, jqXHR, 'also retains a helpful reference to the rejection reason');\n });\n\n let actualError = new Error('OMG what really happened');\n let jqXHR = {\n errorThrown: actualError\n };\n\n (0, _runloop.run)(_rsvp.default, 'reject', jqXHR);\n } finally {\n (0, _errorHandling.setOnerror)(wasOnError);\n (0, _debug.setTesting)(wasEmberTesting);\n }\n }\n\n ['@test rejections where the errorThrown is a string should wrap the sting in an error object'](assert) {\n assert.expect(2);\n\n let wasEmberTesting = (0, _debug.isTesting)();\n let wasOnError = (0, _errorHandling.getOnerror)();\n\n try {\n (0, _debug.setTesting)(false);\n (0, _errorHandling.setOnerror)(error => {\n assert.equal(error.message, actualError, 'expected the real error on the jqXHR');\n assert.equal(error.__reason_with_error_thrown__, jqXHR, 'also retains a helpful reference to the rejection reason');\n });\n\n let actualError = 'OMG what really happened';\n let jqXHR = {\n errorThrown: actualError\n };\n\n (0, _runloop.run)(_rsvp.default, 'reject', jqXHR);\n } finally {\n (0, _errorHandling.setOnerror)(wasOnError);\n (0, _debug.setTesting)(wasEmberTesting);\n }\n }\n\n ['@test rejections can be serialized to JSON'](assert) {\n assert.expect(2);\n\n let wasEmberTesting = (0, _debug.isTesting)();\n let wasOnError = (0, _errorHandling.getOnerror)();\n\n try {\n (0, _debug.setTesting)(false);\n (0, _errorHandling.setOnerror)(error => {\n assert.equal(error.message, 'a fail');\n assert.ok(JSON.stringify(error), 'Error can be serialized');\n });\n\n let jqXHR = {\n errorThrown: new Error('a fail')\n };\n\n (0, _runloop.run)(_rsvp.default, 'reject', jqXHR);\n } finally {\n (0, _errorHandling.setOnerror)(wasOnError);\n (0, _debug.setTesting)(wasEmberTesting);\n }\n }\n });\n\n const reason = 'i failed';\n function ajax() {\n return new _rsvp.default.Promise(function (resolve) {\n setTimeout(resolve, 0); // fake true / foreign async\n });\n }\n\n (0, _internalTestHelpers.moduleFor)('Ember.test: rejection assertions', class extends _internalTestHelpers.AbstractTestCase {\n ['@test unambigiously unhandled rejection'](assert) {\n assert.throws(function () {\n (0, _runloop.run)(function () {\n _rsvp.default.Promise.reject(reason);\n }); // something is funky, we should likely assert\n }, reason);\n }\n\n ['@test sync handled'](assert) {\n (0, _runloop.run)(function () {\n _rsvp.default.Promise.reject(reason).catch(function () {});\n }); // handled, we shouldn't need to assert.\n assert.ok(true, 'reached end of test');\n }\n\n ['@test handled within the same micro-task (via Ember.RVP.Promise)'](assert) {\n (0, _runloop.run)(function () {\n let rejection = _rsvp.default.Promise.reject(reason);\n _rsvp.default.Promise.resolve(1).then(() => rejection.catch(function () {}));\n }); // handled, we shouldn't need to assert.\n assert.ok(true, 'reached end of test');\n }\n\n ['@test handled within the same micro-task (via direct run-loop)'](assert) {\n (0, _runloop.run)(function () {\n let rejection = _rsvp.default.Promise.reject(reason);\n (0, _runloop.schedule)('afterRender', () => rejection.catch(function () {}));\n }); // handled, we shouldn't need to assert.\n assert.ok(true, 'reached end of test');\n }\n\n ['@test handled in the next microTask queue flush (next)'](assert) {\n assert.expect(2);\n let done = assert.async();\n\n assert.throws(function () {\n (0, _runloop.run)(function () {\n let rejection = _rsvp.default.Promise.reject(reason);\n\n (0, _runloop.next)(() => {\n rejection.catch(function () {});\n assert.ok(true, 'reached end of test');\n done();\n });\n });\n }, reason);\n\n // a promise rejection survived a full flush of the run-loop without being handled\n // this is very likely an issue.\n }\n\n ['@test handled in the same microTask Queue flush do to data locality'](assert) {\n // an ambiguous scenario, this may or may not assert\n // it depends on the locality of `user#1`\n let store = {\n find() {\n return _rsvp.default.Promise.resolve(1);\n }\n };\n (0, _runloop.run)(function () {\n let rejection = _rsvp.default.Promise.reject(reason);\n store.find('user', 1).then(() => rejection.catch(function () {}));\n });\n\n assert.ok(true, 'reached end of test');\n }\n\n ['@test handled in a different microTask Queue flush do to data locality'](assert) {\n let done = assert.async();\n // an ambiguous scenario, this may or may not assert\n // it depends on the locality of `user#1`\n let store = {\n find() {\n return ajax();\n }\n };\n assert.throws(function () {\n (0, _runloop.run)(function () {\n let rejection = _rsvp.default.Promise.reject(reason);\n store.find('user', 1).then(() => {\n rejection.catch(function () {});\n assert.ok(true, 'reached end of test');\n done();\n });\n });\n }, reason);\n }\n\n ['@test handled in the next microTask queue flush (ajax example)'](assert) {\n let done = assert.async();\n\n assert.throws(function () {\n (0, _runloop.run)(function () {\n let rejection = _rsvp.default.Promise.reject(reason);\n ajax().then(() => {\n rejection.catch(function () {});\n assert.ok(true, 'reached end of test');\n done();\n });\n });\n }, reason);\n }\n });\n});","enifed('@ember/-internals/runtime/tests/helpers/array', ['exports', '@ember/-internals/runtime/lib/system/array_proxy', '@ember/-internals/runtime/lib/mixins/array', '@ember/-internals/utils', '@ember/-internals/metal', '@ember/-internals/runtime/lib/system/object', '@ember/-internals/runtime/lib/mixins/copyable', 'internal-test-helpers'], function (exports, _array_proxy, _array, _utils, _metal, _object, _copyable, _internalTestHelpers) {\n 'use strict';\n\n exports.newFixture = newFixture;\n exports.newObjectsFixture = newObjectsFixture;\n exports.runArrayTests = runArrayTests;\n function newFixture(cnt) {\n let ret = [];\n while (--cnt >= 0) {\n ret.push((0, _utils.generateGuid)());\n }\n\n return ret;\n }\n\n function newObjectsFixture(cnt) {\n let ret = [];\n let item;\n while (--cnt >= 0) {\n item = {};\n (0, _utils.guidFor)(item);\n ret.push(item);\n }\n return ret;\n }\n\n const ArrayTestsObserverClass = _object.default.extend({\n init() {\n this._super(...arguments);\n this.isEnabled = true;\n this.reset();\n },\n\n reset() {\n this._keys = {};\n this._values = {};\n this._before = null;\n this._after = null;\n return this;\n },\n\n observe(obj, ...keys) {\n if (obj.addObserver) {\n let loc = keys.length;\n\n while (--loc >= 0) {\n obj.addObserver(keys[loc], this, 'propertyDidChange');\n }\n } else {\n this.isEnabled = false;\n }\n return this;\n },\n\n observeArray(obj) {\n (0, _metal.addArrayObserver)(obj, this);\n return this;\n },\n\n stopObserveArray(obj) {\n (0, _metal.removeArrayObserver)(obj, this);\n return this;\n },\n\n propertyDidChange(target, key, value) {\n if (this._keys[key] === undefined) {\n this._keys[key] = 0;\n }\n this._keys[key]++;\n this._values[key] = value;\n },\n\n arrayWillChange() {\n this.assert.equal(this._before, null, 'should only call once');\n this._before = Array.prototype.slice.call(arguments);\n },\n\n arrayDidChange() {\n this.assert.equal(this._after, null, 'should only call once');\n this._after = Array.prototype.slice.call(arguments);\n },\n\n validate(key, value) {\n if (!this.isEnabled) {\n return true;\n }\n\n if (!this._keys[key]) {\n return false;\n }\n\n if (arguments.length > 1) {\n return this._values[key] === value;\n } else {\n return true;\n }\n },\n\n timesCalled(key) {\n return this._keys[key] || 0;\n }\n });\n\n class AbstractArrayHelper {\n beforeEach(assert) {\n this.assert = assert;\n }\n\n newObject(ary) {\n return ary ? ary.slice() : newFixture(3);\n }\n\n toArray(obj) {\n return obj.slice();\n }\n\n newObserver() {\n let ret = ArrayTestsObserverClass.create({\n assert: this.assert\n });\n\n if (arguments.length > 0) {\n ret.observe.apply(ret, arguments);\n }\n\n return ret;\n }\n }\n\n class NativeArrayHelpers extends AbstractArrayHelper {\n newObject(ary) {\n return (0, _array.A)(super.newObject(ary));\n }\n\n mutate(obj) {\n obj.pushObject(obj.length + 1);\n }\n }\n\n class CopyableNativeArray extends AbstractArrayHelper {\n newObject() {\n return (0, _array.A)([(0, _utils.generateGuid)()]);\n }\n\n isEqual(a, b) {\n if (!(a instanceof Array)) {\n return false;\n }\n\n if (!(b instanceof Array)) {\n return false;\n }\n\n if (a.length !== b.length) {\n return false;\n }\n\n return a[0] === b[0];\n }\n }\n\n class CopyableArray extends AbstractArrayHelper {\n newObject() {\n return CopyableObject.create();\n }\n\n isEqual(a, b) {\n if (!(a instanceof CopyableObject) || !(b instanceof CopyableObject)) {\n return false;\n }\n\n return (0, _metal.get)(a, 'id') === (0, _metal.get)(b, 'id');\n }\n }\n\n class ArrayProxyHelpers extends AbstractArrayHelper {\n newObject(ary) {\n return _array_proxy.default.create({ content: (0, _array.A)(super.newObject(ary)) });\n }\n\n mutate(obj) {\n obj.pushObject((0, _metal.get)(obj, 'length') + 1);\n }\n\n toArray(obj) {\n return obj.toArray ? obj.toArray() : obj.slice();\n }\n }\n\n /*\n Implement a basic fake mutable array. This validates that any non-native\n enumerable can impl this API.\n */\n const TestArray = _object.default.extend(_array.default, {\n _content: null,\n\n init() {\n this._content = this._content || [];\n },\n\n // some methods to modify the array so we can test changes. Note that\n // arrays can be modified even if they don't implement MutableArray. The\n // MutableArray is just a standard API for mutation but not required.\n addObject(obj) {\n let idx = this._content.length;\n (0, _metal.arrayContentWillChange)(this, idx, 0, 1);\n this._content.push(obj);\n (0, _metal.arrayContentDidChange)(this, idx, 0, 1);\n },\n\n removeFirst() {\n (0, _metal.arrayContentWillChange)(this, 0, 1, 0);\n this._content.shift();\n (0, _metal.arrayContentDidChange)(this, 0, 1, 0);\n },\n\n objectAt(idx) {\n return this._content[idx];\n },\n\n length: (0, _metal.computed)(function () {\n return this._content.length;\n })\n });\n\n /*\n Implement a basic fake mutable array. This validates that any non-native\n enumerable can impl this API.\n */\n const TestMutableArray = _object.default.extend(_array.MutableArray, {\n _content: null,\n\n init(ary = []) {\n this._content = (0, _array.A)(ary);\n },\n\n replace(idx, amt, objects) {\n let args = objects ? objects.slice() : [];\n let removeAmt = amt;\n let addAmt = args.length;\n\n (0, _metal.arrayContentWillChange)(this, idx, removeAmt, addAmt);\n\n args.unshift(amt);\n args.unshift(idx);\n this._content.splice.apply(this._content, args);\n (0, _metal.arrayContentDidChange)(this, idx, removeAmt, addAmt);\n return this;\n },\n\n objectAt(idx) {\n return this._content[idx];\n },\n\n length: (0, _metal.computed)(function () {\n return this._content.length;\n }),\n\n slice() {\n return this._content.slice();\n }\n });\n\n const CopyableObject = _object.default.extend(_copyable.default, {\n id: null,\n\n init() {\n this._super(...arguments);\n (0, _metal.set)(this, 'id', (0, _utils.generateGuid)());\n },\n\n copy() {\n let ret = CopyableObject.create();\n (0, _metal.set)(ret, 'id', (0, _metal.get)(this, 'id'));\n return ret;\n }\n });\n\n class MutableArrayHelpers extends NativeArrayHelpers {\n newObject(ary) {\n return TestMutableArray.create(super.newObject(ary));\n }\n\n // allows for testing of the basic enumerable after an internal mutation\n mutate(obj) {\n obj.addObject(this.getFixture(1)[0]);\n }\n }\n\n class EmberArrayHelpers extends MutableArrayHelpers {\n newObject(ary) {\n return TestArray.create(super.newObject(ary));\n }\n }\n\n function runArrayTests(name, Tests, ...types) {\n if (types.length > 0) {\n types.forEach(type => {\n switch (type) {\n case 'ArrayProxy':\n (0, _internalTestHelpers.moduleFor)(`ArrayProxy: ${name}`, Tests, ArrayProxyHelpers);\n break;\n case 'EmberArray':\n (0, _internalTestHelpers.moduleFor)(`EmberArray: ${name}`, Tests, EmberArrayHelpers);\n break;\n case 'MutableArray':\n (0, _internalTestHelpers.moduleFor)(`MutableArray: ${name}`, Tests, EmberArrayHelpers);\n break;\n case 'CopyableArray':\n (0, _internalTestHelpers.moduleFor)(`CopyableArray: ${name}`, Tests, CopyableArray);\n break;\n case 'CopyableNativeArray':\n (0, _internalTestHelpers.moduleFor)(`CopyableNativeArray: ${name}`, Tests, CopyableNativeArray);\n break;\n case 'NativeArray':\n (0, _internalTestHelpers.moduleFor)(`NativeArray: ${name}`, Tests, EmberArrayHelpers);\n break;\n }\n });\n } else {\n (0, _internalTestHelpers.moduleFor)(`ArrayProxy: ${name}`, Tests, ArrayProxyHelpers);\n (0, _internalTestHelpers.moduleFor)(`EmberArray: ${name}`, Tests, EmberArrayHelpers);\n (0, _internalTestHelpers.moduleFor)(`MutableArray: ${name}`, Tests, MutableArrayHelpers);\n (0, _internalTestHelpers.moduleFor)(`NativeArray: ${name}`, Tests, NativeArrayHelpers);\n }\n }\n});","enifed('@ember/-internals/runtime/tests/inject_test', ['@ember/-internals/metal', '@ember/-internals/runtime/lib/system/object', 'internal-test-helpers'], function (_metal, _object, _internalTestHelpers) {\n 'use strict';\n\n (0, _internalTestHelpers.moduleFor)('inject', class extends _internalTestHelpers.AbstractTestCase {\n ['@test attempting to inject a nonexistent container key should error']() {\n let owner = (0, _internalTestHelpers.buildOwner)();\n let AnObject = _object.default.extend({\n foo: new _metal.InjectedProperty('bar', 'baz')\n });\n\n owner.register('foo:main', AnObject);\n\n expectAssertion(() => {\n owner.lookup('foo:main');\n }, /Attempting to inject an unknown injection: 'bar:baz'/);\n }\n\n ['@test factories should return a list of lazy injection full names'](assert) {\n if (true /* DEBUG */) {\n let AnObject = _object.default.extend({\n foo: new _metal.InjectedProperty('foo', 'bar'),\n bar: new _metal.InjectedProperty('quux')\n });\n\n assert.deepEqual(AnObject._lazyInjections(), {\n foo: {\n specifier: 'foo:bar',\n source: undefined,\n namespace: undefined\n },\n bar: {\n specifier: 'quux:bar',\n source: undefined,\n namespace: undefined\n }\n }, 'should return injected container keys');\n } else {\n assert.expect(0);\n }\n }\n });\n});","enifed('@ember/-internals/runtime/tests/legacy_1x/mixins/observable/chained_test', ['@ember/runloop', '@ember/-internals/metal', '@ember/-internals/runtime/lib/system/object', '@ember/-internals/runtime/lib/mixins/array', 'internal-test-helpers'], function (_runloop, _metal, _object, _array, _internalTestHelpers) {\n 'use strict';\n\n /*\n NOTE: This test is adapted from the 1.x series of unit tests. The tests\n are the same except for places where we intend to break the API we instead\n validate that we warn the developer appropriately.\n \n CHANGES FROM 1.6:\n \n * changed obj.set() and obj.get() to Ember.set() and Ember.get()\n * changed obj.addObserver() to addObserver()\n */\n\n (0, _internalTestHelpers.moduleFor)('Ember.Observable - Observing with @each', class extends _internalTestHelpers.AbstractTestCase {\n ['@test chained observers on enumerable properties are triggered when the observed property of any item changes'](assert) {\n let family = _object.default.create({ momma: null });\n let momma = _object.default.create({ children: [] });\n\n let child1 = _object.default.create({ name: 'Bartholomew' });\n let child2 = _object.default.create({ name: 'Agnes' });\n let child3 = _object.default.create({ name: 'Dan' });\n let child4 = _object.default.create({ name: 'Nancy' });\n\n (0, _metal.set)(family, 'momma', momma);\n (0, _metal.set)(momma, 'children', (0, _array.A)([child1, child2, child3]));\n\n let observerFiredCount = 0;\n (0, _metal.addObserver)(family, 'momma.children.@each.name', this, function () {\n observerFiredCount++;\n });\n\n observerFiredCount = 0;\n (0, _runloop.run)(() => (0, _metal.get)(momma, 'children').setEach('name', 'Juan'));\n assert.equal(observerFiredCount, 3, 'observer fired after changing child names');\n\n observerFiredCount = 0;\n (0, _runloop.run)(() => (0, _metal.get)(momma, 'children').pushObject(child4));\n assert.equal(observerFiredCount, 1, 'observer fired after adding a new item');\n\n observerFiredCount = 0;\n (0, _runloop.run)(() => (0, _metal.set)(child4, 'name', 'Herbert'));\n assert.equal(observerFiredCount, 1, 'observer fired after changing property on new object');\n\n (0, _metal.set)(momma, 'children', []);\n\n observerFiredCount = 0;\n (0, _runloop.run)(() => (0, _metal.set)(child1, 'name', 'Hanna'));\n assert.equal(observerFiredCount, 0, 'observer did not fire after removing changing property on a removed object');\n }\n });\n});","enifed('@ember/-internals/runtime/tests/legacy_1x/mixins/observable/observable_test', ['@ember/-internals/environment', '@ember/runloop', '@ember/-internals/metal', '@ember/string', '@ember/-internals/runtime/lib/system/object', '@ember/-internals/runtime/lib/mixins/observable', '@ember/-internals/runtime/lib/mixins/array', 'internal-test-helpers'], function (_environment, _runloop, _metal, _string, _object, _observable, _array, _internalTestHelpers) {\n 'use strict';\n\n /*\n NOTE: This test is adapted from the 1.x series of unit tests. The tests\n are the same except for places where we intend to break the API we instead\n validate that we warn the developer appropriately.\n \n CHANGES FROM 1.6:\n \n * Added ObservableObject which applies the Ember.Observable mixin.\n * Changed reference to Ember.T_FUNCTION to 'function'\n * Changed all references to sc_super to this._super(...arguments)\n * Changed Ember.objectForPropertyPath() to Ember.getPath()\n * Removed allPropertiesDidChange test - no longer supported\n * Changed test that uses 'ObjectE' as path to 'objectE' to reflect new\n rule on using capital letters for property paths.\n * Removed test passing context to addObserver. context param is no longer\n supported.\n * removed test in observer around line 862 that expected key/value to be\n the last item in the chained path. Should be root and chained path\n \n */\n\n // ========================================================================\n // Ember.Observable Tests\n // ========================================================================\n\n var object, ObjectC, ObjectD, objectA, objectB, lookup;\n\n var ObservableObject = _object.default.extend(_observable.default);\n var originalLookup = _environment.context.lookup;\n\n // ..........................................................\n // GET()\n //\n\n (0, _internalTestHelpers.moduleFor)('object.get()', class extends _internalTestHelpers.AbstractTestCase {\n beforeEach() {\n object = ObservableObject.extend(_observable.default, {\n computed: (0, _metal.computed)(function () {\n return 'value';\n }).volatile(),\n method() {\n return 'value';\n },\n unknownProperty(key) {\n this.lastUnknownProperty = key;\n return 'unknown';\n }\n }).create({\n normal: 'value',\n numberVal: 24,\n toggleVal: true,\n nullProperty: null\n });\n }\n\n ['@test should get normal properties'](assert) {\n assert.equal(object.get('normal'), 'value');\n }\n\n ['@test should call computed properties and return their result'](assert) {\n assert.equal(object.get('computed'), 'value');\n }\n\n ['@test should return the function for a non-computed property'](assert) {\n var value = object.get('method');\n assert.equal(typeof value, 'function');\n }\n\n ['@test should return null when property value is null'](assert) {\n assert.equal(object.get('nullProperty'), null);\n }\n\n ['@test should call unknownProperty when value is undefined'](assert) {\n assert.equal(object.get('unknown'), 'unknown');\n assert.equal(object.lastUnknownProperty, 'unknown');\n }\n });\n // ..........................................................\n // Ember.GET()\n //\n (0, _internalTestHelpers.moduleFor)('Ember.get()', class extends _internalTestHelpers.AbstractTestCase {\n beforeEach() {\n objectA = ObservableObject.extend({\n computed: (0, _metal.computed)(function () {\n return 'value';\n }).volatile(),\n method() {\n return 'value';\n },\n unknownProperty(key) {\n this.lastUnknownProperty = key;\n return 'unknown';\n }\n }).create({\n normal: 'value',\n numberVal: 24,\n toggleVal: true,\n nullProperty: null\n });\n\n objectB = {\n normal: 'value',\n nullProperty: null\n };\n }\n\n ['@test should get normal properties on Ember.Observable'](assert) {\n assert.equal((0, _metal.get)(objectA, 'normal'), 'value');\n }\n\n ['@test should call computed properties on Ember.Observable and return their result'](assert) {\n assert.equal((0, _metal.get)(objectA, 'computed'), 'value');\n }\n\n ['@test should return the function for a non-computed property on Ember.Observable'](assert) {\n var value = (0, _metal.get)(objectA, 'method');\n assert.equal(typeof value, 'function');\n }\n\n ['@test should return null when property value is null on Ember.Observable'](assert) {\n assert.equal((0, _metal.get)(objectA, 'nullProperty'), null);\n }\n\n ['@test should call unknownProperty when value is undefined on Ember.Observable'](assert) {\n assert.equal((0, _metal.get)(objectA, 'unknown'), 'unknown');\n assert.equal(objectA.lastUnknownProperty, 'unknown');\n }\n\n ['@test should get normal properties on standard objects'](assert) {\n assert.equal((0, _metal.get)(objectB, 'normal'), 'value');\n }\n\n ['@test should return null when property is null on standard objects'](assert) {\n assert.equal((0, _metal.get)(objectB, 'nullProperty'), null);\n }\n\n ['@test raise if the provided object is undefined']() {\n expectAssertion(function () {\n (0, _metal.get)(undefined, 'key');\n }, /Cannot call get with 'key' on an undefined object/i);\n }\n });\n\n (0, _internalTestHelpers.moduleFor)('Ember.get() with paths', class extends _internalTestHelpers.AbstractTestCase {\n ['@test should return a property at a given path relative to the passed object'](assert) {\n var foo = ObservableObject.create({\n bar: ObservableObject.extend({\n baz: (0, _metal.computed)(function () {\n return 'blargh';\n }).volatile()\n }).create()\n });\n\n assert.equal((0, _metal.get)(foo, 'bar.baz'), 'blargh');\n }\n\n ['@test should return a property at a given path relative to the passed object - JavaScript hash'](assert) {\n var foo = {\n bar: {\n baz: 'blargh'\n }\n };\n\n assert.equal((0, _metal.get)(foo, 'bar.baz'), 'blargh');\n }\n });\n\n // ..........................................................\n // SET()\n //\n\n (0, _internalTestHelpers.moduleFor)('object.set()', class extends _internalTestHelpers.AbstractTestCase {\n beforeEach() {\n object = ObservableObject.extend({\n computed: (0, _metal.computed)({\n get() {\n return this._computed;\n },\n set(key, value) {\n this._computed = value;\n return this._computed;\n }\n }).volatile(),\n\n method(key, value) {\n if (value !== undefined) {\n this._method = value;\n }\n return this._method;\n },\n\n unknownProperty() {\n return this._unknown;\n },\n\n setUnknownProperty(key, value) {\n this._unknown = value;\n return this._unknown;\n },\n\n // normal property\n normal: 'value',\n\n // computed property\n _computed: 'computed',\n // method, but not a property\n _method: 'method',\n // null property\n nullProperty: null,\n\n // unknown property\n _unknown: 'unknown'\n }).create();\n }\n\n ['@test should change normal properties and return the value'](assert) {\n var ret = object.set('normal', 'changed');\n assert.equal(object.get('normal'), 'changed');\n assert.equal(ret, 'changed');\n }\n\n ['@test should call computed properties passing value and return the value'](assert) {\n var ret = object.set('computed', 'changed');\n assert.equal(object.get('_computed'), 'changed');\n assert.equal(ret, 'changed');\n }\n\n ['@test should change normal properties when passing undefined'](assert) {\n var ret = object.set('normal', undefined);\n assert.equal(object.get('normal'), undefined);\n assert.equal(ret, undefined);\n }\n\n ['@test should replace the function for a non-computed property and return the value'](assert) {\n var ret = object.set('method', 'changed');\n assert.equal(object.get('_method'), 'method'); // make sure this was NOT run\n assert.ok(typeof object.get('method') !== 'function');\n assert.equal(ret, 'changed');\n }\n\n ['@test should replace prover when property value is null'](assert) {\n var ret = object.set('nullProperty', 'changed');\n assert.equal(object.get('nullProperty'), 'changed');\n assert.equal(ret, 'changed');\n }\n\n ['@test should call unknownProperty with value when property is undefined'](assert) {\n var ret = object.set('unknown', 'changed');\n assert.equal(object.get('_unknown'), 'changed');\n assert.equal(ret, 'changed');\n }\n });\n\n // ..........................................................\n // COMPUTED PROPERTIES\n //\n\n (0, _internalTestHelpers.moduleFor)('Computed properties', class extends _internalTestHelpers.AbstractTestCase {\n beforeEach() {\n lookup = _environment.context.lookup = {};\n\n object = ObservableObject.extend({\n computed: (0, _metal.computed)({\n get() {\n this.computedCalls.push('getter-called');\n return 'computed';\n },\n set(key, value) {\n this.computedCalls.push(value);\n }\n }).volatile(),\n\n computedCached: (0, _metal.computed)({\n get() {\n this.computedCachedCalls.push('getter-called');\n return 'computedCached';\n },\n set: function (key, value) {\n this.computedCachedCalls.push(value);\n }\n }),\n\n dependent: (0, _metal.computed)({\n get() {\n this.dependentCalls.push('getter-called');\n return 'dependent';\n },\n set(key, value) {\n this.dependentCalls.push(value);\n }\n }).property('changer').volatile(),\n dependentFront: (0, _metal.computed)('changer', {\n get() {\n this.dependentFrontCalls.push('getter-called');\n return 'dependentFront';\n },\n set(key, value) {\n this.dependentFrontCalls.push(value);\n }\n }).volatile(),\n dependentCached: (0, _metal.computed)({\n get() {\n this.dependentCachedCalls.push('getter-called!');\n return 'dependentCached';\n },\n set(key, value) {\n this.dependentCachedCalls.push(value);\n }\n }).property('changer'),\n\n inc: (0, _metal.computed)('changer', function () {\n return this.incCallCount++;\n }),\n\n nestedInc: (0, _metal.computed)(function () {\n (0, _metal.get)(this, 'inc');\n return this.nestedIncCallCount++;\n }).property('inc'),\n\n isOn: (0, _metal.computed)({\n get() {\n return this.get('state') === 'on';\n },\n set() {\n this.set('state', 'on');\n return this.get('state') === 'on';\n }\n }).property('state').volatile(),\n\n isOff: (0, _metal.computed)({\n get() {\n return this.get('state') === 'off';\n },\n set() {\n this.set('state', 'off');\n return this.get('state') === 'off';\n }\n }).property('state').volatile()\n }).create({\n computedCalls: [],\n computedCachedCalls: [],\n changer: 'foo',\n dependentCalls: [],\n dependentFrontCalls: [],\n dependentCachedCalls: [],\n incCallCount: 0,\n nestedIncCallCount: 0,\n state: 'on'\n });\n }\n afterEach() {\n _environment.context.lookup = originalLookup;\n }\n\n ['@test getting values should call function return value'](assert) {\n // get each property twice. Verify return.\n var keys = (0, _string.w)('computed computedCached dependent dependentFront dependentCached');\n\n keys.forEach(function (key) {\n assert.equal(object.get(key), key, `Try #1: object.get(${key}) should run function`);\n assert.equal(object.get(key), key, `Try #2: object.get(${key}) should run function`);\n });\n\n // verify each call count. cached should only be called once\n (0, _string.w)('computedCalls dependentFrontCalls dependentCalls').forEach(key => {\n assert.equal(object[key].length, 2, `non-cached property ${key} should be called 2x`);\n });\n\n (0, _string.w)('computedCachedCalls dependentCachedCalls').forEach(key => {\n assert.equal(object[key].length, 1, `non-cached property ${key} should be called 1x`);\n });\n }\n\n ['@test setting values should call function return value'](assert) {\n // get each property twice. Verify return.\n var keys = (0, _string.w)('computed dependent dependentFront computedCached dependentCached');\n var values = (0, _string.w)('value1 value2');\n\n keys.forEach(key => {\n assert.equal(object.set(key, values[0]), values[0], `Try #1: object.set(${key}, ${values[0]}) should run function`);\n\n assert.equal(object.set(key, values[1]), values[1], `Try #2: object.set(${key}, ${values[1]}) should run function`);\n\n assert.equal(object.set(key, values[1]), values[1], `Try #3: object.set(${key}, ${values[1]}) should not run function since it is setting same value as before`);\n });\n\n // verify each call count. cached should only be called once\n keys.forEach(key => {\n var calls = object[key + 'Calls'];\n var idx, expectedLength;\n\n // Cached properties first check their cached value before setting the\n // property. Other properties blindly call set.\n expectedLength = 3;\n assert.equal(calls.length, expectedLength, `set(${key}) should be called the right amount of times`);\n for (idx = 0; idx < 2; idx++) {\n assert.equal(calls[idx], values[idx], `call #${idx + 1} to set(${key}) should have passed value ${values[idx]}`);\n }\n });\n }\n\n ['@test notify change should clear cache'](assert) {\n // call get several times to collect call count\n object.get('computedCached'); // should run func\n object.get('computedCached'); // should not run func\n\n object.notifyPropertyChange('computedCached');\n\n object.get('computedCached'); // should run again\n assert.equal(object.computedCachedCalls.length, 2, 'should have invoked method 2x');\n }\n\n ['@test change dependent should clear cache'](assert) {\n // call get several times to collect call count\n var ret1 = object.get('inc'); // should run func\n assert.equal(object.get('inc'), ret1, 'multiple calls should not run cached prop');\n\n object.set('changer', 'bar');\n\n assert.equal(object.get('inc'), ret1 + 1, 'should increment after dependent key changes'); // should run again\n }\n\n ['@test just notifying change of dependent should clear cache'](assert) {\n // call get several times to collect call count\n var ret1 = object.get('inc'); // should run func\n assert.equal(object.get('inc'), ret1, 'multiple calls should not run cached prop');\n\n object.notifyPropertyChange('changer');\n\n assert.equal(object.get('inc'), ret1 + 1, 'should increment after dependent key changes'); // should run again\n }\n\n ['@test changing dependent should clear nested cache'](assert) {\n // call get several times to collect call count\n var ret1 = object.get('nestedInc'); // should run func\n assert.equal(object.get('nestedInc'), ret1, 'multiple calls should not run cached prop');\n\n object.set('changer', 'bar');\n\n assert.equal(object.get('nestedInc'), ret1 + 1, 'should increment after dependent key changes'); // should run again\n }\n\n ['@test just notifying change of dependent should clear nested cache'](assert) {\n // call get several times to collect call count\n var ret1 = object.get('nestedInc'); // should run func\n assert.equal(object.get('nestedInc'), ret1, 'multiple calls should not run cached prop');\n\n object.notifyPropertyChange('changer');\n\n assert.equal(object.get('nestedInc'), ret1 + 1, 'should increment after dependent key changes'); // should run again\n }\n\n // This verifies a specific bug encountered where observers for computed\n // properties would fire before their prop caches were cleared.\n ['@test change dependent should clear cache when observers of dependent are called'](assert) {\n // call get several times to collect call count\n var ret1 = object.get('inc'); // should run func\n assert.equal(object.get('inc'), ret1, 'multiple calls should not run cached prop');\n\n // add observer to verify change...\n object.addObserver('inc', this, function () {\n assert.equal(object.get('inc'), ret1 + 1, 'should increment after dependent key changes'); // should run again\n });\n\n // now run\n object.set('changer', 'bar');\n }\n\n ['@test setting one of two computed properties that depend on a third property should clear the kvo cache'](assert) {\n // we have to call set twice to fill up the cache\n object.set('isOff', true);\n object.set('isOn', true);\n\n // setting isOff to true should clear the kvo cache\n object.set('isOff', true);\n assert.equal(object.get('isOff'), true, 'object.isOff should be true');\n assert.equal(object.get('isOn'), false, 'object.isOn should be false');\n }\n\n ['@test dependent keys should be able to be specified as property paths'](assert) {\n var depObj = ObservableObject.extend({\n menuPrice: (0, _metal.computed)(function () {\n return this.get('menu.price');\n }).property('menu.price')\n }).create({\n menu: ObservableObject.create({\n price: 5\n })\n });\n\n assert.equal(depObj.get('menuPrice'), 5, 'precond - initial value returns 5');\n\n depObj.set('menu.price', 6);\n\n assert.equal(depObj.get('menuPrice'), 6, 'cache is properly invalidated after nested property changes');\n }\n\n ['@test cacheable nested dependent keys should clear after their dependencies update'](assert) {\n assert.ok(true);\n\n var DepObj;\n\n (0, _runloop.run)(function () {\n lookup.DepObj = DepObj = ObservableObject.extend({\n price: (0, _metal.computed)('restaurant.menu.price', function () {\n return this.get('restaurant.menu.price');\n })\n }).create({\n restaurant: ObservableObject.create({\n menu: ObservableObject.create({\n price: 5\n })\n })\n });\n });\n\n assert.equal(DepObj.get('price'), 5, 'precond - computed property is correct');\n\n (0, _runloop.run)(function () {\n DepObj.set('restaurant.menu.price', 10);\n });\n assert.equal(DepObj.get('price'), 10, 'cacheable computed properties are invalidated even if no run loop occurred');\n\n (0, _runloop.run)(function () {\n DepObj.set('restaurant.menu.price', 20);\n });\n assert.equal(DepObj.get('price'), 20, 'cacheable computed properties are invalidated after a second get before a run loop');\n assert.equal(DepObj.get('price'), 20, 'precond - computed properties remain correct after a run loop');\n\n (0, _runloop.run)(function () {\n DepObj.set('restaurant.menu', ObservableObject.create({\n price: 15\n }));\n });\n\n assert.equal(DepObj.get('price'), 15, 'cacheable computed properties are invalidated after a middle property changes');\n\n (0, _runloop.run)(function () {\n DepObj.set('restaurant.menu', ObservableObject.create({\n price: 25\n }));\n });\n\n assert.equal(DepObj.get('price'), 25, 'cacheable computed properties are invalidated after a middle property changes again, before a run loop');\n }\n });\n\n // ..........................................................\n // OBSERVABLE OBJECTS\n //\n\n (0, _internalTestHelpers.moduleFor)('Observable objects & object properties ', class extends _internalTestHelpers.AbstractTestCase {\n beforeEach() {\n object = ObservableObject.extend({\n getEach() {\n var keys = ['normal', 'abnormal'];\n var ret = [];\n for (var idx = 0; idx < keys.length; idx++) {\n ret[ret.length] = this.get(keys[idx]);\n }\n return ret;\n },\n\n newObserver() {\n this.abnormal = 'changedValueObserved';\n },\n\n testObserver: (0, _metal.observer)('normal', function () {\n this.abnormal = 'removedObserver';\n }),\n\n testArrayObserver: (0, _metal.observer)('normalArray.[]', function () {\n this.abnormal = 'notifiedObserver';\n })\n }).create({\n normal: 'value',\n abnormal: 'zeroValue',\n numberVal: 24,\n toggleVal: true,\n observedProperty: 'beingWatched',\n testRemove: 'observerToBeRemoved',\n normalArray: (0, _array.A)([1, 2, 3, 4, 5])\n });\n }\n\n ['@test incrementProperty and decrementProperty'](assert) {\n var newValue = object.incrementProperty('numberVal');\n\n assert.equal(25, newValue, 'numerical value incremented');\n object.numberVal = 24;\n newValue = object.decrementProperty('numberVal');\n assert.equal(23, newValue, 'numerical value decremented');\n object.numberVal = 25;\n newValue = object.incrementProperty('numberVal', 5);\n assert.equal(30, newValue, 'numerical value incremented by specified increment');\n object.numberVal = 25;\n newValue = object.incrementProperty('numberVal', -5);\n assert.equal(20, newValue, 'minus numerical value incremented by specified increment');\n object.numberVal = 25;\n newValue = object.incrementProperty('numberVal', 0);\n assert.equal(25, newValue, 'zero numerical value incremented by specified increment');\n\n expectAssertion(function () {\n newValue = object.incrementProperty('numberVal', 0 - void 0); // Increment by NaN\n }, /Must pass a numeric value to incrementProperty/i);\n\n expectAssertion(function () {\n newValue = object.incrementProperty('numberVal', 'Ember'); // Increment by non-numeric String\n }, /Must pass a numeric value to incrementProperty/i);\n\n expectAssertion(function () {\n newValue = object.incrementProperty('numberVal', 1 / 0); // Increment by Infinity\n }, /Must pass a numeric value to incrementProperty/i);\n\n assert.equal(25, newValue, 'Attempting to increment by non-numeric values should not increment value');\n\n object.numberVal = 25;\n newValue = object.decrementProperty('numberVal', 5);\n assert.equal(20, newValue, 'numerical value decremented by specified increment');\n object.numberVal = 25;\n newValue = object.decrementProperty('numberVal', -5);\n assert.equal(30, newValue, 'minus numerical value decremented by specified increment');\n object.numberVal = 25;\n newValue = object.decrementProperty('numberVal', 0);\n assert.equal(25, newValue, 'zero numerical value decremented by specified increment');\n\n expectAssertion(function () {\n newValue = object.decrementProperty('numberVal', 0 - void 0); // Decrement by NaN\n }, /Must pass a numeric value to decrementProperty/i);\n\n expectAssertion(function () {\n newValue = object.decrementProperty('numberVal', 'Ember'); // Decrement by non-numeric String\n }, /Must pass a numeric value to decrementProperty/i);\n\n expectAssertion(function () {\n newValue = object.decrementProperty('numberVal', 1 / 0); // Decrement by Infinity\n }, /Must pass a numeric value to decrementProperty/i);\n\n assert.equal(25, newValue, 'Attempting to decrement by non-numeric values should not decrement value');\n }\n\n ['@test toggle function, should be boolean'](assert) {\n assert.equal(object.toggleProperty('toggleVal', true, false), object.get('toggleVal'));\n assert.equal(object.toggleProperty('toggleVal', true, false), object.get('toggleVal'));\n assert.equal(object.toggleProperty('toggleVal', undefined, undefined), object.get('toggleVal'));\n }\n\n ['@test should notify array observer when array changes'](assert) {\n (0, _metal.get)(object, 'normalArray').replace(0, 0, [6]);\n assert.equal(object.abnormal, 'notifiedObserver', 'observer should be notified');\n }\n });\n\n (0, _internalTestHelpers.moduleFor)('object.addObserver()', class extends _internalTestHelpers.AbstractTestCase {\n beforeEach() {\n ObjectC = ObservableObject.create({\n objectE: ObservableObject.create({\n propertyVal: 'chainedProperty'\n }),\n\n normal: 'value',\n normal1: 'zeroValue',\n normal2: 'dependentValue',\n incrementor: 10,\n\n action() {\n this.normal1 = 'newZeroValue';\n },\n\n observeOnceAction() {\n this.incrementor = this.incrementor + 1;\n },\n\n chainedObserver() {\n this.normal2 = 'chainedPropertyObserved';\n }\n });\n }\n\n ['@test should register an observer for a property'](assert) {\n ObjectC.addObserver('normal', ObjectC, 'action');\n ObjectC.set('normal', 'newValue');\n assert.equal(ObjectC.normal1, 'newZeroValue');\n }\n\n ['@test should register an observer for a property - Special case of chained property'](assert) {\n ObjectC.addObserver('objectE.propertyVal', ObjectC, 'chainedObserver');\n ObjectC.objectE.set('propertyVal', 'chainedPropertyValue');\n assert.equal('chainedPropertyObserved', ObjectC.normal2);\n ObjectC.normal2 = 'dependentValue';\n ObjectC.set('objectE', '');\n assert.equal('chainedPropertyObserved', ObjectC.normal2);\n }\n });\n\n (0, _internalTestHelpers.moduleFor)('object.removeObserver()', class extends _internalTestHelpers.AbstractTestCase {\n beforeEach() {\n ObjectD = ObservableObject.create({\n objectF: ObservableObject.create({\n propertyVal: 'chainedProperty'\n }),\n\n normal: 'value',\n normal1: 'zeroValue',\n normal2: 'dependentValue',\n ArrayKeys: ['normal', 'normal1'],\n\n addAction() {\n this.normal1 = 'newZeroValue';\n },\n removeAction() {\n this.normal2 = 'newDependentValue';\n },\n removeChainedObserver() {\n this.normal2 = 'chainedPropertyObserved';\n },\n\n observableValue: 'hello world',\n\n observer1() {\n // Just an observer\n },\n observer2() {\n this.removeObserver('observableValue', null, 'observer1');\n this.removeObserver('observableValue', null, 'observer2');\n this.hasObserverFor('observableValue'); // Tickle 'getMembers()'\n this.removeObserver('observableValue', null, 'observer3');\n },\n observer3() {\n // Just an observer\n }\n });\n }\n\n ['@test should unregister an observer for a property'](assert) {\n ObjectD.addObserver('normal', ObjectD, 'addAction');\n ObjectD.set('normal', 'newValue');\n assert.equal(ObjectD.normal1, 'newZeroValue');\n\n ObjectD.set('normal1', 'zeroValue');\n\n ObjectD.removeObserver('normal', ObjectD, 'addAction');\n ObjectD.set('normal', 'newValue');\n assert.equal(ObjectD.normal1, 'zeroValue');\n }\n\n [\"@test should unregister an observer for a property - special case when key has a '.' in it.\"](assert) {\n ObjectD.addObserver('objectF.propertyVal', ObjectD, 'removeChainedObserver');\n ObjectD.objectF.set('propertyVal', 'chainedPropertyValue');\n ObjectD.removeObserver('objectF.propertyVal', ObjectD, 'removeChainedObserver');\n ObjectD.normal2 = 'dependentValue';\n ObjectD.objectF.set('propertyVal', 'removedPropertyValue');\n assert.equal('dependentValue', ObjectD.normal2);\n ObjectD.set('objectF', '');\n assert.equal('dependentValue', ObjectD.normal2);\n }\n\n ['@test removing an observer inside of an observer shouldn’t cause any problems'](assert) {\n // The observable system should be protected against clients removing\n // observers in the middle of observer notification.\n var encounteredError = false;\n try {\n ObjectD.addObserver('observableValue', null, 'observer1');\n ObjectD.addObserver('observableValue', null, 'observer2');\n ObjectD.addObserver('observableValue', null, 'observer3');\n (0, _runloop.run)(function () {\n ObjectD.set('observableValue', 'hi world');\n });\n } catch (e) {\n encounteredError = true;\n }\n assert.equal(encounteredError, false);\n }\n });\n});","enifed('@ember/-internals/runtime/tests/legacy_1x/mixins/observable/propertyChanges_test', ['@ember/-internals/runtime/lib/system/object', '@ember/-internals/runtime/lib/mixins/observable', '@ember/-internals/metal', 'internal-test-helpers'], function (_object, _observable, _metal, _internalTestHelpers) {\n 'use strict';\n\n /*\n NOTE: This test is adapted from the 1.x series of unit tests. The tests\n are the same except for places where we intend to break the API we instead\n validate that we warn the developer appropriately.\n \n CHANGES FROM 1.6:\n \n * Create ObservableObject which includes Ember.Observable\n * Remove test that tests internal _kvo_changeLevel property. This is an\n implementation detail.\n * Remove test for allPropertiesDidChange\n * Removed star observer test. no longer supported\n * Removed property revision test. no longer supported\n */\n\n // ========================================================================\n // Ember.Observable Tests\n // ========================================================================\n\n const ObservableObject = _object.default.extend(_observable.default);\n\n let ObjectA;\n\n (0, _internalTestHelpers.moduleFor)('object.propertyChanges', class extends _internalTestHelpers.AbstractTestCase {\n beforeEach() {\n ObjectA = ObservableObject.extend({\n action: (0, _metal.observer)('foo', function () {\n this.set('prop', 'changedPropValue');\n }),\n notifyAction: (0, _metal.observer)('newFoo', function () {\n this.set('newProp', 'changedNewPropValue');\n }),\n\n notifyAllAction: (0, _metal.observer)('prop', function () {\n this.set('newFoo', 'changedNewFooValue');\n }),\n\n starObserver(target, key) {\n this.starProp = key;\n }\n }).create({\n starProp: null,\n\n foo: 'fooValue',\n prop: 'propValue',\n\n newFoo: 'newFooValue',\n newProp: 'newPropValue'\n });\n }\n\n ['@test should observe the changes within the nested begin / end property changes'](assert) {\n //start the outer nest\n ObjectA.beginPropertyChanges();\n\n // Inner nest\n ObjectA.beginPropertyChanges();\n ObjectA.set('foo', 'changeFooValue');\n\n assert.equal(ObjectA.prop, 'propValue');\n ObjectA.endPropertyChanges();\n\n //end inner nest\n ObjectA.set('prop', 'changePropValue');\n assert.equal(ObjectA.newFoo, 'newFooValue');\n\n //close the outer nest\n ObjectA.endPropertyChanges();\n\n assert.equal(ObjectA.prop, 'changedPropValue');\n assert.equal(ObjectA.newFoo, 'changedNewFooValue');\n }\n\n ['@test should observe the changes within the begin and end property changes'](assert) {\n ObjectA.beginPropertyChanges();\n ObjectA.set('foo', 'changeFooValue');\n\n assert.equal(ObjectA.prop, 'propValue');\n ObjectA.endPropertyChanges();\n\n assert.equal(ObjectA.prop, 'changedPropValue');\n }\n\n ['@test should indicate that the property of an object has just changed'](assert) {\n //change the value of foo.\n ObjectA.set('foo', 'changeFooValue');\n\n // Indicate the subscribers of foo that the value has just changed\n ObjectA.notifyPropertyChange('foo', null);\n\n // Values of prop has just changed\n assert.equal(ObjectA.prop, 'changedPropValue');\n }\n\n ['@test should notify that the property of an object has changed'](assert) {\n // Notify to its subscriber that the values of 'newFoo' will be changed. In this\n // case the observer is \"newProp\". Therefore this will call the notifyAction function\n // and value of \"newProp\" will be changed.\n ObjectA.notifyPropertyChange('newFoo', 'fooValue');\n\n //value of newProp changed.\n assert.equal(ObjectA.newProp, 'changedNewPropValue');\n }\n\n ['@test should invalidate function property cache when notifyPropertyChange is called'](assert) {\n let a = ObservableObject.extend({\n b: (0, _metal.computed)({\n get() {\n return this._b;\n },\n set(key, value) {\n this._b = value;\n return this;\n }\n }).volatile()\n }).create({\n _b: null\n });\n\n a.set('b', 'foo');\n assert.equal(a.get('b'), 'foo', 'should have set the correct value for property b');\n\n a._b = 'bar';\n a.notifyPropertyChange('b');\n a.set('b', 'foo');\n assert.equal(a.get('b'), 'foo', 'should have invalidated the cache so that the newly set value is actually set');\n }\n });\n});","enifed('@ember/-internals/runtime/tests/legacy_1x/system/object/base_test', ['@ember/-internals/metal', '@ember/-internals/runtime/lib/system/object', 'internal-test-helpers'], function (_metal, _object, _internalTestHelpers) {\n 'use strict';\n\n /*\n NOTE: This test is adapted from the 1.x series of unit tests. The tests\n are the same except for places where we intend to break the API we instead\n validate that we warn the developer appropriately.\n \n CHANGES FROM 1.6:\n \n * Changed get(obj, ) and set(obj, ) to Ember.get() and Ember.set()\n * Removed obj.instanceOf() and obj.kindOf() tests. use obj instanceof Foo\n instead\n * Removed respondsTo() and tryToPerform() tests. Can be brought back in a\n utils package.\n * Removed destroy() test. You can impl yourself but not built in\n * Changed Class.subclassOf() test to Class.detect()\n * Remove broken test for 'superclass' property.\n * Removed obj.didChangeFor()\n */\n\n // ========================================================================\n // EmberObject Base Tests\n // ========================================================================\n\n let obj, obj1; // global variables\n\n (0, _internalTestHelpers.moduleFor)('A new EmberObject instance', class extends _internalTestHelpers.AbstractTestCase {\n beforeEach() {\n obj = _object.default.create({\n foo: 'bar',\n total: 12345,\n aMethodThatExists() {},\n aMethodThatReturnsTrue() {\n return true;\n },\n aMethodThatReturnsFoobar() {\n return 'Foobar';\n },\n aMethodThatReturnsFalse() {\n return false;\n }\n });\n }\n\n afterEach() {\n obj = undefined;\n }\n\n ['@test Should return its properties when requested using EmberObject#get'](assert) {\n assert.equal((0, _metal.get)(obj, 'foo'), 'bar');\n assert.equal((0, _metal.get)(obj, 'total'), 12345);\n }\n\n ['@test Should allow changing of those properties by calling EmberObject#set'](assert) {\n assert.equal((0, _metal.get)(obj, 'foo'), 'bar');\n assert.equal((0, _metal.get)(obj, 'total'), 12345);\n\n (0, _metal.set)(obj, 'foo', 'Chunky Bacon');\n (0, _metal.set)(obj, 'total', 12);\n\n assert.equal((0, _metal.get)(obj, 'foo'), 'Chunky Bacon');\n assert.equal((0, _metal.get)(obj, 'total'), 12);\n }\n });\n\n (0, _internalTestHelpers.moduleFor)('EmberObject superclass and subclasses', class extends _internalTestHelpers.AbstractTestCase {\n beforeEach() {\n obj = _object.default.extend({\n method1() {\n return 'hello';\n }\n });\n obj1 = obj.extend();\n }\n\n afterEach() {\n obj = undefined;\n obj1 = undefined;\n }\n\n ['@test Checking the detect() function on an object and its subclass'](assert) {\n assert.equal(obj.detect(obj1), true);\n assert.equal(obj1.detect(obj), false);\n }\n\n ['@test Checking the detectInstance() function on an object and its subclass'](assert) {\n assert.ok(_object.default.detectInstance(obj.create()));\n assert.ok(obj.detectInstance(obj.create()));\n }\n });\n});","enifed('@ember/-internals/runtime/tests/legacy_1x/system/object/concatenated_test', ['@ember/-internals/metal', '@ember/-internals/runtime/lib/system/object', 'internal-test-helpers'], function (_metal, _object, _internalTestHelpers) {\n 'use strict';\n\n /*\n NOTE: This test is adapted from the 1.x series of unit tests. The tests\n are the same except for places where we intend to break the API we instead\n validate that we warn the developer appropriately.\n \n CHANGES FROM 1.6:\n \n * changed get(obj, ) and set(obj, ) to Ember.get() and Ember.set()\n * converted uses of obj.isEqual() to use deepEqual() test since isEqual is not\n always defined\n */\n\n function K() {\n return this;\n }\n\n let klass;\n\n (0, _internalTestHelpers.moduleFor)('EmberObject Concatenated Properties', class extends _internalTestHelpers.AbstractTestCase {\n beforeEach() {\n klass = _object.default.extend({\n concatenatedProperties: ['values', 'functions'],\n values: ['a', 'b', 'c'],\n functions: [K]\n });\n }\n\n ['@test concatenates instances'](assert) {\n let obj = klass.create({\n values: ['d', 'e', 'f']\n });\n\n let values = (0, _metal.get)(obj, 'values');\n let expected = ['a', 'b', 'c', 'd', 'e', 'f'];\n\n assert.deepEqual(values, expected, `should concatenate values property (expected: ${expected}, got: ${values})`);\n }\n\n ['@test concatenates subclasses'](assert) {\n let subKlass = klass.extend({\n values: ['d', 'e', 'f']\n });\n let obj = subKlass.create();\n\n let values = (0, _metal.get)(obj, 'values');\n let expected = ['a', 'b', 'c', 'd', 'e', 'f'];\n\n assert.deepEqual(values, expected, `should concatenate values property (expected: ${expected}, got: ${values})`);\n }\n\n ['@test concatenates reopen'](assert) {\n klass.reopen({\n values: ['d', 'e', 'f']\n });\n let obj = klass.create();\n\n let values = (0, _metal.get)(obj, 'values');\n let expected = ['a', 'b', 'c', 'd', 'e', 'f'];\n\n assert.deepEqual(values, expected, `should concatenate values property (expected: ${expected}, got: ${values})`);\n }\n\n ['@test concatenates mixin'](assert) {\n let mixin = {\n values: ['d', 'e']\n };\n let subKlass = klass.extend(mixin, {\n values: ['f']\n });\n let obj = subKlass.create();\n\n let values = (0, _metal.get)(obj, 'values');\n let expected = ['a', 'b', 'c', 'd', 'e', 'f'];\n\n assert.deepEqual(values, expected, `should concatenate values property (expected: ${expected}, got: ${values})`);\n }\n\n ['@test concatenates reopen, subclass, and instance'](assert) {\n klass.reopen({ values: ['d'] });\n let subKlass = klass.extend({ values: ['e'] });\n let obj = subKlass.create({ values: ['f'] });\n\n let values = (0, _metal.get)(obj, 'values');\n let expected = ['a', 'b', 'c', 'd', 'e', 'f'];\n\n assert.deepEqual(values, expected, `should concatenate values property (expected: ${expected}, got: ${values})`);\n }\n\n ['@test concatenates subclasses when the values are functions'](assert) {\n let subKlass = klass.extend({\n functions: K\n });\n let obj = subKlass.create();\n\n let values = (0, _metal.get)(obj, 'functions');\n let expected = [K, K];\n\n assert.deepEqual(values, expected, `should concatenate functions property (expected: ${expected}, got: ${values})`);\n }\n });\n});","enifed('@ember/-internals/runtime/tests/mixins/array_test', ['@ember/-internals/metal', '@ember/-internals/runtime/lib/system/object', '@ember/-internals/runtime/lib/mixins/array', 'internal-test-helpers'], function (_metal, _object, _array, _internalTestHelpers) {\n 'use strict';\n\n /*\n Implement a basic fake mutable array. This validates that any non-native\n enumerable can impl this API.\n */\n const TestArray = _object.default.extend(_array.default, {\n _content: null,\n\n init() {\n this._content = this._content || [];\n },\n\n // some methods to modify the array so we can test changes. Note that\n // arrays can be modified even if they don't implement MutableArray. The\n // MutableArray is just a standard API for mutation but not required.\n addObject(obj) {\n let idx = this._content.length;\n (0, _metal.arrayContentWillChange)(this, idx, 0, 1);\n this._content.push(obj);\n (0, _metal.arrayContentDidChange)(this, idx, 0, 1);\n },\n\n removeFirst() {\n (0, _metal.arrayContentWillChange)(this, 0, 1, 0);\n this._content.shift();\n (0, _metal.arrayContentDidChange)(this, 0, 1, 0);\n },\n\n objectAt(idx) {\n return this._content[idx];\n },\n\n length: (0, _metal.computed)(function () {\n return this._content.length;\n })\n });\n\n (0, _internalTestHelpers.moduleFor)('Ember.Array', class extends _internalTestHelpers.AbstractTestCase {\n ['@test the return value of slice has Ember.Array applied'](assert) {\n let x = _object.default.extend(_array.default).create({\n length: 0\n });\n let y = x.slice(1);\n assert.equal(_array.default.detect(y), true, 'mixin should be applied');\n }\n\n ['@test slice supports negative index arguments'](assert) {\n let testArray = TestArray.create({ _content: [1, 2, 3, 4] });\n\n assert.deepEqual(testArray.slice(-2), [3, 4], 'slice(-2)');\n assert.deepEqual(testArray.slice(-2, -1), [3], 'slice(-2, -1');\n assert.deepEqual(testArray.slice(-2, -2), [], 'slice(-2, -2)');\n assert.deepEqual(testArray.slice(-1, -2), [], 'slice(-1, -2)');\n\n assert.deepEqual(testArray.slice(-4, 1), [1], 'slice(-4, 1)');\n assert.deepEqual(testArray.slice(-4, 5), [1, 2, 3, 4], 'slice(-4, 5)');\n assert.deepEqual(testArray.slice(-4), [1, 2, 3, 4], 'slice(-4)');\n\n assert.deepEqual(testArray.slice(0, -1), [1, 2, 3], 'slice(0, -1)');\n assert.deepEqual(testArray.slice(0, -4), [], 'slice(0, -4)');\n assert.deepEqual(testArray.slice(0, -3), [1], 'slice(0, -3)');\n }\n });\n\n // ..........................................................\n // CONTENT DID CHANGE\n //\n\n const DummyArray = _object.default.extend(_array.default, {\n length: 0,\n objectAt(idx) {\n return 'ITEM-' + idx;\n }\n });\n\n let obj, observer;\n\n // ..........................................................\n // NOTIFY ARRAY OBSERVERS\n //\n\n (0, _internalTestHelpers.moduleFor)('mixins/array/arrayContent[Will|Did]Change', class extends _internalTestHelpers.AbstractTestCase {\n ['@test should notify observers of []'](assert) {\n obj = DummyArray.extend({\n enumerablePropertyDidChange: (0, _metal.observer)('[]', function () {\n this._count++;\n })\n }).create({\n _count: 0\n });\n\n assert.equal(obj._count, 0, 'should not have invoked yet');\n\n (0, _metal.arrayContentWillChange)(obj, 0, 1, 1);\n (0, _metal.arrayContentDidChange)(obj, 0, 1, 1);\n\n assert.equal(obj._count, 1, 'should have invoked');\n }\n });\n\n // ..........................................................\n // NOTIFY CHANGES TO LENGTH\n //\n\n (0, _internalTestHelpers.moduleFor)('notify observers of length', class extends _internalTestHelpers.AbstractTestCase {\n beforeEach(assert) {\n obj = DummyArray.extend({\n lengthDidChange: (0, _metal.observer)('length', function () {\n this._after++;\n })\n }).create({\n _after: 0\n });\n\n assert.equal(obj._after, 0, 'should not have fired yet');\n }\n\n afterEach() {\n obj = null;\n }\n\n ['@test should notify observers when call with no params'](assert) {\n (0, _metal.arrayContentWillChange)(obj);\n assert.equal(obj._after, 0);\n\n (0, _metal.arrayContentDidChange)(obj);\n assert.equal(obj._after, 1);\n }\n\n // API variation that included items only\n ['@test should not notify when passed lengths are same'](assert) {\n (0, _metal.arrayContentWillChange)(obj, 0, 1, 1);\n assert.equal(obj._after, 0);\n\n (0, _metal.arrayContentDidChange)(obj, 0, 1, 1);\n assert.equal(obj._after, 0);\n }\n\n ['@test should notify when passed lengths are different'](assert) {\n (0, _metal.arrayContentWillChange)(obj, 0, 1, 2);\n assert.equal(obj._after, 0);\n\n (0, _metal.arrayContentDidChange)(obj, 0, 1, 2);\n assert.equal(obj._after, 1);\n }\n });\n\n // ..........................................................\n // NOTIFY ARRAY OBSERVER\n //\n\n (0, _internalTestHelpers.moduleFor)('notify array observers', class extends _internalTestHelpers.AbstractTestCase {\n beforeEach(assert) {\n obj = DummyArray.create();\n\n observer = _object.default.extend({\n arrayWillChange() {\n assert.equal(this._before, null); // should only call once\n this._before = Array.prototype.slice.call(arguments);\n },\n\n arrayDidChange() {\n assert.equal(this._after, null); // should only call once\n this._after = Array.prototype.slice.call(arguments);\n }\n }).create({\n _before: null,\n _after: null\n });\n\n (0, _metal.addArrayObserver)(obj, observer);\n }\n\n afterEach() {\n obj = observer = null;\n }\n\n ['@test should notify array observers when called with no params'](assert) {\n (0, _metal.arrayContentWillChange)(obj);\n assert.deepEqual(observer._before, [obj, 0, -1, -1]);\n\n (0, _metal.arrayContentDidChange)(obj);\n assert.deepEqual(observer._after, [obj, 0, -1, -1]);\n }\n\n // API variation that included items only\n ['@test should notify when called with same length items'](assert) {\n (0, _metal.arrayContentWillChange)(obj, 0, 1, 1);\n assert.deepEqual(observer._before, [obj, 0, 1, 1]);\n\n (0, _metal.arrayContentDidChange)(obj, 0, 1, 1);\n assert.deepEqual(observer._after, [obj, 0, 1, 1]);\n }\n\n ['@test should notify when called with diff length items'](assert) {\n (0, _metal.arrayContentWillChange)(obj, 0, 2, 1);\n assert.deepEqual(observer._before, [obj, 0, 2, 1]);\n\n (0, _metal.arrayContentDidChange)(obj, 0, 2, 1);\n assert.deepEqual(observer._after, [obj, 0, 2, 1]);\n }\n\n ['@test removing array observer should disable'](assert) {\n (0, _metal.removeArrayObserver)(obj, observer);\n (0, _metal.arrayContentWillChange)(obj);\n assert.deepEqual(observer._before, null);\n\n (0, _metal.arrayContentDidChange)(obj);\n assert.deepEqual(observer._after, null);\n }\n });\n\n // ..........................................................\n // @each\n //\n\n let ary;\n\n (0, _internalTestHelpers.moduleFor)('EmberArray.@each support', class extends _internalTestHelpers.AbstractTestCase {\n beforeEach() {\n ary = TestArray.create({\n _content: [{ isDone: true, desc: 'Todo 1' }, { isDone: false, desc: 'Todo 2' }, { isDone: true, desc: 'Todo 3' }, { isDone: false, desc: 'Todo 4' }]\n });\n }\n\n afterEach() {\n ary = null;\n }\n\n ['@test adding an object should notify (@each.isDone)'](assert) {\n let called = 0;\n\n let observerObject = _object.default.create({\n wasCalled() {\n called++;\n }\n });\n\n (0, _metal.addObserver)(ary, '@each.isDone', observerObject, 'wasCalled');\n\n ary.addObject(_object.default.create({\n desc: 'foo',\n isDone: false\n }));\n\n assert.equal(called, 1, 'calls observer when object is pushed');\n }\n\n ['@test getting @each is deprecated'](assert) {\n assert.expect(1);\n\n expectDeprecation(() => {\n (0, _metal.get)(ary, '@each');\n }, /Getting the '@each' property on object .* is deprecated/);\n }\n\n ['@test @each is readOnly'](assert) {\n assert.expect(1);\n\n assert.throws(function () {\n (0, _metal.set)(ary, '@each', 'foo');\n }, /Cannot set read-only property \"@each\"/);\n }\n\n ['@test using @each to observe arrays that does not return objects raise error'](assert) {\n let called = 0;\n\n let observerObject = _object.default.create({\n wasCalled() {\n called++;\n }\n });\n\n ary = TestArray.create({\n objectAt(idx) {\n return (0, _metal.get)(this._content[idx], 'desc');\n }\n });\n\n (0, _metal.addObserver)(ary, '@each.isDone', observerObject, 'wasCalled');\n\n expectAssertion(() => {\n ary.addObject(_object.default.create({\n desc: 'foo',\n isDone: false\n }));\n }, /When using @each to observe the array/);\n\n assert.equal(called, 0, 'not calls observer when object is pushed');\n }\n\n ['@test modifying the array should also indicate the isDone prop itself has changed'](assert) {\n // NOTE: we never actually get the '@each.isDone' property here. This is\n // important because it tests the case where we don't have an isDone\n // EachArray materialized but just want to know when the property has\n // changed.\n let each;\n expectDeprecation(() => {\n each = (0, _metal.get)(ary, '@each');\n });\n let count = 0;\n\n (0, _metal.addObserver)(each, 'isDone', () => count++);\n\n count = 0;\n let item = (0, _metal.objectAt)(ary, 2);\n (0, _metal.set)(item, 'isDone', !(0, _metal.get)(item, 'isDone'));\n assert.equal(count, 1, '@each.isDone should have notified');\n }\n\n ['@test `objectAt` returns correct object'](assert) {\n let arr = ['first', 'second', 'third', 'fourth'];\n assert.equal((0, _metal.objectAt)(arr, 2), 'third');\n assert.equal((0, _metal.objectAt)(arr, 4), undefined);\n }\n\n ['@test should be clear caches for computed properties that have dependent keys on arrays that are changed after object initialization'](assert) {\n let obj = _object.default.extend({\n init() {\n this._super(...arguments);\n (0, _metal.set)(this, 'resources', (0, _array.A)());\n },\n\n common: (0, _metal.computed)('resources.@each.common', function () {\n return (0, _metal.get)((0, _metal.objectAt)((0, _metal.get)(this, 'resources'), 0), 'common');\n })\n }).create();\n\n (0, _metal.get)(obj, 'resources').pushObject(_object.default.create({ common: 'HI!' }));\n assert.equal('HI!', (0, _metal.get)(obj, 'common'));\n\n (0, _metal.set)((0, _metal.objectAt)((0, _metal.get)(obj, 'resources'), 0), 'common', 'BYE!');\n assert.equal('BYE!', (0, _metal.get)(obj, 'common'));\n }\n\n ['@test observers that contain @each in the path should fire only once the first time they are accessed'](assert) {\n let count = 0;\n\n let obj = _object.default.extend({\n init() {\n this._super(...arguments);\n // Observer does not fire on init\n (0, _metal.set)(this, 'resources', (0, _array.A)());\n },\n\n commonDidChange: (0, _metal.observer)('resources.@each.common', () => count++)\n }).create();\n\n // Observer fires second time when new object is added\n (0, _metal.get)(obj, 'resources').pushObject(_object.default.create({ common: 'HI!' }));\n // Observer fires third time when property on an object is changed\n (0, _metal.set)((0, _metal.objectAt)((0, _metal.get)(obj, 'resources'), 0), 'common', 'BYE!');\n\n assert.equal(count, 2, 'observers should only be called once');\n }\n });\n});","enifed('@ember/-internals/runtime/tests/mixins/comparable_test', ['@ember/-internals/metal', '@ember/-internals/runtime/lib/system/object', '@ember/-internals/runtime/lib/compare', '@ember/-internals/runtime/lib/mixins/comparable', 'internal-test-helpers'], function (_metal, _object, _compare, _comparable, _internalTestHelpers) {\n 'use strict';\n\n const Rectangle = _object.default.extend(_comparable.default, {\n length: 0,\n width: 0,\n\n area() {\n return (0, _metal.get)(this, 'length') * (0, _metal.get)(this, 'width');\n },\n\n compare(a, b) {\n return (0, _compare.default)(a.area(), b.area());\n }\n });\n\n let r1, r2;\n\n (0, _internalTestHelpers.moduleFor)('Comparable', class extends _internalTestHelpers.AbstractTestCase {\n beforeEach() {\n r1 = Rectangle.create({ length: 6, width: 12 });\n r2 = Rectangle.create({ length: 6, width: 13 });\n }\n\n ['@test should be comparable and return the correct result'](assert) {\n assert.equal(_comparable.default.detect(r1), true);\n assert.equal((0, _compare.default)(r1, r1), 0);\n assert.equal((0, _compare.default)(r1, r2), -1);\n assert.equal((0, _compare.default)(r2, r1), 1);\n }\n });\n});","enifed('@ember/-internals/runtime/tests/mixins/container_proxy_test', ['@ember/-internals/owner', '@ember/-internals/container', '@ember/-internals/runtime/lib/mixins/container_proxy', '@ember/-internals/runtime/lib/system/object', '@ember/runloop', 'internal-test-helpers'], function (_owner, _container, _container_proxy, _object, _runloop, _internalTestHelpers) {\n 'use strict';\n\n (0, _internalTestHelpers.moduleFor)('@ember/-internals/runtime/mixins/container_proxy', class extends _internalTestHelpers.AbstractTestCase {\n beforeEach() {\n this.Owner = _object.default.extend(_container_proxy.default);\n this.instance = this.Owner.create();\n\n this.registry = new _container.Registry();\n\n this.instance.__container__ = new _container.Container(this.registry, {\n owner: this.instance\n });\n }\n\n ['@test provides ownerInjection helper method'](assert) {\n let result = this.instance.ownerInjection();\n\n assert.equal(result[_owner.OWNER], this.instance, 'returns an object with the OWNER symbol');\n }\n\n ['@test actions queue completes before destruction'](assert) {\n assert.expect(1);\n\n this.registry.register('service:auth', _object.default.extend({\n willDestroy() {\n assert.ok((0, _owner.getOwner)(this).lookup('service:auth'), 'can still lookup');\n }\n }));\n\n let service = this.instance.lookup('service:auth');\n\n (0, _runloop.run)(() => {\n (0, _runloop.schedule)('actions', service, 'destroy');\n this.instance.destroy();\n });\n }\n });\n});","enifed('@ember/-internals/runtime/tests/mixins/enumerable_test', ['@ember/-internals/runtime/lib/mixins/enumerable', '@ember/-internals/runtime/lib/system/array_proxy', '@ember/-internals/runtime/lib/mixins/array', 'internal-test-helpers'], function (_enumerable, _array_proxy, _array, _internalTestHelpers) {\n 'use strict';\n\n (0, _internalTestHelpers.moduleFor)('Enumerable', class extends _internalTestHelpers.AbstractTestCase {\n ['@test should be mixed into A()'](assert) {\n assert.ok(_enumerable.default.detect((0, _array.A)()));\n }\n\n ['@test should be mixed into ArrayProxy'](assert) {\n assert.ok(_enumerable.default.detect(_array_proxy.default.create()));\n }\n });\n});","enifed('@ember/-internals/runtime/tests/mixins/evented_test', ['@ember/-internals/runtime/lib/mixins/evented', '@ember/-internals/runtime/lib/system/core_object', 'internal-test-helpers'], function (_evented, _core_object, _internalTestHelpers) {\n 'use strict';\n\n (0, _internalTestHelpers.moduleFor)('Ember.Evented', class extends _internalTestHelpers.AbstractTestCase {\n ['@test works properly on proxy-ish objects'](assert) {\n let eventedProxyObj = _core_object.default.extend(_evented.default, {\n unknownProperty() {\n return true;\n }\n }).create();\n\n let noop = function () {};\n\n eventedProxyObj.on('foo', noop);\n eventedProxyObj.off('foo', noop);\n\n assert.ok(true, 'An assertion was triggered');\n }\n });\n});","enifed('@ember/-internals/runtime/tests/mixins/mutable_enumerable_test', ['@ember/-internals/runtime/lib/mixins/mutable_enumerable', '@ember/-internals/runtime/lib/system/array_proxy', '@ember/-internals/runtime/lib/mixins/array', 'internal-test-helpers'], function (_mutable_enumerable, _array_proxy, _array, _internalTestHelpers) {\n 'use strict';\n\n (0, _internalTestHelpers.moduleFor)('MutableEnumerable', class extends _internalTestHelpers.AbstractTestCase {\n ['@test should be mixed into A()'](assert) {\n assert.ok(_mutable_enumerable.default.detect((0, _array.A)()));\n }\n\n ['@test should be mixed into ArrayProxy'](assert) {\n assert.ok(_mutable_enumerable.default.detect(_array_proxy.default.create()));\n }\n });\n});","enifed('@ember/-internals/runtime/tests/mixins/observable_test', ['@ember/-internals/metal', '@ember/-internals/runtime/lib/system/object', 'internal-test-helpers'], function (_metal, _object, _internalTestHelpers) {\n 'use strict';\n\n (0, _internalTestHelpers.moduleFor)('mixins/observable', class extends _internalTestHelpers.AbstractTestCase {\n ['@test should be able to use getProperties to get a POJO of provided keys'](assert) {\n let obj = _object.default.create({\n firstName: 'Steve',\n lastName: 'Jobs',\n companyName: 'Apple, Inc.'\n });\n\n let pojo = obj.getProperties('firstName', 'lastName');\n assert.equal('Steve', pojo.firstName);\n assert.equal('Jobs', pojo.lastName);\n }\n\n ['@test should be able to use getProperties with array parameter to get a POJO of provided keys'](assert) {\n let obj = _object.default.create({\n firstName: 'Steve',\n lastName: 'Jobs',\n companyName: 'Apple, Inc.'\n });\n\n let pojo = obj.getProperties(['firstName', 'lastName']);\n assert.equal('Steve', pojo.firstName);\n assert.equal('Jobs', pojo.lastName);\n }\n\n ['@test should be able to use setProperties to set multiple properties at once'](assert) {\n let obj = _object.default.create({\n firstName: 'Steve',\n lastName: 'Jobs',\n companyName: 'Apple, Inc.'\n });\n\n obj.setProperties({ firstName: 'Tim', lastName: 'Cook' });\n assert.equal('Tim', obj.get('firstName'));\n assert.equal('Cook', obj.get('lastName'));\n }\n\n ['@test calling setProperties completes safely despite exceptions'](assert) {\n let exc = new Error('Something unexpected happened!');\n let obj = _object.default.extend({\n companyName: (0, _metal.computed)({\n get() {\n return 'Apple, Inc.';\n },\n set() {\n throw exc;\n }\n })\n }).create({\n firstName: 'Steve',\n lastName: 'Jobs'\n });\n\n let firstNameChangedCount = 0;\n\n (0, _metal.addObserver)(obj, 'firstName', () => firstNameChangedCount++);\n\n try {\n obj.setProperties({\n firstName: 'Tim',\n lastName: 'Cook',\n companyName: 'Fruit Co., Inc.'\n });\n } catch (err) {\n if (err !== exc) {\n throw err;\n }\n }\n\n assert.equal(firstNameChangedCount, 1, 'firstName should have fired once');\n }\n\n ['@test should be able to retrieve cached values of computed properties without invoking the computed property'](assert) {\n let obj = _object.default.extend({\n foo: (0, _metal.computed)(function () {\n return 'foo';\n })\n }).create({\n bar: 'bar'\n });\n\n assert.equal(obj.cacheFor('foo'), undefined, 'should return undefined if no value has been cached');\n (0, _metal.get)(obj, 'foo');\n\n assert.equal((0, _metal.get)(obj, 'foo'), 'foo', 'precond - should cache the value');\n assert.equal(obj.cacheFor('foo'), 'foo', 'should return the cached value after it is invoked');\n\n assert.equal(obj.cacheFor('bar'), undefined, 'returns undefined if the value is not a computed property');\n }\n\n ['@test incrementProperty should work even if value is number in string'](assert) {\n let obj = _object.default.create({\n age: '24'\n });\n obj.incrementProperty('age');\n assert.equal(25, obj.get('age'));\n }\n\n ['@test propertyWillChange triggers a deprecation warning']() {\n let obj = _object.default.create();\n\n expectDeprecation(() => {\n obj.propertyWillChange('foo');\n }, /'propertyWillChange' is deprecated and has no effect. It is safe to remove this call./);\n }\n\n ['@test propertyDidChange triggers a deprecation warning']() {\n let obj = _object.default.create();\n\n expectDeprecation(() => {\n obj.propertyDidChange('foo');\n }, /'propertyDidChange' is deprecated in favor of 'notifyPropertyChange'. It is safe to change this call to 'notifyPropertyChange'./);\n }\n });\n});","enifed('@ember/-internals/runtime/tests/mixins/promise_proxy_test', ['@ember/runloop', '@ember/-internals/metal', '@ember/-internals/runtime/lib/system/object_proxy', '@ember/-internals/runtime/lib/mixins/promise_proxy', '@ember/-internals/runtime/lib/ext/rsvp', 'rsvp', 'internal-test-helpers'], function (_runloop, _metal, _object_proxy, _promise_proxy, _rsvp, _rsvp2, _internalTestHelpers) {\n 'use strict';\n\n let ObjectPromiseProxy;\n\n (0, _internalTestHelpers.moduleFor)('Ember.PromiseProxy - ObjectProxy', class extends _internalTestHelpers.AbstractTestCase {\n beforeEach() {\n ObjectPromiseProxy = _object_proxy.default.extend(_promise_proxy.default);\n }\n\n afterEach() {\n _rsvp2.on('error', _rsvp.onerrorDefault);\n }\n\n ['@test present on ember namespace'](assert) {\n assert.ok(_promise_proxy.default, 'expected PromiseProxyMixin to exist');\n }\n\n ['@test no promise, invoking then should raise'](assert) {\n let proxy = ObjectPromiseProxy.create();\n\n assert.throws(function () {\n proxy.then(function () {\n return this;\n }, function () {\n return this;\n });\n }, new RegExp(\"PromiseProxy's promise must be set\"));\n }\n\n ['@test fulfillment'](assert) {\n let value = {\n firstName: 'stef',\n lastName: 'penner'\n };\n\n let deferred = _rsvp2.defer();\n\n let proxy = ObjectPromiseProxy.create({\n promise: deferred.promise\n });\n\n let didFulfillCount = 0;\n let didRejectCount = 0;\n\n proxy.then(() => didFulfillCount++, () => didRejectCount++);\n\n assert.equal((0, _metal.get)(proxy, 'content'), undefined, 'expects the proxy to have no content');\n assert.equal((0, _metal.get)(proxy, 'reason'), undefined, 'expects the proxy to have no reason');\n assert.equal((0, _metal.get)(proxy, 'isPending'), true, 'expects the proxy to indicate that it is loading');\n assert.equal((0, _metal.get)(proxy, 'isSettled'), false, 'expects the proxy to indicate that it is not settled');\n assert.equal((0, _metal.get)(proxy, 'isRejected'), false, 'expects the proxy to indicate that it is not rejected');\n assert.equal((0, _metal.get)(proxy, 'isFulfilled'), false, 'expects the proxy to indicate that it is not fulfilled');\n\n assert.equal(didFulfillCount, 0, 'should not yet have been fulfilled');\n assert.equal(didRejectCount, 0, 'should not yet have been rejected');\n\n (0, _runloop.run)(deferred, 'resolve', value);\n\n assert.equal(didFulfillCount, 1, 'should have been fulfilled');\n assert.equal(didRejectCount, 0, 'should not have been rejected');\n\n assert.equal((0, _metal.get)(proxy, 'content'), value, 'expects the proxy to have content');\n assert.equal((0, _metal.get)(proxy, 'reason'), undefined, 'expects the proxy to still have no reason');\n assert.equal((0, _metal.get)(proxy, 'isPending'), false, 'expects the proxy to indicate that it is no longer loading');\n assert.equal((0, _metal.get)(proxy, 'isSettled'), true, 'expects the proxy to indicate that it is settled');\n assert.equal((0, _metal.get)(proxy, 'isRejected'), false, 'expects the proxy to indicate that it is not rejected');\n assert.equal((0, _metal.get)(proxy, 'isFulfilled'), true, 'expects the proxy to indicate that it is fulfilled');\n\n (0, _runloop.run)(deferred, 'resolve', value);\n\n assert.equal(didFulfillCount, 1, 'should still have been only fulfilled once');\n assert.equal(didRejectCount, 0, 'should still not have been rejected');\n\n (0, _runloop.run)(deferred, 'reject', value);\n\n assert.equal(didFulfillCount, 1, 'should still have been only fulfilled once');\n assert.equal(didRejectCount, 0, 'should still not have been rejected');\n\n assert.equal((0, _metal.get)(proxy, 'content'), value, 'expects the proxy to have still have same content');\n assert.equal((0, _metal.get)(proxy, 'reason'), undefined, 'expects the proxy still to have no reason');\n assert.equal((0, _metal.get)(proxy, 'isPending'), false, 'expects the proxy to indicate that it is no longer loading');\n assert.equal((0, _metal.get)(proxy, 'isSettled'), true, 'expects the proxy to indicate that it is settled');\n assert.equal((0, _metal.get)(proxy, 'isRejected'), false, 'expects the proxy to indicate that it is not rejected');\n assert.equal((0, _metal.get)(proxy, 'isFulfilled'), true, 'expects the proxy to indicate that it is fulfilled');\n\n // rest of the promise semantics are tested in directly in RSVP\n }\n\n ['@test rejection'](assert) {\n let reason = new Error('failure');\n let deferred = _rsvp2.defer();\n let proxy = ObjectPromiseProxy.create({\n promise: deferred.promise\n });\n\n let didFulfillCount = 0;\n let didRejectCount = 0;\n\n proxy.then(() => didFulfillCount++, () => didRejectCount++);\n\n assert.equal((0, _metal.get)(proxy, 'content'), undefined, 'expects the proxy to have no content');\n assert.equal((0, _metal.get)(proxy, 'reason'), undefined, 'expects the proxy to have no reason');\n assert.equal((0, _metal.get)(proxy, 'isPending'), true, 'expects the proxy to indicate that it is loading');\n assert.equal((0, _metal.get)(proxy, 'isSettled'), false, 'expects the proxy to indicate that it is not settled');\n assert.equal((0, _metal.get)(proxy, 'isRejected'), false, 'expects the proxy to indicate that it is not rejected');\n assert.equal((0, _metal.get)(proxy, 'isFulfilled'), false, 'expects the proxy to indicate that it is not fulfilled');\n\n assert.equal(didFulfillCount, 0, 'should not yet have been fulfilled');\n assert.equal(didRejectCount, 0, 'should not yet have been rejected');\n\n (0, _runloop.run)(deferred, 'reject', reason);\n\n assert.equal(didFulfillCount, 0, 'should not yet have been fulfilled');\n assert.equal(didRejectCount, 1, 'should have been rejected');\n\n assert.equal((0, _metal.get)(proxy, 'content'), undefined, 'expects the proxy to have no content');\n assert.equal((0, _metal.get)(proxy, 'reason'), reason, 'expects the proxy to have a reason');\n assert.equal((0, _metal.get)(proxy, 'isPending'), false, 'expects the proxy to indicate that it is not longer loading');\n assert.equal((0, _metal.get)(proxy, 'isSettled'), true, 'expects the proxy to indicate that it is settled');\n assert.equal((0, _metal.get)(proxy, 'isRejected'), true, 'expects the proxy to indicate that it is rejected');\n assert.equal((0, _metal.get)(proxy, 'isFulfilled'), false, 'expects the proxy to indicate that it is not fulfilled');\n\n (0, _runloop.run)(deferred, 'reject', reason);\n\n assert.equal(didFulfillCount, 0, 'should stll not yet have been fulfilled');\n assert.equal(didRejectCount, 1, 'should still remain rejected');\n\n (0, _runloop.run)(deferred, 'resolve', 1);\n\n assert.equal(didFulfillCount, 0, 'should stll not yet have been fulfilled');\n assert.equal(didRejectCount, 1, 'should still remain rejected');\n\n assert.equal((0, _metal.get)(proxy, 'content'), undefined, 'expects the proxy to have no content');\n assert.equal((0, _metal.get)(proxy, 'reason'), reason, 'expects the proxy to have a reason');\n assert.equal((0, _metal.get)(proxy, 'isPending'), false, 'expects the proxy to indicate that it is not longer loading');\n assert.equal((0, _metal.get)(proxy, 'isSettled'), true, 'expects the proxy to indicate that it is settled');\n assert.equal((0, _metal.get)(proxy, 'isRejected'), true, 'expects the proxy to indicate that it is rejected');\n assert.equal((0, _metal.get)(proxy, 'isFulfilled'), false, 'expects the proxy to indicate that it is not fulfilled');\n }\n\n // https://github.com/emberjs/ember.js/issues/15694\n ['@test rejection without specifying reason'](assert) {\n let deferred = _rsvp2.defer();\n let proxy = ObjectPromiseProxy.create({\n promise: deferred.promise\n });\n\n let didFulfillCount = 0;\n let didRejectCount = 0;\n\n proxy.then(() => didFulfillCount++, () => didRejectCount++);\n\n assert.equal((0, _metal.get)(proxy, 'content'), undefined, 'expects the proxy to have no content');\n assert.equal((0, _metal.get)(proxy, 'reason'), undefined, 'expects the proxy to have no reason');\n assert.equal((0, _metal.get)(proxy, 'isPending'), true, 'expects the proxy to indicate that it is loading');\n assert.equal((0, _metal.get)(proxy, 'isSettled'), false, 'expects the proxy to indicate that it is not settled');\n assert.equal((0, _metal.get)(proxy, 'isRejected'), false, 'expects the proxy to indicate that it is not rejected');\n assert.equal((0, _metal.get)(proxy, 'isFulfilled'), false, 'expects the proxy to indicate that it is not fulfilled');\n\n assert.equal(didFulfillCount, 0, 'should not yet have been fulfilled');\n assert.equal(didRejectCount, 0, 'should not yet have been rejected');\n\n (0, _runloop.run)(deferred, 'reject');\n\n assert.equal(didFulfillCount, 0, 'should not yet have been fulfilled');\n assert.equal(didRejectCount, 1, 'should have been rejected');\n\n assert.equal((0, _metal.get)(proxy, 'content'), undefined, 'expects the proxy to have no content');\n assert.equal((0, _metal.get)(proxy, 'reason'), undefined, 'expects the proxy to have a reason');\n assert.equal((0, _metal.get)(proxy, 'isPending'), false, 'expects the proxy to indicate that it is not longer loading');\n assert.equal((0, _metal.get)(proxy, 'isSettled'), true, 'expects the proxy to indicate that it is settled');\n assert.equal((0, _metal.get)(proxy, 'isRejected'), true, 'expects the proxy to indicate that it is rejected');\n assert.equal((0, _metal.get)(proxy, 'isFulfilled'), false, 'expects the proxy to indicate that it is not fulfilled');\n }\n\n [\"@test unhandled rejects still propagate to RSVP.on('error', ...) \"](assert) {\n assert.expect(1);\n\n _rsvp2.on('error', onerror);\n _rsvp2.off('error', _rsvp.onerrorDefault);\n\n let expectedReason = new Error('failure');\n let deferred = _rsvp2.defer();\n\n let proxy = ObjectPromiseProxy.create({\n promise: deferred.promise\n });\n\n proxy.get('promise');\n\n function onerror(reason) {\n assert.equal(reason, expectedReason, 'expected reason');\n }\n\n _rsvp2.on('error', onerror);\n _rsvp2.off('error', _rsvp.onerrorDefault);\n\n (0, _runloop.run)(deferred, 'reject', expectedReason);\n\n _rsvp2.on('error', _rsvp.onerrorDefault);\n _rsvp2.off('error', onerror);\n\n (0, _runloop.run)(deferred, 'reject', expectedReason);\n\n _rsvp2.on('error', _rsvp.onerrorDefault);\n _rsvp2.off('error', onerror);\n }\n\n ['@test should work with promise inheritance'](assert) {\n class PromiseSubclass extends _rsvp2.Promise {}\n\n let proxy = ObjectPromiseProxy.create({\n promise: new PromiseSubclass(() => {})\n });\n\n assert.ok(proxy.then() instanceof PromiseSubclass, 'promise proxy respected inheritance');\n }\n\n ['@test should reset isFulfilled and isRejected when promise is reset'](assert) {\n let deferred = _rsvp.default.defer();\n\n let proxy = ObjectPromiseProxy.create({\n promise: deferred.promise\n });\n\n assert.equal((0, _metal.get)(proxy, 'isPending'), true, 'expects the proxy to indicate that it is loading');\n assert.equal((0, _metal.get)(proxy, 'isSettled'), false, 'expects the proxy to indicate that it is not settled');\n assert.equal((0, _metal.get)(proxy, 'isRejected'), false, 'expects the proxy to indicate that it is not rejected');\n assert.equal((0, _metal.get)(proxy, 'isFulfilled'), false, 'expects the proxy to indicate that it is not fulfilled');\n\n (0, _runloop.run)(deferred, 'resolve');\n\n assert.equal((0, _metal.get)(proxy, 'isPending'), false, 'expects the proxy to indicate that it is no longer loading');\n assert.equal((0, _metal.get)(proxy, 'isSettled'), true, 'expects the proxy to indicate that it is settled');\n assert.equal((0, _metal.get)(proxy, 'isRejected'), false, 'expects the proxy to indicate that it is not rejected');\n assert.equal((0, _metal.get)(proxy, 'isFulfilled'), true, 'expects the proxy to indicate that it is fulfilled');\n\n let anotherDeferred = _rsvp.default.defer();\n proxy.set('promise', anotherDeferred.promise);\n\n assert.equal((0, _metal.get)(proxy, 'isPending'), true, 'expects the proxy to indicate that it is loading');\n assert.equal((0, _metal.get)(proxy, 'isSettled'), false, 'expects the proxy to indicate that it is not settled');\n assert.equal((0, _metal.get)(proxy, 'isRejected'), false, 'expects the proxy to indicate that it is not rejected');\n assert.equal((0, _metal.get)(proxy, 'isFulfilled'), false, 'expects the proxy to indicate that it is not fulfilled');\n\n (0, _runloop.run)(anotherDeferred, 'reject');\n\n assert.equal((0, _metal.get)(proxy, 'isPending'), false, 'expects the proxy to indicate that it is not longer loading');\n assert.equal((0, _metal.get)(proxy, 'isSettled'), true, 'expects the proxy to indicate that it is settled');\n assert.equal((0, _metal.get)(proxy, 'isRejected'), true, 'expects the proxy to indicate that it is rejected');\n assert.equal((0, _metal.get)(proxy, 'isFulfilled'), false, 'expects the proxy to indicate that it is not fulfilled');\n }\n\n ['@test should have content when isFulfilled is set'](assert) {\n let deferred = _rsvp.default.defer();\n\n let proxy = ObjectPromiseProxy.create({\n promise: deferred.promise\n });\n\n proxy.addObserver('isFulfilled', () => assert.equal((0, _metal.get)(proxy, 'content'), true));\n\n (0, _runloop.run)(deferred, 'resolve', true);\n }\n\n ['@test should have reason when isRejected is set'](assert) {\n let error = new Error('Y U REJECT?!?');\n let deferred = _rsvp.default.defer();\n\n let proxy = ObjectPromiseProxy.create({\n promise: deferred.promise\n });\n\n proxy.addObserver('isRejected', () => assert.equal((0, _metal.get)(proxy, 'reason'), error));\n\n try {\n (0, _runloop.run)(deferred, 'reject', error);\n } catch (e) {\n assert.equal(e, error);\n }\n }\n\n ['@test should not error if promise is resolved after proxy has been destroyed'](assert) {\n let deferred = _rsvp.default.defer();\n\n let proxy = ObjectPromiseProxy.create({\n promise: deferred.promise\n });\n\n proxy.then(() => {}, () => {});\n\n (0, _runloop.run)(proxy, 'destroy');\n\n (0, _runloop.run)(deferred, 'resolve', true);\n\n assert.ok(true, 'resolving the promise after the proxy has been destroyed does not raise an error');\n }\n\n ['@test should not error if promise is rejected after proxy has been destroyed'](assert) {\n let deferred = _rsvp.default.defer();\n\n let proxy = ObjectPromiseProxy.create({\n promise: deferred.promise\n });\n\n proxy.then(() => {}, () => {});\n\n (0, _runloop.run)(proxy, 'destroy');\n\n (0, _runloop.run)(deferred, 'reject', 'some reason');\n\n assert.ok(true, 'rejecting the promise after the proxy has been destroyed does not raise an error');\n }\n\n ['@test promise chain is not broken if promised is resolved after proxy has been destroyed'](assert) {\n let deferred = _rsvp.default.defer();\n let expectedValue = {};\n let receivedValue;\n let didResolveCount = 0;\n\n let proxy = ObjectPromiseProxy.create({\n promise: deferred.promise\n });\n\n proxy.then(value => {\n receivedValue = value;\n didResolveCount++;\n }, () => {});\n\n (0, _runloop.run)(proxy, 'destroy');\n\n (0, _runloop.run)(deferred, 'resolve', expectedValue);\n\n assert.equal(didResolveCount, 1, 'callback called');\n assert.equal(receivedValue, expectedValue, 'passed value is the value the promise was resolved with');\n }\n\n ['@test promise chain is not broken if promised is rejected after proxy has been destroyed'](assert) {\n let deferred = _rsvp.default.defer();\n let expectedReason = 'some reason';\n let receivedReason;\n let didRejectCount = 0;\n\n let proxy = ObjectPromiseProxy.create({\n promise: deferred.promise\n });\n\n proxy.then(() => {}, reason => {\n receivedReason = reason;\n didRejectCount++;\n });\n\n (0, _runloop.run)(proxy, 'destroy');\n\n (0, _runloop.run)(deferred, 'reject', expectedReason);\n\n assert.equal(didRejectCount, 1, 'callback called');\n assert.equal(receivedReason, expectedReason, 'passed reason is the reason the promise was rejected for');\n }\n });\n});","enifed('@ember/-internals/runtime/tests/mixins/target_action_support_test', ['@ember/-internals/environment', '@ember/-internals/runtime/lib/system/object', '@ember/-internals/runtime/lib/mixins/target_action_support', 'internal-test-helpers'], function (_environment, _object, _target_action_support, _internalTestHelpers) {\n 'use strict';\n\n let originalLookup = _environment.context.lookup;\n let lookup;\n\n (0, _internalTestHelpers.moduleFor)('TargetActionSupport', class extends _internalTestHelpers.AbstractTestCase {\n beforeEach() {\n _environment.context.lookup = lookup = {};\n }\n\n afterEach() {\n _environment.context.lookup = originalLookup;\n }\n\n ['@test it should return false if no target or action are specified'](assert) {\n assert.expect(1);\n\n let obj = _object.default.extend(_target_action_support.default).create();\n\n assert.ok(false === obj.triggerAction(), 'no target or action was specified');\n }\n\n ['@test it should support actions specified as strings'](assert) {\n assert.expect(2);\n\n let obj = _object.default.extend(_target_action_support.default).create({\n target: _object.default.create({\n anEvent() {\n assert.ok(true, 'anEvent method was called');\n }\n }),\n\n action: 'anEvent'\n });\n\n assert.ok(true === obj.triggerAction(), 'a valid target and action were specified');\n }\n\n ['@test it should invoke the send() method on objects that implement it'](assert) {\n assert.expect(3);\n\n let obj = _object.default.extend(_target_action_support.default).create({\n target: _object.default.create({\n send(evt, context) {\n assert.equal(evt, 'anEvent', 'send() method was invoked with correct event name');\n assert.equal(context, obj, 'send() method was invoked with correct context');\n }\n }),\n\n action: 'anEvent'\n });\n\n assert.ok(true === obj.triggerAction(), 'a valid target and action were specified');\n }\n\n ['@test it should find targets specified using a property path'](assert) {\n assert.expect(2);\n\n let Test = {};\n lookup.Test = Test;\n\n Test.targetObj = _object.default.create({\n anEvent() {\n assert.ok(true, 'anEvent method was called on global object');\n }\n });\n\n let myObj = _object.default.extend(_target_action_support.default).create({\n target: 'Test.targetObj',\n action: 'anEvent'\n });\n\n assert.ok(true === myObj.triggerAction(), 'a valid target and action were specified');\n }\n\n ['@test it should use an actionContext object specified as a property on the object'](assert) {\n assert.expect(2);\n let obj = _object.default.extend(_target_action_support.default).create({\n action: 'anEvent',\n actionContext: {},\n target: _object.default.create({\n anEvent(ctx) {\n assert.ok(obj.actionContext === ctx, 'anEvent method was called with the expected context');\n }\n })\n });\n assert.ok(true === obj.triggerAction(), 'a valid target and action were specified');\n }\n\n ['@test it should raise a deprecation warning when targetObject is specified and used'](assert) {\n assert.expect(4);\n let obj;\n expectDeprecation(() => {\n obj = _object.default.extend(_target_action_support.default).create({\n action: 'anEvent',\n actionContext: {},\n targetObject: _object.default.create({\n anEvent(ctx) {\n assert.ok(obj.actionContext === ctx, 'anEvent method was called with the expected context');\n }\n })\n });\n }, /Usage of `targetObject` is deprecated. Please use `target` instead./);\n assert.ok(true === obj.triggerAction(), 'a valid targetObject and action were specified');\n expectDeprecation(() => obj.get('targetObject'), /Usage of `targetObject` is deprecated. Please use `target` instead./);\n }\n\n ['@test it should find an actionContext specified as a property path'](assert) {\n assert.expect(2);\n\n let Test = {};\n lookup.Test = Test;\n Test.aContext = {};\n\n let obj = _object.default.extend(_target_action_support.default).create({\n action: 'anEvent',\n actionContext: 'Test.aContext',\n target: _object.default.create({\n anEvent(ctx) {\n assert.ok(Test.aContext === ctx, 'anEvent method was called with the expected context');\n }\n })\n });\n\n assert.ok(true === obj.triggerAction(), 'a valid target and action were specified');\n }\n\n ['@test it should use the target specified in the argument'](assert) {\n assert.expect(2);\n let targetObj = _object.default.create({\n anEvent() {\n assert.ok(true, 'anEvent method was called');\n }\n });\n let obj = _object.default.extend(_target_action_support.default).create({\n action: 'anEvent'\n });\n\n assert.ok(true === obj.triggerAction({ target: targetObj }), 'a valid target and action were specified');\n }\n\n ['@test it should use the action specified in the argument'](assert) {\n assert.expect(2);\n\n let obj = _object.default.extend(_target_action_support.default).create({\n target: _object.default.create({\n anEvent() {\n assert.ok(true, 'anEvent method was called');\n }\n })\n });\n assert.ok(true === obj.triggerAction({ action: 'anEvent' }), 'a valid target and action were specified');\n }\n\n ['@test it should use the actionContext specified in the argument'](assert) {\n assert.expect(2);\n let context = {};\n let obj = _object.default.extend(_target_action_support.default).create({\n target: _object.default.create({\n anEvent(ctx) {\n assert.ok(context === ctx, 'anEvent method was called with the expected context');\n }\n }),\n action: 'anEvent'\n });\n\n assert.ok(true === obj.triggerAction({ actionContext: context }), 'a valid target and action were specified');\n }\n\n ['@test it should allow multiple arguments from actionContext'](assert) {\n assert.expect(3);\n let param1 = 'someParam';\n let param2 = 'someOtherParam';\n let obj = _object.default.extend(_target_action_support.default).create({\n target: _object.default.create({\n anEvent(first, second) {\n assert.ok(first === param1, 'anEvent method was called with the expected first argument');\n assert.ok(second === param2, 'anEvent method was called with the expected second argument');\n }\n }),\n action: 'anEvent'\n });\n\n assert.ok(true === obj.triggerAction({ actionContext: [param1, param2] }), 'a valid target and action were specified');\n }\n\n ['@test it should use a null value specified in the actionContext argument'](assert) {\n assert.expect(2);\n let obj = _object.default.extend(_target_action_support.default).create({\n target: _object.default.create({\n anEvent(ctx) {\n assert.ok(null === ctx, 'anEvent method was called with the expected context (null)');\n }\n }),\n action: 'anEvent'\n });\n assert.ok(true === obj.triggerAction({ actionContext: null }), 'a valid target and action were specified');\n }\n });\n});","enifed('@ember/-internals/runtime/tests/mutable-array/addObject-test', ['@ember/-internals/metal', 'internal-test-helpers', '@ember/-internals/runtime/tests/helpers/array'], function (_metal, _internalTestHelpers, _array) {\n 'use strict';\n\n class AddObjectTest extends _internalTestHelpers.AbstractTestCase {\n '@test should return receiver'() {\n let before = (0, _array.newFixture)(3);\n let obj = this.newObject(before);\n this.assert.equal(obj.addObject(before[1]), obj, 'should return receiver');\n }\n\n '@test [A,B].addObject(C) => [A,B,C] + notify'() {\n let before = (0, _array.newFixture)(2);\n let item = (0, _array.newFixture)(1)[0];\n let after = [before[0], before[1], item];\n let obj = this.newObject(before);\n let observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject');\n\n obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */\n\n obj.addObject(item);\n\n this.assert.deepEqual(this.toArray(obj), after, 'post item results');\n this.assert.equal((0, _metal.get)(obj, 'length'), after.length, 'length');\n\n if (observer.isEnabled) {\n this.assert.equal(observer.timesCalled('[]'), 1, 'should have notified [] once');\n this.assert.equal(observer.timesCalled('@each'), 0, 'should not have notified @each once');\n this.assert.equal(observer.timesCalled('length'), 1, 'should have notified length once');\n this.assert.equal(observer.timesCalled('lastObject'), 1, 'should have notified lastObject once');\n\n this.assert.equal(observer.validate('firstObject'), false, 'should NOT have notified firstObject once');\n }\n }\n\n '@test [A,B,C].addObject(A) => [A,B,C] + NO notify'() {\n let before = (0, _array.newFixture)(3);\n let after = before;\n let item = before[0];\n let obj = this.newObject(before);\n let observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject');\n\n obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */\n\n obj.addObject(item); // note: item in set\n\n this.assert.deepEqual(this.toArray(obj), after, 'post item results');\n this.assert.equal((0, _metal.get)(obj, 'length'), after.length, 'length');\n\n if (observer.isEnabled) {\n this.assert.equal(observer.validate('[]'), false, 'should NOT have notified []');\n this.assert.equal(observer.validate('@each'), false, 'should NOT have notified @each');\n this.assert.equal(observer.validate('length'), false, 'should NOT have notified length');\n this.assert.equal(observer.validate('firstObject'), false, 'should NOT have notified firstObject once');\n this.assert.equal(observer.validate('lastObject'), false, 'should NOT have notified lastObject once');\n }\n }\n }\n\n (0, _array.runArrayTests)('addObject', AddObjectTest, 'MutableArray', 'NativeArray', 'ArrayProxy');\n});","enifed('@ember/-internals/runtime/tests/mutable-array/clear-test', ['@ember/-internals/metal', 'internal-test-helpers', '@ember/-internals/runtime/tests/helpers/array'], function (_metal, _internalTestHelpers, _array) {\n 'use strict';\n\n class ClearTests extends _internalTestHelpers.AbstractTestCase {\n '@test [].clear() => [] + notify'() {\n let before = [];\n let after = [];\n let obj = this.newObject(before);\n let observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject');\n\n obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */\n\n this.assert.equal(obj.clear(), obj, 'return self');\n\n this.assert.deepEqual(this.toArray(obj), after, 'post item results');\n this.assert.equal((0, _metal.get)(obj, 'length'), after.length, 'length');\n\n this.assert.equal(observer.validate('[]'), false, 'should NOT have notified [] once');\n this.assert.equal(observer.validate('@each'), false, 'should NOT have notified @each once');\n this.assert.equal(observer.validate('length'), false, 'should NOT have notified length once');\n this.assert.equal(observer.validate('firstObject'), false, 'should NOT have notified firstObject once');\n this.assert.equal(observer.validate('lastObject'), false, 'should NOT have notified lastObject once');\n }\n\n '@test [X].clear() => [] + notify'() {\n var obj, before, after, observer;\n\n before = (0, _array.newFixture)(1);\n after = [];\n obj = this.newObject(before);\n observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject');\n obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */\n\n this.assert.equal(obj.clear(), obj, 'return self');\n\n this.assert.deepEqual(this.toArray(obj), after, 'post item results');\n this.assert.equal((0, _metal.get)(obj, 'length'), after.length, 'length');\n\n this.assert.equal(observer.timesCalled('[]'), 1, 'should have notified [] once');\n this.assert.equal(observer.timesCalled('@each'), 0, 'should not have notified @each once');\n this.assert.equal(observer.timesCalled('length'), 1, 'should have notified length once');\n this.assert.equal(observer.timesCalled('firstObject'), 1, 'should have notified firstObject once');\n this.assert.equal(observer.timesCalled('lastObject'), 1, 'should have notified lastObject once');\n }\n }\n\n (0, _array.runArrayTests)('clear', ClearTests, 'MutableArray', 'NativeArray', 'ArrayProxy');\n});","enifed('@ember/-internals/runtime/tests/mutable-array/insertAt-test', ['@ember/-internals/metal', 'internal-test-helpers', '@ember/-internals/runtime/tests/helpers/array'], function (_metal, _internalTestHelpers, _array) {\n 'use strict';\n\n class InsertAtTests extends _internalTestHelpers.AbstractTestCase {\n '@test [].insertAt(0, X) => [X] + notify'() {\n let after = (0, _array.newFixture)(1);\n let obj = this.newObject([]);\n let observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject');\n\n obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */\n\n obj.insertAt(0, after[0]);\n\n this.assert.deepEqual(this.toArray(obj), after, 'post item results');\n this.assert.equal((0, _metal.get)(obj, 'length'), after.length, 'length');\n\n this.assert.equal(observer.timesCalled('[]'), 1, 'should have notified [] did change once');\n this.assert.equal(observer.timesCalled('@each'), 0, 'should not have notified @each did change once');\n this.assert.equal(observer.timesCalled('length'), 1, 'should have notified length did change once');\n this.assert.equal(observer.timesCalled('firstObject'), 1, 'should have notified firstObject did change once');\n this.assert.equal(observer.timesCalled('lastObject'), 1, 'should have notified lastObject did change once');\n }\n\n '@test [].insertAt(200,X) => OUT_OF_RANGE_EXCEPTION exception'() {\n let obj = this.newObject([]);\n let that = this;\n\n this.assert.throws(() => obj.insertAt(200, that.newFixture(1)[0]), Error);\n }\n\n '@test [A].insertAt(0, X) => [X,A] + notify'() {\n let item = (0, _array.newFixture)(1)[0];\n let before = (0, _array.newFixture)(1);\n let after = [item, before[0]];\n let obj = this.newObject(before);\n let observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject');\n\n obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */\n\n obj.insertAt(0, item);\n\n this.assert.deepEqual(this.toArray(obj), after, 'post item results');\n this.assert.equal((0, _metal.get)(obj, 'length'), after.length, 'length');\n\n this.assert.equal(observer.timesCalled('[]'), 1, 'should have notified [] once');\n this.assert.equal(observer.timesCalled('@each'), 0, 'should not have notified @each once');\n this.assert.equal(observer.timesCalled('length'), 1, 'should have notified length once');\n this.assert.equal(observer.timesCalled('firstObject'), 1, 'should have notified firstObject once');\n\n this.assert.equal(observer.validate('lastObject'), false, 'should NOT have notified lastObject');\n }\n\n '@test [A].insertAt(1, X) => [A,X] + notify'() {\n let item = (0, _array.newFixture)(1)[0];\n let before = (0, _array.newFixture)(1);\n let after = [before[0], item];\n let obj = this.newObject(before);\n let observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject');\n\n obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */\n\n obj.insertAt(1, item);\n\n this.assert.deepEqual(this.toArray(obj), after, 'post item results');\n this.assert.equal((0, _metal.get)(obj, 'length'), after.length, 'length');\n\n this.assert.equal(observer.timesCalled('[]'), 1, 'should have notified [] once');\n this.assert.equal(observer.timesCalled('@each'), 0, 'should not have notified @each once');\n this.assert.equal(observer.timesCalled('length'), 1, 'should have notified length once');\n this.assert.equal(observer.timesCalled('lastObject'), 1, 'should have notified lastObject once');\n\n this.assert.equal(observer.validate('firstObject'), false, 'should NOT have notified firstObject');\n }\n\n '@test [A].insertAt(200,X) => OUT_OF_RANGE exception'() {\n let obj = this.newObject((0, _array.newFixture)(1));\n let that = this;\n\n this.assert.throws(() => obj.insertAt(200, that.newFixture(1)[0]), Error);\n }\n\n '@test [A,B,C].insertAt(0,X) => [X,A,B,C] + notify'() {\n let item = (0, _array.newFixture)(1)[0];\n let before = (0, _array.newFixture)(3);\n let after = [item, before[0], before[1], before[2]];\n let obj = this.newObject(before);\n let observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject');\n\n obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */\n\n obj.insertAt(0, item);\n\n this.assert.deepEqual(this.toArray(obj), after, 'post item results');\n this.assert.equal((0, _metal.get)(obj, 'length'), after.length, 'length');\n\n this.assert.equal(observer.timesCalled('[]'), 1, 'should have notified [] once');\n this.assert.equal(observer.timesCalled('@each'), 0, 'should not have notified @each once');\n this.assert.equal(observer.timesCalled('length'), 1, 'should have notified length once');\n this.assert.equal(observer.timesCalled('firstObject'), 1, 'should have notified firstObject once');\n\n this.assert.equal(observer.validate('lastObject'), false, 'should NOT have notified lastObject');\n }\n\n '@test [A,B,C].insertAt(1,X) => [A,X,B,C] + notify'() {\n let item = (0, _array.newFixture)(1)[0];\n let before = (0, _array.newFixture)(3);\n let after = [before[0], item, before[1], before[2]];\n let obj = this.newObject(before);\n let observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject');\n let objectAtCalls = [];\n\n let objectAt = obj.objectAt;\n obj.objectAt = ix => {\n objectAtCalls.push(ix);\n return objectAt.call(obj, ix);\n };\n\n obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */\n\n objectAtCalls.splice(0, objectAtCalls.length);\n\n obj.insertAt(1, item);\n this.assert.deepEqual(objectAtCalls, [], 'objectAt is not called when only inserting items');\n\n this.assert.deepEqual(this.toArray(obj), after, 'post item results');\n this.assert.equal((0, _metal.get)(obj, 'length'), after.length, 'length');\n\n this.assert.equal(observer.timesCalled('[]'), 1, 'should have notified [] once');\n this.assert.equal(observer.timesCalled('@each'), 0, 'should not have notified @each once');\n this.assert.equal(observer.timesCalled('length'), 1, 'should have notified length once');\n\n this.assert.equal(observer.validate('firstObject'), false, 'should NOT have notified firstObject');\n this.assert.equal(observer.validate('lastObject'), false, 'should NOT have notified lastObject');\n }\n\n '@test [A,B,C].insertAt(3,X) => [A,B,C,X] + notify'() {\n let item = (0, _array.newFixture)(1)[0];\n let before = (0, _array.newFixture)(3);\n let after = [before[0], before[1], before[2], item];\n let obj = this.newObject(before);\n let observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject');\n\n obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */\n\n obj.insertAt(3, item);\n\n this.assert.deepEqual(this.toArray(obj), after, 'post item results');\n this.assert.equal((0, _metal.get)(obj, 'length'), after.length, 'length');\n\n this.assert.equal(observer.timesCalled('[]'), 1, 'should have notified [] once');\n this.assert.equal(observer.timesCalled('@each'), 0, 'should not have notified @each once');\n this.assert.equal(observer.timesCalled('length'), 1, 'should have notified length once');\n this.assert.equal(observer.timesCalled('lastObject'), 1, 'should have notified lastObject once');\n\n this.assert.equal(observer.validate('firstObject'), false, 'should NOT have notified firstObject');\n }\n }\n\n (0, _array.runArrayTests)('instertAt', InsertAtTests, 'MutableArray', 'NativeArray', 'ArrayProxy');\n});","enifed('@ember/-internals/runtime/tests/mutable-array/popObject-test', ['@ember/-internals/metal', 'internal-test-helpers', '@ember/-internals/runtime/tests/helpers/array'], function (_metal, _internalTestHelpers, _array) {\n 'use strict';\n\n class PopObjectTests extends _internalTestHelpers.AbstractTestCase {\n '@test [].popObject() => [] + returns undefined + NO notify'() {\n let obj = this.newObject([]);\n let observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject');\n\n obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */\n\n this.assert.equal(obj.popObject(), undefined, 'popObject results');\n\n this.assert.deepEqual(this.toArray(obj), [], 'post item results');\n\n this.assert.equal(observer.validate('[]'), false, 'should NOT have notified []');\n this.assert.equal(observer.validate('@each'), false, 'should NOT have notified @each');\n this.assert.equal(observer.validate('length'), false, 'should NOT have notified length');\n this.assert.equal(observer.validate('firstObject'), false, 'should NOT have notified firstObject');\n this.assert.equal(observer.validate('lastObject'), false, 'should NOT have notified lastObject');\n }\n\n '@test [X].popObject() => [] + notify'() {\n let before = (0, _array.newFixture)(1);\n let after = [];\n let obj = this.newObject(before);\n let observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject');\n\n obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */\n\n let ret = obj.popObject();\n\n this.assert.equal(ret, before[0], 'return object');\n this.assert.deepEqual(this.toArray(obj), after, 'post item results');\n this.assert.equal((0, _metal.get)(obj, 'length'), after.length, 'length');\n\n this.assert.equal(observer.timesCalled('[]'), 1, 'should have notified [] once');\n this.assert.equal(observer.timesCalled('@each'), 0, 'should not have notified @each once');\n this.assert.equal(observer.timesCalled('length'), 1, 'should have notified length once');\n this.assert.equal(observer.timesCalled('firstObject'), 1, 'should have notified firstObject once');\n this.assert.equal(observer.timesCalled('lastObject'), 1, 'should have notified lastObject once');\n }\n\n '@test [A,B,C].popObject() => [A,B] + notify'() {\n let before = (0, _array.newFixture)(3);\n let after = [before[0], before[1]];\n let obj = this.newObject(before);\n let observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject');\n\n obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */\n\n let ret = obj.popObject();\n\n this.assert.equal(ret, before[2], 'return object');\n this.assert.deepEqual(this.toArray(obj), after, 'post item results');\n this.assert.equal((0, _metal.get)(obj, 'length'), after.length, 'length');\n\n this.assert.equal(observer.timesCalled('[]'), 1, 'should have notified [] once');\n this.assert.equal(observer.timesCalled('@each'), 0, 'should not have notified @each once');\n this.assert.equal(observer.timesCalled('length'), 1, 'should have notified length once');\n this.assert.equal(observer.timesCalled('lastObject'), 1, 'should have notified lastObject once');\n\n this.assert.equal(observer.validate('firstObject'), false, 'should NOT have notified firstObject');\n }\n }\n\n (0, _array.runArrayTests)('popObject', PopObjectTests, 'MutableArray', 'NativeArray', 'ArrayProxy');\n});","enifed('@ember/-internals/runtime/tests/mutable-array/pushObject-test', ['@ember/-internals/metal', 'internal-test-helpers', '@ember/-internals/runtime/tests/helpers/array'], function (_metal, _internalTestHelpers, _array) {\n 'use strict';\n\n class PushObjectTests extends _internalTestHelpers.AbstractTestCase {\n '@test returns pushed object'() {\n let exp = (0, _array.newFixture)(1)[0];\n let obj = this.newObject([]);\n\n this.assert.equal(obj.pushObject(exp), exp, 'should return pushed object');\n }\n\n '@test [].pushObject(X) => [X] + notify'() {\n let before = [];\n let after = (0, _array.newFixture)(1);\n let obj = this.newObject(before);\n let observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject');\n\n obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */\n\n obj.pushObject(after[0]);\n\n this.assert.deepEqual(this.toArray(obj), after, 'post item results');\n this.assert.equal((0, _metal.get)(obj, 'length'), after.length, 'length');\n\n this.assert.equal(observer.timesCalled('[]'), 1, 'should have notified [] once');\n this.assert.equal(observer.timesCalled('@each'), 0, 'should not have notified @each once');\n this.assert.equal(observer.timesCalled('length'), 1, 'should have notified length once');\n this.assert.equal(observer.timesCalled('firstObject'), 1, 'should have notified firstObject once');\n this.assert.equal(observer.timesCalled('lastObject'), 1, 'should have notified lastObject once');\n }\n\n '@test [A,B,C].pushObject(X) => [A,B,C,X] + notify'() {\n let before = (0, _array.newFixture)(3);\n let item = (0, _array.newFixture)(1)[0];\n let after = [before[0], before[1], before[2], item];\n let obj = this.newObject(before);\n let observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject');\n\n obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */\n\n obj.pushObject(item);\n\n this.assert.deepEqual(this.toArray(obj), after, 'post item results');\n this.assert.equal((0, _metal.get)(obj, 'length'), after.length, 'length');\n\n this.assert.equal(observer.timesCalled('[]'), 1, 'should have notified [] once');\n this.assert.equal(observer.timesCalled('@each'), 0, 'should not have notified @each once');\n this.assert.equal(observer.timesCalled('length'), 1, 'should have notified length once');\n this.assert.equal(observer.timesCalled('lastObject'), 1, 'should have notified lastObject once');\n\n this.assert.equal(observer.validate('firstObject'), false, 'should NOT have notified firstObject');\n }\n\n '@test [A,B,C,C].pushObject(A) => [A,B,C,C] + notify'() {\n let before = (0, _array.newFixture)(3);\n let item = before[2]; // note same object as current tail. should end up twice\n let after = [before[0], before[1], before[2], item];\n let obj = this.newObject(before);\n let observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject');\n\n obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */\n\n obj.pushObject(item);\n\n this.assert.deepEqual(this.toArray(obj), after, 'post item results');\n this.assert.equal((0, _metal.get)(obj, 'length'), after.length, 'length');\n\n this.assert.equal(observer.timesCalled('[]'), 1, 'should have notified [] once');\n this.assert.equal(observer.timesCalled('@each'), 0, 'should not have notified @each once');\n this.assert.equal(observer.timesCalled('length'), 1, 'should have notified length once');\n\n this.assert.equal(observer.validate('firstObject'), false, 'should NOT have notified firstObject');\n this.assert.equal(observer.validate('lastObject'), true, 'should have notified lastObject');\n }\n }\n\n (0, _array.runArrayTests)('pushObject', PushObjectTests, 'MutableArray', 'NativeArray', 'ArrayProxy');\n});","enifed('@ember/-internals/runtime/tests/mutable-array/pushObjects-test', ['internal-test-helpers', '@ember/-internals/runtime/tests/helpers/array'], function (_internalTestHelpers, _array) {\n 'use strict';\n\n class PushObjectsTests extends _internalTestHelpers.AbstractTestCase {\n '@test should raise exception if not Ember.Enumerable is passed to pushObjects'() {\n let obj = this.newObject([]);\n\n expectAssertion(() => obj.pushObjects('string'));\n }\n }\n\n (0, _array.runArrayTests)('pushObjects', PushObjectsTests, 'MutableArray', 'NativeArray', 'ArrayProxy');\n});","enifed('@ember/-internals/runtime/tests/mutable-array/removeAt-test', ['internal-test-helpers', '@ember/-internals/runtime/tests/helpers/array', '@ember/-internals/runtime/lib/mixins/array', '@ember/-internals/metal'], function (_internalTestHelpers, _array, _array2, _metal) {\n 'use strict';\n\n class RemoveAtTests extends _internalTestHelpers.AbstractTestCase {\n '@test removeAt([X], 0) => [] + notify'() {\n let before = (0, _array.newFixture)(1);\n let after = [];\n let obj = this.newObject(before);\n let observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject');\n\n obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */\n\n this.assert.equal((0, _array2.removeAt)(obj, 0), obj, 'return self');\n\n this.assert.deepEqual(this.toArray(obj), after, 'post item results');\n this.assert.equal((0, _metal.get)(obj, 'length'), after.length, 'length');\n\n this.assert.equal(observer.timesCalled('[]'), 1, 'should have notified [] once');\n this.assert.equal(observer.timesCalled('@each'), 0, 'should not have notified @each once');\n this.assert.equal(observer.timesCalled('length'), 1, 'should have notified length once');\n this.assert.equal(observer.timesCalled('firstObject'), 1, 'should have notified firstObject once');\n this.assert.equal(observer.timesCalled('lastObject'), 1, 'should have notified lastObject once');\n }\n\n '@test removeAt([], 200) => OUT_OF_RANGE_EXCEPTION exception'() {\n let obj = this.newObject([]);\n this.assert.throws(() => (0, _array2.removeAt)(obj, 200), Error);\n }\n\n '@test removeAt([A,B], 0) => [B] + notify'() {\n let before = (0, _array.newFixture)(2);\n let after = [before[1]];\n let obj = this.newObject(before);\n let observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject');\n\n obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */\n\n this.assert.equal((0, _array2.removeAt)(obj, 0), obj, 'return self');\n\n this.assert.deepEqual(this.toArray(obj), after, 'post item results');\n this.assert.equal((0, _metal.get)(obj, 'length'), after.length, 'length');\n\n this.assert.equal(observer.timesCalled('[]'), 1, 'should have notified [] once');\n this.assert.equal(observer.timesCalled('@each'), 0, 'should not have notified @each once');\n this.assert.equal(observer.timesCalled('length'), 1, 'should have notified length once');\n this.assert.equal(observer.timesCalled('firstObject'), 1, 'should have notified firstObject once');\n\n this.assert.equal(observer.validate('lastObject'), false, 'should NOT have notified lastObject');\n }\n\n '@test removeAt([A,B], 1) => [A] + notify'() {\n let before = (0, _array.newFixture)(2);\n let after = [before[0]];\n let obj = this.newObject(before);\n let observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject');\n\n obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */\n\n this.assert.equal((0, _array2.removeAt)(obj, 1), obj, 'return self');\n\n this.assert.deepEqual(this.toArray(obj), after, 'post item results');\n this.assert.equal((0, _metal.get)(obj, 'length'), after.length, 'length');\n\n this.assert.equal(observer.timesCalled('[]'), 1, 'should have notified [] once');\n this.assert.equal(observer.timesCalled('@each'), 0, 'should not have notified @each once');\n this.assert.equal(observer.timesCalled('length'), 1, 'should have notified length once');\n this.assert.equal(observer.timesCalled('lastObject'), 1, 'should have notified lastObject once');\n\n this.assert.equal(observer.validate('firstObject'), false, 'should NOT have notified firstObject once');\n }\n\n '@test removeAt([A,B,C], 1) => [A,C] + notify'() {\n let before = (0, _array.newFixture)(3);\n let after = [before[0], before[2]];\n let obj = this.newObject(before);\n let observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject');\n\n obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */\n\n this.assert.equal((0, _array2.removeAt)(obj, 1), obj, 'return self');\n\n this.assert.deepEqual(this.toArray(obj), after, 'post item results');\n this.assert.equal((0, _metal.get)(obj, 'length'), after.length, 'length');\n\n this.assert.equal(observer.timesCalled('[]'), 1, 'should have notified [] once');\n this.assert.equal(observer.timesCalled('@each'), 0, 'should not have notified @each once');\n this.assert.equal(observer.timesCalled('length'), 1, 'should have notified length once');\n\n this.assert.equal(observer.validate('firstObject'), false, 'should NOT have notified firstObject once');\n this.assert.equal(observer.validate('lastObject'), false, 'should NOT have notified lastObject once');\n }\n\n '@test removeAt([A,B,C,D], 1,2) => [A,D] + notify'() {\n let before = (0, _array.newFixture)(4);\n let after = [before[0], before[3]];\n let obj = this.newObject(before);\n let observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject');\n\n obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */\n\n this.assert.equal((0, _array2.removeAt)(obj, 1, 2), obj, 'return self');\n\n this.assert.deepEqual(this.toArray(obj), after, 'post item results');\n this.assert.equal((0, _metal.get)(obj, 'length'), after.length, 'length');\n\n this.assert.equal(observer.timesCalled('[]'), 1, 'should have notified [] once');\n this.assert.equal(observer.timesCalled('@each'), 0, 'should not have notified @each once');\n this.assert.equal(observer.timesCalled('length'), 1, 'should have notified length once');\n\n this.assert.equal(observer.validate('firstObject'), false, 'should NOT have notified firstObject once');\n this.assert.equal(observer.validate('lastObject'), false, 'should NOT have notified lastObject once');\n }\n\n '@test [A,B,C,D].removeAt(1,2) => [A,D] + notify'() {\n var obj, before, after, observer;\n\n before = (0, _array.newFixture)(4);\n after = [before[0], before[3]];\n obj = this.newObject(before);\n observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject');\n obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */\n\n this.assert.equal(obj.removeAt(1, 2), obj, 'return self');\n\n this.assert.deepEqual(this.toArray(obj), after, 'post item results');\n this.assert.equal((0, _metal.get)(obj, 'length'), after.length, 'length');\n\n this.assert.equal(observer.timesCalled('[]'), 1, 'should have notified [] once');\n this.assert.equal(observer.timesCalled('@each'), 0, 'should not have notified @each once');\n this.assert.equal(observer.timesCalled('length'), 1, 'should have notified length once');\n\n this.assert.equal(observer.validate('firstObject'), false, 'should NOT have notified firstObject once');\n this.assert.equal(observer.validate('lastObject'), false, 'should NOT have notified lastObject once');\n }\n }\n\n (0, _array.runArrayTests)('removeAt', RemoveAtTests, 'MutableArray', 'NativeArray', 'ArrayProxy');\n});","enifed('@ember/-internals/runtime/tests/mutable-array/removeObject-test', ['@ember/-internals/metal', 'internal-test-helpers', '@ember/-internals/runtime/tests/helpers/array'], function (_metal, _internalTestHelpers, _array) {\n 'use strict';\n\n class RemoveObjectTests extends _internalTestHelpers.AbstractTestCase {\n '@test should return receiver'() {\n let before = (0, _array.newFixture)(3);\n let obj = this.newObject(before);\n\n this.assert.equal(obj.removeObject(before[1]), obj, 'should return receiver');\n }\n\n '@test [A,B,C].removeObject(B) => [A,C] + notify'() {\n let before = (0, _array.newFixture)(3);\n let after = [before[0], before[2]];\n let obj = this.newObject(before);\n let observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject');\n\n obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */\n\n obj.removeObject(before[1]);\n\n this.assert.deepEqual(this.toArray(obj), after, 'post item results');\n this.assert.equal((0, _metal.get)(obj, 'length'), after.length, 'length');\n\n if (observer.isEnabled) {\n this.assert.equal(observer.timesCalled('[]'), 1, 'should have notified [] once');\n this.assert.equal(observer.timesCalled('@each'), 0, 'should not have notified @each once');\n this.assert.equal(observer.timesCalled('length'), 1, 'should have notified length once');\n\n this.assert.equal(observer.validate('firstObject'), false, 'should NOT have notified firstObject once');\n this.assert.equal(observer.validate('lastObject'), false, 'should NOT have notified lastObject once');\n }\n }\n\n '@test [A,B,C].removeObject(D) => [A,B,C]'() {\n let before = (0, _array.newFixture)(3);\n let after = before;\n let item = (0, _array.newFixture)(1)[0];\n let obj = this.newObject(before);\n let observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject');\n\n obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */\n\n obj.removeObject(item); // note: item not in set\n\n this.assert.deepEqual(this.toArray(obj), after, 'post item results');\n this.assert.equal((0, _metal.get)(obj, 'length'), after.length, 'length');\n\n if (observer.isEnabled) {\n this.assert.equal(observer.validate('[]'), false, 'should NOT have notified []');\n this.assert.equal(observer.validate('@each'), false, 'should NOT have notified @each');\n this.assert.equal(observer.validate('length'), false, 'should NOT have notified length');\n\n this.assert.equal(observer.validate('firstObject'), false, 'should NOT have notified firstObject once');\n this.assert.equal(observer.validate('lastObject'), false, 'should NOT have notified lastObject once');\n }\n }\n }\n\n (0, _array.runArrayTests)('removeObject', RemoveObjectTests, 'MutableArray', 'NativeArray', 'ArrayProxy');\n});","enifed('@ember/-internals/runtime/tests/mutable-array/removeObjects-test', ['@ember/-internals/metal', 'internal-test-helpers', '@ember/-internals/runtime/tests/helpers/array', '@ember/-internals/runtime/lib/mixins/array'], function (_metal, _internalTestHelpers, _array, _array2) {\n 'use strict';\n\n class RemoveObjectsTests extends _internalTestHelpers.AbstractTestCase {\n '@test should return receiver'() {\n let before = (0, _array2.A)((0, _array.newFixture)(3));\n let obj = before;\n\n this.assert.equal(obj.removeObjects(before[1]), obj, 'should return receiver');\n }\n\n '@test [A,B,C].removeObjects([B]) => [A,C] + notify'() {\n let before = (0, _array2.A)((0, _array.newFixture)(3));\n let after = [before[0], before[2]];\n let obj = before;\n let observer = this.newObserver(obj, '[]', 'length', 'firstObject', 'lastObject');\n\n obj.getProperties('firstObject', 'lastObject'); // Prime the cache\n\n obj.removeObjects([before[1]]);\n\n this.assert.deepEqual(this.toArray(obj), after, 'post item results');\n this.assert.equal((0, _metal.get)(obj, 'length'), after.length, 'length');\n\n if (observer.isEnabled) {\n this.assert.equal(observer.timesCalled('[]'), 1, 'should have notified [] once');\n this.assert.equal(observer.timesCalled('length'), 1, 'should have notified length once');\n\n this.assert.equal(observer.validate('firstObject'), false, 'should NOT have notified firstObject');\n this.assert.equal(observer.validate('lastObject'), false, 'should NOT have notified lastObject');\n }\n }\n\n '@test [{A},{B},{C}].removeObjects([{B}]) => [{A},{C}] + notify'() {\n let before = (0, _array2.A)((0, _array.newObjectsFixture)(3));\n let after = [before[0], before[2]];\n let obj = before;\n let observer = this.newObserver(obj, '[]', 'length', 'firstObject', 'lastObject');\n\n obj.getProperties('firstObject', 'lastObject'); // Prime the cache\n\n obj.removeObjects([before[1]]);\n\n this.assert.deepEqual(this.toArray(obj), after, 'post item results');\n this.assert.equal((0, _metal.get)(obj, 'length'), after.length, 'length');\n\n if (observer.isEnabled) {\n this.assert.equal(observer.timesCalled('[]'), 1, 'should have notified [] once');\n this.assert.equal(observer.timesCalled('length'), 1, 'should have notified length once');\n\n this.assert.equal(observer.validate('firstObject'), false, 'should NOT have notified firstObject');\n this.assert.equal(observer.validate('lastObject'), false, 'should NOT have notified lastObject');\n }\n }\n\n '@test [A,B,C].removeObjects([A,B]) => [C] + notify'() {\n let before = (0, _array2.A)((0, _array.newFixture)(3));\n let after = [before[2]];\n let obj = before;\n let observer = this.newObserver(obj, '[]', 'length', 'firstObject', 'lastObject');\n\n obj.getProperties('firstObject', 'lastObject'); // Prime the cache\n\n obj.removeObjects([before[0], before[1]]);\n\n this.assert.deepEqual(this.toArray(obj), after, 'post item results');\n this.assert.equal((0, _metal.get)(obj, 'length'), after.length, 'length');\n\n if (observer.isEnabled) {\n this.assert.equal(observer.timesCalled('[]'), 1, 'should have notified [] once');\n this.assert.equal(observer.timesCalled('length'), 1, 'should have notified length once');\n\n this.assert.equal(observer.timesCalled('firstObject'), 1, 'should have notified firstObject');\n this.assert.equal(observer.validate('lastObject'), false, 'should NOT have notified lastObject');\n }\n }\n\n '@test [{A},{B},{C}].removeObjects([{A},{B}]) => [{C}] + notify'() {\n let before = (0, _array2.A)((0, _array.newObjectsFixture)(3));\n let after = [before[2]];\n let obj = before;\n let observer = this.newObserver(obj, '[]', 'length', 'firstObject', 'lastObject');\n\n obj.getProperties('firstObject', 'lastObject'); // Prime the cache\n\n obj.removeObjects([before[0], before[1]]);\n\n this.assert.deepEqual(this.toArray(obj), after, 'post item results');\n this.assert.equal((0, _metal.get)(obj, 'length'), after.length, 'length');\n\n if (observer.isEnabled) {\n this.assert.equal(observer.timesCalled('[]'), 1, 'should have notified [] once');\n this.assert.equal(observer.timesCalled('length'), 1, 'should have notified length once');\n\n this.assert.equal(observer.timesCalled('firstObject'), 1, 'should have notified firstObject');\n this.assert.equal(observer.validate('lastObject'), false, 'should NOT have notified lastObject');\n }\n }\n\n '@test [A,B,C].removeObjects([A,B,C]) => [] + notify'() {\n let before = (0, _array2.A)((0, _array.newFixture)(3));\n let after = [];\n let obj = before;\n let observer = this.newObserver(obj, '[]', 'length', 'firstObject', 'lastObject');\n\n obj.getProperties('firstObject', 'lastObject'); // Prime the cache\n\n obj.removeObjects([before[0], before[1], before[2]]);\n\n this.assert.deepEqual(this.toArray(obj), after, 'post item results');\n this.assert.equal((0, _metal.get)(obj, 'length'), after.length, 'length');\n\n if (observer.isEnabled) {\n this.assert.equal(observer.timesCalled('[]'), 1, 'should have notified [] once');\n this.assert.equal(observer.timesCalled('length'), 1, 'should have notified length once');\n\n this.assert.equal(observer.timesCalled('firstObject'), 1, 'should have notified firstObject');\n this.assert.equal(observer.timesCalled('lastObject'), 1, 'should have notified lastObject');\n }\n }\n\n '@test [{A},{B},{C}].removeObjects([{A},{B},{C}]) => [] + notify'() {\n let before = (0, _array2.A)((0, _array.newObjectsFixture)(3));\n let after = [];\n let obj = before;\n let observer = this.newObserver(obj, '[]', 'length', 'firstObject', 'lastObject');\n\n obj.getProperties('firstObject', 'lastObject'); // Prime the cache\n\n obj.removeObjects(before);\n\n this.assert.deepEqual(this.toArray(obj), after, 'post item results');\n this.assert.equal((0, _metal.get)(obj, 'length'), after.length, 'length');\n\n if (observer.isEnabled) {\n this.assert.equal(observer.timesCalled('[]'), 1, 'should have notified [] once');\n this.assert.equal(observer.timesCalled('length'), 1, 'should have notified length once');\n\n this.assert.equal(observer.timesCalled('firstObject'), 1, 'should have notified firstObject');\n this.assert.equal(observer.validate('lastObject'), 1, 'should have notified lastObject');\n }\n }\n\n '@test [A,B,C].removeObjects([D]) => [A,B,C]'() {\n let before = (0, _array2.A)((0, _array.newFixture)(3));\n let after = before;\n let item = (0, _array.newFixture)(1)[0];\n let obj = before;\n let observer = this.newObserver(obj, '[]', 'length', 'firstObject', 'lastObject');\n\n obj.getProperties('firstObject', 'lastObject'); // Prime the cache\n\n obj.removeObjects([item]); // Note: item not in set\n\n this.assert.deepEqual(this.toArray(obj), after, 'post item results');\n this.assert.equal((0, _metal.get)(obj, 'length'), after.length, 'length');\n\n if (observer.isEnabled) {\n this.assert.equal(observer.validate('[]'), false, 'should NOT have notified []');\n this.assert.equal(observer.validate('length'), false, 'should NOT have notified length');\n\n this.assert.equal(observer.validate('firstObject'), false, 'should NOT have notified firstObject');\n this.assert.equal(observer.validate('lastObject'), false, 'should NOT have notified lastObject');\n }\n }\n }\n\n (0, _array.runArrayTests)('removeObjects', RemoveObjectsTests, 'MutableArray', 'NativeArray', 'ArrayProxy');\n});","enifed('@ember/-internals/runtime/tests/mutable-array/replace-test', ['internal-test-helpers', '@ember/-internals/runtime/tests/helpers/array'], function (_internalTestHelpers, _array) {\n 'use strict';\n\n class ReplaceTests extends _internalTestHelpers.AbstractTestCase {\n \"@test [].replace(0,0,'X') => ['X'] + notify\"() {\n let exp = (0, _array.newFixture)(1);\n let obj = this.newObject([]);\n let observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject');\n\n obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */\n\n obj.replace(0, 0, exp);\n\n this.assert.deepEqual(this.toArray(obj), exp, 'post item results');\n\n this.assert.equal(observer.timesCalled('[]'), 1, 'should have notified [] once');\n this.assert.equal(observer.timesCalled('@each'), 0, 'should not have notified @each once');\n this.assert.equal(observer.timesCalled('length'), 1, 'should have notified length once');\n this.assert.equal(observer.timesCalled('firstObject'), 1, 'should have notified firstObject once');\n this.assert.equal(observer.timesCalled('lastObject'), 1, 'should have notified lastObject once');\n }\n\n '@test [].replace(0,0,\"X\") => [\"X\"] + avoid calling objectAt and notifying fistObject/lastObject when not in cache'() {\n var obj, exp, observer;\n var called = 0;\n exp = (0, _array.newFixture)(1);\n obj = this.newObject([]);\n obj.objectAt = function () {\n called++;\n };\n observer = this.newObserver(obj, 'firstObject', 'lastObject');\n\n obj.replace(0, 0, exp);\n\n this.assert.equal(called, 0, 'should NOT have called objectAt upon replace when firstObject/lastObject are not cached');\n this.assert.equal(observer.validate('firstObject'), false, 'should NOT have notified firstObject since not cached');\n this.assert.equal(observer.validate('lastObject'), false, 'should NOT have notified lastObject since not cached');\n }\n\n '@test [A,B,C,D].replace(1,2,X) => [A,X,D] + notify'() {\n let before = (0, _array.newFixture)(4);\n let replace = (0, _array.newFixture)(1);\n let after = [before[0], replace[0], before[3]];\n\n let obj = this.newObject(before);\n let observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject');\n\n obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */\n\n obj.replace(1, 2, replace);\n\n this.assert.deepEqual(this.toArray(obj), after, 'post item results');\n\n this.assert.equal(observer.timesCalled('[]'), 1, 'should have notified [] once');\n this.assert.equal(observer.timesCalled('@each'), 0, 'should not have notified @each once');\n this.assert.equal(observer.timesCalled('length'), 1, 'should have notified length once');\n\n this.assert.equal(observer.validate('firstObject'), false, 'should NOT have notified firstObject once');\n this.assert.equal(observer.validate('lastObject'), false, 'should NOT have notified lastObject once');\n }\n\n '@test [A,B,C,D].replace(1,2,[X,Y]) => [A,X,Y,D] + notify'() {\n let before = (0, _array.newFixture)(4);\n let replace = (0, _array.newFixture)(2);\n let after = [before[0], replace[0], replace[1], before[3]];\n\n let obj = this.newObject(before);\n let observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject');\n\n obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */\n\n obj.replace(1, 2, replace);\n\n this.assert.deepEqual(this.toArray(obj), after, 'post item results');\n\n this.assert.equal(observer.timesCalled('[]'), 1, 'should have notified [] once');\n this.assert.equal(observer.timesCalled('@each'), 0, 'should not have notified @each once');\n this.assert.equal(observer.validate('length'), false, 'should NOT have notified length');\n\n this.assert.equal(observer.validate('firstObject'), false, 'should NOT have notified firstObject once');\n this.assert.equal(observer.validate('lastObject'), false, 'should NOT have notified lastObject once');\n }\n\n '@test [A,B].replace(1,0,[X,Y]) => [A,X,Y,B] + notify'() {\n let before = (0, _array.newFixture)(2);\n let replace = (0, _array.newFixture)(2);\n let after = [before[0], replace[0], replace[1], before[1]];\n\n let obj = this.newObject(before);\n let observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject');\n\n obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */\n\n obj.replace(1, 0, replace);\n\n this.assert.deepEqual(this.toArray(obj), after, 'post item results');\n\n this.assert.equal(observer.timesCalled('[]'), 1, 'should have notified [] once');\n this.assert.equal(observer.timesCalled('@each'), 0, 'should not have notified @each once');\n this.assert.equal(observer.timesCalled('length'), 1, 'should have notified length once');\n\n this.assert.equal(observer.validate('firstObject'), false, 'should NOT have notified firstObject once');\n this.assert.equal(observer.validate('lastObject'), false, 'should NOT have notified lastObject once');\n }\n\n '@test [A,B,C,D].replace(2,2) => [A,B] + notify'() {\n let before = (0, _array.newFixture)(4);\n let after = [before[0], before[1]];\n\n let obj = this.newObject(before);\n let observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject');\n\n obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */\n\n obj.replace(2, 2);\n\n this.assert.deepEqual(this.toArray(obj), after, 'post item results');\n\n this.assert.equal(observer.timesCalled('[]'), 1, 'should have notified [] once');\n this.assert.equal(observer.timesCalled('@each'), 0, 'should not have notified @each once');\n this.assert.equal(observer.timesCalled('length'), 1, 'should have notified length once');\n this.assert.equal(observer.timesCalled('lastObject'), 1, 'should have notified lastObject once');\n\n this.assert.equal(observer.validate('firstObject'), false, 'should NOT have notified firstObject once');\n }\n\n '@test [A,B,C,D].replace(-1,1) => [A,B,C] + notify'() {\n let before = (0, _array.newFixture)(4);\n let after = [before[0], before[1], before[2]];\n\n let obj = this.newObject(before);\n let observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject');\n\n obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */\n\n obj.replace(-1, 1);\n\n this.assert.deepEqual(this.toArray(obj), after, 'post item results');\n\n this.assert.equal(observer.timesCalled('[]'), 1, 'should have notified [] once');\n this.assert.equal(observer.timesCalled('@each'), 0, 'should not have notified @each once');\n this.assert.equal(observer.timesCalled('length'), 1, 'should have notified length once');\n this.assert.equal(observer.timesCalled('lastObject'), 1, 'should have notified lastObject once');\n\n this.assert.equal(observer.validate('firstObject'), false, 'should NOT have notified firstObject once');\n }\n\n '@test Adding object should notify array observer'() {\n let fixtures = (0, _array.newFixture)(4);\n let obj = this.newObject(fixtures);\n let observer = this.newObserver(obj).observeArray(obj);\n let item = (0, _array.newFixture)(1)[0];\n\n obj.replace(2, 2, [item]);\n\n this.assert.deepEqual(observer._before, [obj, 2, 2, 1], 'before');\n this.assert.deepEqual(observer._after, [obj, 2, 2, 1], 'after');\n }\n }\n\n (0, _array.runArrayTests)('replace', ReplaceTests, 'MutableArray', 'NativeArray', 'ArrayProxy');\n});","enifed('@ember/-internals/runtime/tests/mutable-array/reverseObjects-test', ['internal-test-helpers', '@ember/-internals/runtime/tests/helpers/array', '@ember/-internals/metal'], function (_internalTestHelpers, _array, _metal) {\n 'use strict';\n\n class ReverseObjectsTests extends _internalTestHelpers.AbstractTestCase {\n '@test [A,B,C].reverseObjects() => [] + notify'() {\n let before = (0, _array.newFixture)(3);\n let after = [before[2], before[1], before[0]];\n let obj = this.newObject(before);\n let observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject');\n\n obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */\n\n this.assert.equal(obj.reverseObjects(), obj, 'return self');\n\n this.assert.deepEqual(this.toArray(obj), after, 'post item results');\n this.assert.equal((0, _metal.get)(obj, 'length'), after.length, 'length');\n\n this.assert.equal(observer.timesCalled('[]'), 1, 'should have notified [] once');\n this.assert.equal(observer.timesCalled('@each'), 0, 'should not have notified @each once');\n this.assert.equal(observer.timesCalled('length'), 0, 'should have notified length once');\n this.assert.equal(observer.timesCalled('firstObject'), 1, 'should have notified firstObject once');\n this.assert.equal(observer.timesCalled('lastObject'), 1, 'should have notified lastObject once');\n }\n }\n\n (0, _array.runArrayTests)('reverseObjects', ReverseObjectsTests, 'MutableArray', 'NativeArray', 'ArrayProxy');\n});","enifed('@ember/-internals/runtime/tests/mutable-array/setObjects-test', ['internal-test-helpers', '@ember/-internals/runtime/tests/helpers/array', '@ember/-internals/metal'], function (_internalTestHelpers, _array, _metal) {\n 'use strict';\n\n class SetObjectsTests extends _internalTestHelpers.AbstractTestCase {\n '@test [A,B,C].setObjects([]) = > [] + notify'() {\n let before = (0, _array.newFixture)(3);\n let after = [];\n let obj = this.newObject(before);\n let observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject');\n\n obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */\n\n this.assert.equal(obj.setObjects(after), obj, 'return self');\n\n this.assert.deepEqual(this.toArray(obj), after, 'post item results');\n this.assert.equal((0, _metal.get)(obj, 'length'), after.length, 'length');\n\n this.assert.equal(observer.timesCalled('[]'), 1, 'should have notified [] once');\n this.assert.equal(observer.timesCalled('@each'), 0, 'should not have notified @each once');\n this.assert.equal(observer.timesCalled('length'), 1, 'should have notified length once');\n this.assert.equal(observer.timesCalled('firstObject'), 1, 'should have notified firstObject once');\n this.assert.equal(observer.timesCalled('lastObject'), 1, 'should have notified lastObject once');\n }\n\n '@test [A,B,C].setObjects([D, E, F, G]) = > [D, E, F, G] + notify'() {\n let before = (0, _array.newFixture)(3);\n let after = (0, _array.newFixture)(4);\n let obj = this.newObject(before);\n let observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject');\n\n obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */\n\n this.assert.equal(obj.setObjects(after), obj, 'return self');\n\n this.assert.deepEqual(this.toArray(obj), after, 'post item results');\n this.assert.equal((0, _metal.get)(obj, 'length'), after.length, 'length');\n\n this.assert.equal(observer.timesCalled('[]'), 1, 'should have notified [] once');\n this.assert.equal(observer.timesCalled('@each'), 0, 'should not have notified @each once');\n this.assert.equal(observer.timesCalled('length'), 1, 'should have notified length once');\n this.assert.equal(observer.timesCalled('firstObject'), 1, 'should have notified firstObject once');\n this.assert.equal(observer.timesCalled('lastObject'), 1, 'should have notified lastObject once');\n }\n }\n\n (0, _array.runArrayTests)('setObjects', SetObjectsTests, 'MutableArray', 'NativeArray', 'ArrayProxy');\n});","enifed('@ember/-internals/runtime/tests/mutable-array/shiftObject-test', ['internal-test-helpers', '@ember/-internals/runtime/tests/helpers/array', '@ember/-internals/metal'], function (_internalTestHelpers, _array, _metal) {\n 'use strict';\n\n class ShiftObjectTests extends _internalTestHelpers.AbstractTestCase {\n '@test [].shiftObject() => [] + returns undefined + NO notify'() {\n let before = [];\n let after = [];\n let obj = this.newObject(before);\n let observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject');\n\n obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */\n\n this.assert.equal(obj.shiftObject(), undefined);\n\n this.assert.deepEqual(this.toArray(obj), after, 'post item results');\n this.assert.equal((0, _metal.get)(obj, 'length'), after.length, 'length');\n\n this.assert.equal(observer.validate('[]', undefined, 1), false, 'should NOT have notified [] once');\n this.assert.equal(observer.validate('@each', undefined, 1), false, 'should NOT have notified @each once');\n this.assert.equal(observer.validate('length', undefined, 1), false, 'should NOT have notified length once');\n\n this.assert.equal(observer.validate('firstObject'), false, 'should NOT have notified firstObject once');\n this.assert.equal(observer.validate('lastObject'), false, 'should NOT have notified lastObject once');\n }\n\n '@test [X].shiftObject() => [] + notify'() {\n let before = (0, _array.newFixture)(1);\n let after = [];\n let obj = this.newObject(before);\n let observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject');\n\n obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */\n\n this.assert.equal(obj.shiftObject(), before[0], 'should return object');\n\n this.assert.deepEqual(this.toArray(obj), after, 'post item results');\n this.assert.equal((0, _metal.get)(obj, 'length'), after.length, 'length');\n\n this.assert.equal(observer.timesCalled('[]'), 1, 'should have notified [] once');\n this.assert.equal(observer.timesCalled('@each'), 0, 'should not have notified @each once');\n this.assert.equal(observer.timesCalled('length'), 1, 'should have notified length once');\n this.assert.equal(observer.timesCalled('firstObject'), 1, 'should have notified firstObject once');\n this.assert.equal(observer.timesCalled('lastObject'), 1, 'should have notified lastObject once');\n }\n\n '@test [A,B,C].shiftObject() => [B,C] + notify'() {\n let before = (0, _array.newFixture)(3);\n let after = [before[1], before[2]];\n let obj = this.newObject(before);\n let observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject');\n\n obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */\n\n this.assert.equal(obj.shiftObject(), before[0], 'should return object');\n\n this.assert.deepEqual(this.toArray(obj), after, 'post item results');\n this.assert.equal((0, _metal.get)(obj, 'length'), after.length, 'length');\n\n this.assert.equal(observer.timesCalled('[]'), 1, 'should have notified [] once');\n this.assert.equal(observer.timesCalled('@each'), 0, 'should not have notified @each once');\n this.assert.equal(observer.timesCalled('length'), 1, 'should have notified length once');\n this.assert.equal(observer.timesCalled('firstObject'), 1, 'should have notified firstObject once');\n\n this.assert.equal(observer.validate('lastObject'), false, 'should NOT have notified lastObject once');\n }\n }\n\n (0, _array.runArrayTests)('shiftObject', ShiftObjectTests, 'MutableArray', 'NativeArray', 'ArrayProxy');\n});","enifed('@ember/-internals/runtime/tests/mutable-array/unshiftObject-test', ['internal-test-helpers', '@ember/-internals/metal', '@ember/-internals/runtime/tests/helpers/array'], function (_internalTestHelpers, _metal, _array) {\n 'use strict';\n\n class UnshiftObjectTests extends _internalTestHelpers.AbstractTestCase {\n '@test returns unshifted object'() {\n let obj = this.newObject([]);\n let item = (0, _array.newFixture)(1)[0];\n\n this.assert.equal(obj.unshiftObject(item), item, 'should return unshifted object');\n }\n\n '@test [].unshiftObject(X) => [X] + notify'() {\n let before = [];\n let item = (0, _array.newFixture)(1)[0];\n let after = [item];\n let obj = this.newObject(before);\n let observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject');\n\n obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */\n\n obj.unshiftObject(item);\n\n this.assert.deepEqual(this.toArray(obj), after, 'post item results');\n this.assert.equal((0, _metal.get)(obj, 'length'), after.length, 'length');\n\n this.assert.equal(observer.timesCalled('[]'), 1, 'should have notified [] once');\n this.assert.equal(observer.timesCalled('@each'), 0, 'should not have notified @each once');\n this.assert.equal(observer.timesCalled('length'), 1, 'should have notified length once');\n this.assert.equal(observer.timesCalled('firstObject'), 1, 'should have notified firstObject once');\n this.assert.equal(observer.timesCalled('lastObject'), 1, 'should have notified lastObject once');\n }\n\n '@test [A,B,C].unshiftObject(X) => [X,A,B,C] + notify'() {\n let before = (0, _array.newFixture)(3);\n let item = (0, _array.newFixture)(1)[0];\n let after = [item, before[0], before[1], before[2]];\n let obj = this.newObject(before);\n let observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject');\n\n obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */\n\n obj.unshiftObject(item);\n\n this.assert.deepEqual(this.toArray(obj), after, 'post item results');\n this.assert.equal((0, _metal.get)(obj, 'length'), after.length, 'length');\n\n this.assert.equal(observer.timesCalled('[]'), 1, 'should have notified [] once');\n this.assert.equal(observer.timesCalled('@each'), 0, 'should not have notified @each once');\n this.assert.equal(observer.timesCalled('length'), 1, 'should have notified length once');\n this.assert.equal(observer.timesCalled('firstObject'), 1, 'should have notified firstObject once');\n\n this.assert.equal(observer.validate('lastObject'), false, 'should NOT have notified lastObject');\n }\n\n '@test [A,B,C].unshiftObject(A) => [A,A,B,C] + notify'() {\n let before = (0, _array.newFixture)(3);\n let item = before[0]; // note same object as current head. should end up twice\n let after = [item, before[0], before[1], before[2]];\n let obj = this.newObject(before);\n let observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject');\n\n obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */\n\n obj.unshiftObject(item);\n\n this.assert.deepEqual(this.toArray(obj), after, 'post item results');\n this.assert.equal((0, _metal.get)(obj, 'length'), after.length, 'length');\n\n this.assert.equal(observer.timesCalled('[]'), 1, 'should have notified [] once');\n this.assert.equal(observer.timesCalled('@each'), 0, 'should not have notified @each once');\n this.assert.equal(observer.timesCalled('length'), 1, 'should have notified length once');\n\n this.assert.equal(observer.validate('firstObject'), true, 'should have notified firstObject');\n this.assert.equal(observer.validate('lastObject'), false, 'should NOT have notified lastObject');\n }\n }\n\n (0, _array.runArrayTests)('unshiftObject', UnshiftObjectTests, 'MutableArray', 'NativeArray', 'ArrayProxy');\n});","enifed('@ember/-internals/runtime/tests/mutable-array/unshiftObjects-test', ['internal-test-helpers', '@ember/-internals/metal', '@ember/-internals/runtime/tests/helpers/array'], function (_internalTestHelpers, _metal, _array) {\n 'use strict';\n\n class UnshiftObjectsTests extends _internalTestHelpers.AbstractTestCase {\n '@test returns receiver'() {\n let obj = this.newObject([]);\n let items = (0, _array.newFixture)(3);\n\n this.assert.equal(obj.unshiftObjects(items), obj, 'should return receiver');\n }\n\n '@test [].unshiftObjects([A,B,C]) => [A,B,C] + notify'() {\n let before = [];\n let items = (0, _array.newFixture)(3);\n let obj = this.newObject(before);\n let observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject');\n\n obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */\n\n obj.unshiftObjects(items);\n\n this.assert.deepEqual(this.toArray(obj), items, 'post item results');\n this.assert.equal((0, _metal.get)(obj, 'length'), items.length, 'length');\n\n this.assert.equal(observer.timesCalled('[]'), 1, 'should have notified [] once');\n this.assert.equal(observer.timesCalled('@each'), 0, 'should not have notified @each once');\n this.assert.equal(observer.timesCalled('length'), 1, 'should have notified length once');\n this.assert.equal(observer.timesCalled('firstObject'), 1, 'should have notified firstObject once');\n this.assert.equal(observer.timesCalled('lastObject'), 1, 'should have notified lastObject once');\n }\n\n '@test [A,B,C].unshiftObjects([X,Y]) => [X,Y,A,B,C] + notify'() {\n let before = (0, _array.newFixture)(3);\n let items = (0, _array.newFixture)(2);\n let after = items.concat(before);\n let obj = this.newObject(before);\n let observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject');\n\n obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */\n\n obj.unshiftObjects(items);\n\n this.assert.deepEqual(this.toArray(obj), after, 'post item results');\n this.assert.equal((0, _metal.get)(obj, 'length'), after.length, 'length');\n\n this.assert.equal(observer.timesCalled('[]'), 1, 'should have notified [] once');\n this.assert.equal(observer.timesCalled('@each'), 0, 'should not have notified @each once');\n this.assert.equal(observer.timesCalled('length'), 1, 'should have notified length once');\n this.assert.equal(observer.timesCalled('firstObject'), 1, 'should have notified firstObject once');\n\n this.assert.equal(observer.validate('lastObject'), false, 'should NOT have notified lastObject');\n }\n\n '@test [A,B,C].unshiftObjects([A,B]) => [A,B,A,B,C] + notify'() {\n let before = (0, _array.newFixture)(3);\n let items = [before[0], before[1]]; // note same object as current head. should end up twice\n let after = items.concat(before);\n let obj = this.newObject(before);\n let observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject');\n\n obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */\n\n obj.unshiftObjects(items);\n\n this.assert.deepEqual(this.toArray(obj), after, 'post item results');\n this.assert.equal((0, _metal.get)(obj, 'length'), after.length, 'length');\n\n this.assert.equal(observer.timesCalled('[]'), 1, 'should have notified [] once');\n this.assert.equal(observer.timesCalled('@each'), 0, 'should not have notified @each once');\n this.assert.equal(observer.timesCalled('length'), 1, 'should have notified length once');\n\n this.assert.equal(observer.validate('firstObject'), true, 'should NOT have notified firstObject');\n this.assert.equal(observer.validate('lastObject'), false, 'should NOT have notified lastObject');\n }\n }\n\n (0, _array.runArrayTests)('unshiftObjects', UnshiftObjectsTests, 'MutableArray', 'NativeArray', 'ArrayProxy');\n});","enifed('@ember/-internals/runtime/tests/system/array_proxy/arranged_content_test', ['@ember/runloop', '@ember/-internals/metal', '@ember/-internals/runtime/lib/system/array_proxy', '@ember/-internals/runtime/lib/mixins/array', 'internal-test-helpers'], function (_runloop, _metal, _array_proxy, _array, _internalTestHelpers) {\n 'use strict';\n\n let array;\n\n (0, _internalTestHelpers.moduleFor)('ArrayProxy - arrangedContent', class extends _internalTestHelpers.AbstractTestCase {\n beforeEach() {\n (0, _runloop.run)(() => {\n array = _array_proxy.default.extend({\n arrangedContent: (0, _metal.computed)('content.[]', function () {\n let content = this.get('content');\n return content && (0, _array.A)(content.slice().sort((a, b) => {\n if (a == null) {\n a = -1;\n }\n if (b == null) {\n b = -1;\n }\n return b - a;\n }));\n })\n }).create({\n content: (0, _array.A)([1, 2, 4, 5])\n });\n });\n }\n\n afterEach() {\n (0, _runloop.run)(() => array.destroy());\n }\n\n ['@test compact - returns arrangedContent without nulls and undefined'](assert) {\n (0, _runloop.run)(() => array.set('content', (0, _array.A)([1, 3, null, 2, undefined])));\n\n assert.deepEqual(array.compact(), [3, 2, 1]);\n }\n\n ['@test indexOf - returns index of object in arrangedContent'](assert) {\n assert.equal(array.indexOf(4), 1, 'returns arranged index');\n }\n\n ['@test lastIndexOf - returns last index of object in arrangedContent'](assert) {\n array.get('content').pushObject(4);\n assert.equal(array.lastIndexOf(4), 2, 'returns last arranged index');\n }\n\n ['@test objectAt - returns object at index in arrangedContent'](assert) {\n assert.equal((0, _metal.objectAt)(array, 1), 4, 'returns object at index');\n }\n\n // Not sure if we need a specific test for it, since it's internal\n ['@test objectAtContent - returns object at index in arrangedContent'](assert) {\n assert.equal(array.objectAtContent(1), 4, 'returns object at index');\n }\n\n ['@test objectsAt - returns objects at indices in arrangedContent'](assert) {\n assert.deepEqual(array.objectsAt([0, 2, 4]), [5, 2, undefined], 'returns objects at indices');\n }\n\n ['@test replace - mutating an arranged ArrayProxy is not allowed']() {\n expectAssertion(() => {\n array.replace(0, 0, [3]);\n }, /Mutating an arranged ArrayProxy is not allowed/);\n }\n\n ['@test replaceContent - does a standard array replace on content'](assert) {\n (0, _runloop.run)(() => array.replaceContent(1, 2, [3]));\n assert.deepEqual(array.get('content'), [1, 3, 5]);\n }\n\n ['@test slice - returns a slice of the arrangedContent'](assert) {\n assert.deepEqual(array.slice(1, 3), [4, 2], 'returns sliced arrangedContent');\n }\n\n ['@test toArray - returns copy of arrangedContent'](assert) {\n assert.deepEqual(array.toArray(), [5, 4, 2, 1]);\n }\n\n ['@test without - returns arrangedContent without object'](assert) {\n assert.deepEqual(array.without(2), [5, 4, 1], 'returns arranged without object');\n }\n\n ['@test lastObject - returns last arranged object'](assert) {\n assert.equal(array.get('lastObject'), 1, 'returns last arranged object');\n }\n\n ['@test firstObject - returns first arranged object'](assert) {\n assert.equal(array.get('firstObject'), 5, 'returns first arranged object');\n }\n });\n\n (0, _internalTestHelpers.moduleFor)('ArrayProxy - arrangedContent matching content', class extends _internalTestHelpers.AbstractTestCase {\n beforeEach() {\n (0, _runloop.run)(function () {\n array = _array_proxy.default.create({\n content: (0, _array.A)([1, 2, 4, 5])\n });\n });\n }\n\n afterEach() {\n (0, _runloop.run)(function () {\n array.destroy();\n });\n }\n\n ['@test insertAt - inserts object at specified index'](assert) {\n (0, _runloop.run)(function () {\n array.insertAt(2, 3);\n });\n assert.deepEqual(array.get('content'), [1, 2, 3, 4, 5]);\n }\n\n ['@test replace - does a standard array replace'](assert) {\n (0, _runloop.run)(function () {\n array.replace(1, 2, [3]);\n });\n assert.deepEqual(array.get('content'), [1, 3, 5]);\n }\n\n ['@test reverseObjects - reverses content'](assert) {\n (0, _runloop.run)(function () {\n array.reverseObjects();\n });\n assert.deepEqual(array.get('content'), [5, 4, 2, 1]);\n }\n });\n\n (0, _internalTestHelpers.moduleFor)('ArrayProxy - arrangedContent with transforms', class extends _internalTestHelpers.AbstractTestCase {\n beforeEach() {\n (0, _runloop.run)(function () {\n array = _array_proxy.default.extend({\n arrangedContent: (0, _metal.computed)(function () {\n let content = this.get('content');\n return content && (0, _array.A)(content.slice().sort(function (a, b) {\n if (a == null) {\n a = -1;\n }\n if (b == null) {\n b = -1;\n }\n return b - a;\n }));\n }).property('content.[]'),\n\n objectAtContent(idx) {\n let obj = (0, _metal.objectAt)(this.get('arrangedContent'), idx);\n return obj && obj.toString();\n }\n }).create({\n content: (0, _array.A)([1, 2, 4, 5])\n });\n });\n }\n\n afterEach() {\n (0, _runloop.run)(function () {\n array.destroy();\n });\n }\n\n ['@test indexOf - returns index of object in arrangedContent'](assert) {\n assert.equal(array.indexOf('4'), 1, 'returns arranged index');\n }\n\n ['@test lastIndexOf - returns last index of object in arrangedContent'](assert) {\n array.get('content').pushObject(4);\n assert.equal(array.lastIndexOf('4'), 2, 'returns last arranged index');\n }\n\n ['@test objectAt - returns object at index in arrangedContent'](assert) {\n assert.equal((0, _metal.objectAt)(array, 1), '4', 'returns object at index');\n }\n\n // Not sure if we need a specific test for it, since it's internal\n ['@test objectAtContent - returns object at index in arrangedContent'](assert) {\n assert.equal(array.objectAtContent(1), '4', 'returns object at index');\n }\n\n ['@test objectsAt - returns objects at indices in arrangedContent'](assert) {\n assert.deepEqual(array.objectsAt([0, 2, 4]), ['5', '2', undefined], 'returns objects at indices');\n }\n\n ['@test slice - returns a slice of the arrangedContent'](assert) {\n assert.deepEqual(array.slice(1, 3), ['4', '2'], 'returns sliced arrangedContent');\n }\n\n ['@test toArray - returns copy of arrangedContent'](assert) {\n assert.deepEqual(array.toArray(), ['5', '4', '2', '1']);\n }\n\n ['@test without - returns arrangedContent without object'](assert) {\n assert.deepEqual(array.without('2'), ['5', '4', '1'], 'returns arranged without object');\n }\n\n ['@test lastObject - returns last arranged object'](assert) {\n assert.equal(array.get('lastObject'), '1', 'returns last arranged object');\n }\n\n ['@test firstObject - returns first arranged object'](assert) {\n assert.equal(array.get('firstObject'), '5', 'returns first arranged object');\n }\n });\n\n (0, _internalTestHelpers.moduleFor)('ArrayProxy - with transforms', class extends _internalTestHelpers.AbstractTestCase {\n beforeEach() {\n (0, _runloop.run)(function () {\n array = _array_proxy.default.extend({\n objectAtContent(idx) {\n let obj = (0, _metal.objectAt)(this.get('arrangedContent'), idx);\n return obj && obj.toString();\n }\n }).create({\n content: (0, _array.A)([1, 2, 4, 5])\n });\n });\n }\n\n afterEach() {\n (0, _runloop.run)(function () {\n array.destroy();\n });\n }\n\n ['@test popObject - removes last object in arrangedContent'](assert) {\n let popped = array.popObject();\n assert.equal(popped, '5', 'returns last object');\n assert.deepEqual(array.toArray(), ['1', '2', '4'], 'removes from content');\n }\n\n ['@test removeObject - removes object from content'](assert) {\n array.removeObject('2');\n assert.deepEqual(array.toArray(), ['1', '4', '5']);\n }\n\n ['@test removeObjects - removes objects from content'](assert) {\n array.removeObjects(['2', '4', '6']);\n assert.deepEqual(array.toArray(), ['1', '5']);\n }\n\n ['@test shiftObject - removes from start of arrangedContent'](assert) {\n let shifted = array.shiftObject();\n assert.equal(shifted, '1', 'returns first object');\n assert.deepEqual(array.toArray(), ['2', '4', '5'], 'removes object from content');\n }\n });\n});","enifed('@ember/-internals/runtime/tests/system/array_proxy/array_observer_test', ['@ember/-internals/metal', '@ember/-internals/runtime/lib/system/array_proxy', '@ember/-internals/runtime/lib/mixins/array', 'internal-test-helpers'], function (_metal, _array_proxy, _array, _internalTestHelpers) {\n 'use strict';\n\n (0, _internalTestHelpers.moduleFor)('ArrayProxy - array observers', class extends _internalTestHelpers.AbstractTestCase {\n ['@test mutating content'](assert) {\n assert.expect(4);\n\n let content = (0, _array.A)(['x', 'y', 'z']);\n let proxy = _array_proxy.default.create({ content });\n\n proxy.addArrayObserver({\n arrayWillChange(proxy, startIndex, removeCount, addCount) {\n assert.deepEqual([startIndex, removeCount, addCount], [1, 1, 3]);\n assert.deepEqual(proxy.toArray(), ['x', 'y', 'z']);\n },\n arrayDidChange(proxy, startIndex, removeCount, addCount) {\n assert.deepEqual([startIndex, removeCount, addCount], [1, 1, 3]);\n assert.deepEqual(proxy.toArray(), ['x', 'a', 'b', 'c', 'z']);\n }\n });\n\n proxy.toArray();\n content.replace(1, 1, ['a', 'b', 'c']);\n }\n\n ['@test assigning content'](assert) {\n assert.expect(4);\n\n let content = (0, _array.A)(['x', 'y', 'z']);\n let proxy = _array_proxy.default.create({ content });\n\n proxy.addArrayObserver({\n arrayWillChange(proxy, startIndex, removeCount, addCount) {\n assert.deepEqual([startIndex, removeCount, addCount], [0, 3, 5]);\n assert.deepEqual(proxy.toArray(), ['x', 'y', 'z']);\n },\n arrayDidChange(proxy, startIndex, removeCount, addCount) {\n assert.deepEqual([startIndex, removeCount, addCount], [0, 3, 5]);\n assert.deepEqual(proxy.toArray(), ['a', 'b', 'c', 'd', 'e']);\n }\n });\n\n proxy.toArray();\n (0, _metal.set)(proxy, 'content', (0, _array.A)(['a', 'b', 'c', 'd', 'e']));\n }\n });\n});","enifed('@ember/-internals/runtime/tests/system/array_proxy/content_change_test', ['@ember/runloop', '@ember/-internals/metal', '@ember/-internals/runtime/lib/system/array_proxy', '@ember/-internals/runtime/lib/mixins/array', 'internal-test-helpers'], function (_runloop, _metal, _array_proxy, _array, _internalTestHelpers) {\n 'use strict';\n\n (0, _internalTestHelpers.moduleFor)('ArrayProxy - content change', class extends _internalTestHelpers.AbstractTestCase {\n [\"@test The ArrayProxy doesn't explode when assigned a destroyed object\"](assert) {\n let proxy1 = _array_proxy.default.create();\n let proxy2 = _array_proxy.default.create();\n\n (0, _runloop.run)(() => proxy1.destroy());\n\n (0, _metal.set)(proxy2, 'content', proxy1);\n\n assert.ok(true, 'No exception was raised');\n }\n\n ['@test should update if content changes while change events are deferred'](assert) {\n let proxy = _array_proxy.default.create();\n\n assert.deepEqual(proxy.toArray(), []);\n\n (0, _metal.changeProperties)(() => {\n proxy.set('content', (0, _array.A)([1, 2, 3]));\n assert.deepEqual(proxy.toArray(), [1, 2, 3]);\n });\n }\n\n ['@test objectAt recomputes the object cache correctly'](assert) {\n let indexes = [];\n\n let proxy = _array_proxy.default.extend({\n objectAtContent(index) {\n indexes.push(index);\n return this.content[index];\n }\n }).create({\n content: (0, _array.A)([1, 2, 3, 4, 5])\n });\n\n assert.deepEqual(indexes, []);\n assert.deepEqual(proxy.objectAt(0), 1);\n assert.deepEqual(indexes, [0, 1, 2, 3, 4]);\n\n indexes.length = 0;\n proxy.set('content', (0, _array.A)([1, 2, 3]));\n assert.deepEqual(proxy.objectAt(0), 1);\n assert.deepEqual(indexes, [0, 1, 2]);\n\n indexes.length = 0;\n proxy.content.replace(2, 0, [4, 5]);\n assert.deepEqual(proxy.objectAt(0), 1);\n assert.deepEqual(proxy.objectAt(1), 2);\n assert.deepEqual(indexes, []);\n assert.deepEqual(proxy.objectAt(2), 4);\n assert.deepEqual(indexes, [2, 3, 4]);\n }\n\n ['@test negative indexes are handled correctly'](assert) {\n let indexes = [];\n\n let proxy = _array_proxy.default.extend({\n objectAtContent(index) {\n indexes.push(index);\n return this.content[index];\n }\n }).create({\n content: (0, _array.A)([1, 2, 3, 4, 5])\n });\n\n assert.deepEqual(proxy.toArray(), [1, 2, 3, 4, 5]);\n\n indexes.length = 0;\n\n proxy.content.replace(-1, 0, [7]);\n proxy.content.replace(-2, 0, [6]);\n\n assert.deepEqual(proxy.toArray(), [1, 2, 3, 4, 6, 7, 5]);\n assert.deepEqual(indexes, [4, 5, 6]);\n }\n });\n});","enifed('@ember/-internals/runtime/tests/system/array_proxy/length_test', ['@ember/-internals/runtime/lib/system/array_proxy', '@ember/-internals/runtime/lib/system/object', '@ember/-internals/metal', '@ember/object/computed', '@ember/-internals/runtime/lib/mixins/array', 'internal-test-helpers'], function (_array_proxy, _object, _metal, _computed, _array, _internalTestHelpers) {\n 'use strict';\n\n (0, _internalTestHelpers.moduleFor)('Ember.ArrayProxy - content change (length)', class extends _internalTestHelpers.AbstractTestCase {\n ['@test should update length for null content'](assert) {\n let proxy = _array_proxy.default.create({\n content: (0, _array.A)([1, 2, 3])\n });\n\n assert.equal(proxy.get('length'), 3, 'precond - length is 3');\n\n proxy.set('content', null);\n\n assert.equal(proxy.get('length'), 0, 'length updates');\n }\n\n ['@test should update length for null content when there is a computed property watching length'](assert) {\n let proxy = _array_proxy.default.extend({\n isEmpty: (0, _computed.not)('length')\n }).create({\n content: (0, _array.A)([1, 2, 3])\n });\n\n assert.equal(proxy.get('length'), 3, 'precond - length is 3');\n\n // Consume computed property that depends on length\n proxy.get('isEmpty');\n\n // update content\n proxy.set('content', null);\n\n assert.equal(proxy.get('length'), 0, 'length updates');\n }\n\n ['@test getting length does not recompute the object cache'](assert) {\n let indexes = [];\n\n let proxy = _array_proxy.default.extend({\n objectAtContent(index) {\n indexes.push(index);\n return this.content[index];\n }\n }).create({\n content: (0, _array.A)([1, 2, 3, 4, 5])\n });\n\n assert.equal((0, _metal.get)(proxy, 'length'), 5);\n assert.deepEqual(indexes, []);\n\n indexes.length = 0;\n proxy.set('content', (0, _array.A)([6, 7, 8]));\n assert.equal((0, _metal.get)(proxy, 'length'), 3);\n assert.deepEqual(indexes, []);\n\n indexes.length = 0;\n proxy.content.replace(1, 0, [1, 2, 3]);\n assert.equal((0, _metal.get)(proxy, 'length'), 6);\n assert.deepEqual(indexes, []);\n }\n\n '@test accessing length after content set to null'(assert) {\n let obj = _array_proxy.default.create({ content: ['foo', 'bar'] });\n\n assert.equal(obj.length, 2, 'precond');\n\n (0, _metal.set)(obj, 'content', null);\n\n assert.equal(obj.length, 0, 'length is 0 without content');\n assert.deepEqual(obj.content, null, 'content was updated');\n }\n\n '@test accessing length after content set to null in willDestroy'(assert) {\n let obj = _array_proxy.default.extend({\n willDestroy() {\n this.set('content', null);\n this._super(...arguments);\n }\n }).create({\n content: ['foo', 'bar']\n });\n\n assert.equal(obj.length, 2, 'precond');\n\n this.runTask(() => obj.destroy());\n\n assert.equal(obj.length, 0, 'length is 0 without content');\n assert.deepEqual(obj.content, null, 'content was updated');\n }\n\n '@test setting length to 0'(assert) {\n let obj = _array_proxy.default.create({ content: ['foo', 'bar'] });\n\n assert.equal(obj.length, 2, 'precond');\n\n (0, _metal.set)(obj, 'length', 0);\n\n assert.equal(obj.length, 0, 'length was updated');\n assert.deepEqual(obj.content, [], 'content length was truncated');\n }\n\n '@test setting length to smaller value'(assert) {\n let obj = _array_proxy.default.create({ content: ['foo', 'bar'] });\n\n assert.equal(obj.length, 2, 'precond');\n\n (0, _metal.set)(obj, 'length', 1);\n\n assert.equal(obj.length, 1, 'length was updated');\n assert.deepEqual(obj.content, ['foo'], 'content length was truncated');\n }\n\n '@test setting length to larger value'(assert) {\n let obj = _array_proxy.default.create({ content: ['foo', 'bar'] });\n\n assert.equal(obj.length, 2, 'precond');\n\n (0, _metal.set)(obj, 'length', 3);\n\n assert.equal(obj.length, 3, 'length was updated');\n assert.deepEqual(obj.content, ['foo', 'bar', undefined], 'content length was updated');\n }\n\n '@test setting length after content set to null'(assert) {\n let obj = _array_proxy.default.create({ content: ['foo', 'bar'] });\n\n assert.equal(obj.length, 2, 'precond');\n\n (0, _metal.set)(obj, 'content', null);\n assert.equal(obj.length, 0, 'length was updated');\n\n (0, _metal.set)(obj, 'length', 0);\n assert.equal(obj.length, 0, 'length is still updated');\n }\n\n '@test setting length to greater than zero'(assert) {\n let obj = _array_proxy.default.create({ content: ['foo', 'bar'] });\n\n assert.equal(obj.length, 2, 'precond');\n\n (0, _metal.set)(obj, 'length', 1);\n\n assert.equal(obj.length, 1, 'length was updated');\n assert.deepEqual(obj.content, ['foo'], 'content length was truncated');\n }\n\n ['@test array proxy + aliasedProperty complex test'](assert) {\n let aCalled, bCalled, cCalled, dCalled, eCalled;\n\n aCalled = bCalled = cCalled = dCalled = eCalled = 0;\n\n let obj = _object.default.extend({\n colors: (0, _computed.oneWay)('model'),\n length: (0, _computed.oneWay)('colors.length'),\n\n a: (0, _metal.observer)('length', () => aCalled++),\n b: (0, _metal.observer)('colors.length', () => bCalled++),\n c: (0, _metal.observer)('colors.content.length', () => cCalled++),\n d: (0, _metal.observer)('colors.[]', () => dCalled++),\n e: (0, _metal.observer)('colors.content.[]', () => eCalled++)\n }).create();\n\n obj.set('model', _array_proxy.default.create({\n content: (0, _array.A)(['red', 'yellow', 'blue'])\n }));\n\n assert.equal(obj.get('colors.content.length'), 3);\n assert.equal(obj.get('colors.length'), 3);\n assert.equal(obj.get('length'), 3);\n\n assert.equal(aCalled, 1, 'expected observer `length` to be called ONCE');\n assert.equal(bCalled, 1, 'expected observer `colors.length` to be called ONCE');\n assert.equal(cCalled, 1, 'expected observer `colors.content.length` to be called ONCE');\n assert.equal(dCalled, 1, 'expected observer `colors.[]` to be called ONCE');\n assert.equal(eCalled, 1, 'expected observer `colors.content.[]` to be called ONCE');\n\n obj.get('colors').pushObjects(['green', 'red']);\n\n assert.equal(obj.get('colors.content.length'), 5);\n assert.equal(obj.get('colors.length'), 5);\n assert.equal(obj.get('length'), 5);\n\n assert.equal(aCalled, 2, 'expected observer `length` to be called TWICE');\n assert.equal(bCalled, 2, 'expected observer `colors.length` to be called TWICE');\n assert.equal(cCalled, 2, 'expected observer `colors.content.length` to be called TWICE');\n assert.equal(dCalled, 2, 'expected observer `colors.[]` to be called TWICE');\n assert.equal(eCalled, 2, 'expected observer `colors.content.[]` to be called TWICE');\n }\n });\n});","enifed('@ember/-internals/runtime/tests/system/array_proxy/watching_and_listening_test', ['@ember/-internals/meta', '@ember/-internals/metal', '@ember/-internals/runtime/lib/system/array_proxy', '@ember/-internals/runtime/lib/mixins/array', 'internal-test-helpers'], function (_meta, _metal, _array_proxy, _array, _internalTestHelpers) {\n 'use strict';\n\n function sortedListenersFor(obj, eventName) {\n let listeners = (0, _meta.peekMeta)(obj).matchingListeners(eventName) || [];\n\n let keys = [];\n for (let i = 0; i < listeners.length; i += 3) {\n keys.push(listeners[i + 1]);\n }\n return keys.sort();\n }\n\n (0, _internalTestHelpers.moduleFor)('ArrayProxy - watching and listening', class extends _internalTestHelpers.AbstractTestCase {\n [`@test setting 'content' adds listeners correctly`](assert) {\n let content = (0, _array.A)();\n let proxy = _array_proxy.default.create();\n\n assert.deepEqual(sortedListenersFor(content, '@array:before'), []);\n assert.deepEqual(sortedListenersFor(content, '@array:change'), []);\n\n proxy.set('content', content);\n\n assert.deepEqual(sortedListenersFor(content, '@array:before'), ['_arrangedContentArrayWillChange']);\n assert.deepEqual(sortedListenersFor(content, '@array:change'), ['_arrangedContentArrayDidChange']);\n }\n\n [`@test changing 'content' adds and removes listeners correctly`](assert) {\n let content1 = (0, _array.A)();\n let content2 = (0, _array.A)();\n let proxy = _array_proxy.default.create({ content: content1 });\n\n assert.deepEqual(sortedListenersFor(content1, '@array:before'), ['_arrangedContentArrayWillChange']);\n assert.deepEqual(sortedListenersFor(content1, '@array:change'), ['_arrangedContentArrayDidChange']);\n\n proxy.set('content', content2);\n\n assert.deepEqual(sortedListenersFor(content1, '@array:before'), []);\n assert.deepEqual(sortedListenersFor(content1, '@array:change'), []);\n assert.deepEqual(sortedListenersFor(content2, '@array:before'), ['_arrangedContentArrayWillChange']);\n assert.deepEqual(sortedListenersFor(content2, '@array:change'), ['_arrangedContentArrayDidChange']);\n }\n\n [`@test regression test for https://github.com/emberjs/ember.js/issues/12475`](assert) {\n let item1a = { id: 1 };\n let item1b = { id: 2 };\n let item1c = { id: 3 };\n let content1 = (0, _array.A)([item1a, item1b, item1c]);\n\n let proxy = _array_proxy.default.create({ content: content1 });\n let obj = { proxy };\n\n (0, _metal.defineProperty)(obj, 'ids', (0, _metal.computed)('proxy.@each.id', function () {\n return (0, _metal.get)(this, 'proxy').mapBy('id');\n }));\n\n // These manually added observers are to simulate the observers added by the\n // rendering process in a template like:\n //\n // {{#each items as |item|}}\n // {{item.id}}\n // {{/each}}\n (0, _metal.addObserver)(item1a, 'id', function () {});\n (0, _metal.addObserver)(item1b, 'id', function () {});\n (0, _metal.addObserver)(item1c, 'id', function () {});\n\n // The EachProxy has not yet been consumed. Only the manually added\n // observers are watching.\n assert.equal((0, _metal.watcherCount)(item1a, 'id'), 1);\n assert.equal((0, _metal.watcherCount)(item1b, 'id'), 1);\n assert.equal((0, _metal.watcherCount)(item1c, 'id'), 1);\n\n // Consume the each proxy. This causes the EachProxy to add two observers\n // per item: one for \"before\" events and one for \"after\" events.\n assert.deepEqual((0, _metal.get)(obj, 'ids'), [1, 2, 3]);\n\n // For each item, the two each proxy observers and one manual added observer\n // are watching.\n assert.equal((0, _metal.watcherCount)(item1a, 'id'), 2);\n assert.equal((0, _metal.watcherCount)(item1b, 'id'), 2);\n assert.equal((0, _metal.watcherCount)(item1c, 'id'), 2);\n\n // This should be a no-op because observers do not fire if the value\n // 1. is an object and 2. is the same as the old value.\n proxy.set('content', content1);\n\n assert.equal((0, _metal.watcherCount)(item1a, 'id'), 2);\n assert.equal((0, _metal.watcherCount)(item1b, 'id'), 2);\n assert.equal((0, _metal.watcherCount)(item1c, 'id'), 2);\n\n // This is repeated to catch the regression. It should still be a no-op.\n proxy.set('content', content1);\n\n assert.equal((0, _metal.watcherCount)(item1a, 'id'), 2);\n assert.equal((0, _metal.watcherCount)(item1b, 'id'), 2);\n assert.equal((0, _metal.watcherCount)(item1c, 'id'), 2);\n\n // Set the content to a new array with completely different items and\n // repeat the process.\n let item2a = { id: 4 };\n let item2b = { id: 5 };\n let item2c = { id: 6 };\n let content2 = (0, _array.A)([item2a, item2b, item2c]);\n\n (0, _metal.addObserver)(item2a, 'id', function () {});\n (0, _metal.addObserver)(item2b, 'id', function () {});\n (0, _metal.addObserver)(item2c, 'id', function () {});\n\n proxy.set('content', content2);\n\n assert.deepEqual((0, _metal.get)(obj, 'ids'), [4, 5, 6]);\n\n assert.equal((0, _metal.watcherCount)(item2a, 'id'), 2);\n assert.equal((0, _metal.watcherCount)(item2b, 'id'), 2);\n assert.equal((0, _metal.watcherCount)(item2c, 'id'), 2);\n\n // Ensure that the observers added by the EachProxy on all items in the\n // first content array have been torn down.\n assert.equal((0, _metal.watcherCount)(item1a, 'id'), 1);\n assert.equal((0, _metal.watcherCount)(item1b, 'id'), 1);\n assert.equal((0, _metal.watcherCount)(item1c, 'id'), 1);\n\n proxy.set('content', content2);\n\n assert.equal((0, _metal.watcherCount)(item2a, 'id'), 2);\n assert.equal((0, _metal.watcherCount)(item2b, 'id'), 2);\n assert.equal((0, _metal.watcherCount)(item2c, 'id'), 2);\n\n proxy.set('content', content2);\n\n assert.equal((0, _metal.watcherCount)(item2a, 'id'), 2);\n assert.equal((0, _metal.watcherCount)(item2b, 'id'), 2);\n assert.equal((0, _metal.watcherCount)(item2c, 'id'), 2);\n }\n });\n});","enifed('@ember/-internals/runtime/tests/system/core_object_test', ['@ember/-internals/owner', '@ember/-internals/metal', '@ember/-internals/runtime/lib/system/core_object', 'internal-test-helpers'], function (_owner, _metal, _core_object, _internalTestHelpers) {\n 'use strict';\n\n (0, _internalTestHelpers.moduleFor)('Ember.CoreObject', class extends _internalTestHelpers.AbstractTestCase {\n ['@test throws deprecation with new (one arg)']() {\n expectDeprecation(() => {\n new _core_object.default({\n firstName: 'Stef',\n lastName: 'Penner'\n });\n }, /using `new` with EmberObject has been deprecated/);\n }\n\n ['@test throws deprecation with new (> 1 arg)']() {\n expectDeprecation(() => {\n new _core_object.default({\n firstName: 'Stef',\n lastName: 'Penner'\n }, {\n other: 'name'\n });\n }, /using `new` with EmberObject has been deprecated/);\n }\n\n ['@test toString should be not be added as a property when calling toString()'](assert) {\n let obj = _core_object.default.create({\n firstName: 'Foo',\n lastName: 'Bar'\n });\n\n obj.toString();\n\n assert.notOk(obj.hasOwnProperty('toString'), 'Calling toString() should not create a toString class property');\n }\n\n ['@test should not trigger proxy assertion when retrieving a proxy with (GH#16263)'](assert) {\n let someProxyishThing = _core_object.default.extend({\n unknownProperty() {\n return true;\n }\n }).create();\n\n let obj = _core_object.default.create({\n someProxyishThing\n });\n\n let proxy = (0, _metal.get)(obj, 'someProxyishThing');\n assert.equal((0, _metal.get)(proxy, 'lolol'), true, 'should be able to get data from a proxy');\n }\n\n ['@test should not trigger proxy assertion when retrieving a re-registered proxy (GH#16610)'](assert) {\n let owner = (0, _internalTestHelpers.buildOwner)();\n\n let someProxyishThing = _core_object.default.extend({\n unknownProperty() {\n return true;\n }\n }).create();\n\n // emulates ember-engines's process of registering services provided\n // by the host app down to the engine\n owner.register('thing:one', someProxyishThing, { instantiate: false });\n\n assert.equal(owner.lookup('thing:one'), someProxyishThing);\n }\n\n ['@test should not trigger proxy assertion when probing for a \"symbol\"'](assert) {\n let proxy = _core_object.default.extend({\n unknownProperty() {\n return true;\n }\n }).create();\n\n assert.equal((0, _metal.get)(proxy, 'lolol'), true, 'should be able to get data from a proxy');\n\n // should not trigger an assertion\n (0, _owner.getOwner)(proxy);\n }\n\n ['@test can use getOwner in a proxy init GH#16484'](assert) {\n let owner = {};\n let options = {};\n (0, _owner.setOwner)(options, owner);\n\n _core_object.default.extend({\n init() {\n this._super(...arguments);\n let localOwner = (0, _owner.getOwner)(this);\n\n assert.equal(localOwner, owner, 'should be able to `getOwner` in init');\n },\n unknownProperty() {\n return undefined;\n }\n }).create(options);\n }\n });\n});","enifed('@ember/-internals/runtime/tests/system/namespace/base_test', ['@ember/-internals/environment', '@ember/runloop', '@ember/-internals/metal', '@ember/-internals/utils', '@ember/-internals/runtime/lib/system/object', '@ember/-internals/runtime/lib/system/namespace', 'internal-test-helpers'], function (_environment, _runloop, _metal, _utils, _object, _namespace, _internalTestHelpers) {\n 'use strict';\n\n const originalLookup = _environment.context.lookup;\n let lookup;\n\n (0, _internalTestHelpers.moduleFor)('Namespace', class extends _internalTestHelpers.AbstractTestCase {\n beforeEach() {\n (0, _metal.setNamespaceSearchDisabled)(false);\n\n lookup = _environment.context.lookup = {};\n }\n\n afterEach() {\n (0, _metal.setNamespaceSearchDisabled)(false);\n\n for (let prop in lookup) {\n if (lookup[prop]) {\n (0, _runloop.run)(lookup[prop], 'destroy');\n }\n }\n\n _environment.context.lookup = originalLookup;\n }\n\n ['@test Namespace should be a subclass of EmberObject'](assert) {\n assert.ok(_object.default.detect(_namespace.default));\n }\n\n ['@test Namespace should be duck typed'](assert) {\n let namespace = _namespace.default.create();\n try {\n assert.ok((0, _metal.get)(namespace, 'isNamespace'), 'isNamespace property is true');\n } finally {\n (0, _runloop.run)(namespace, 'destroy');\n }\n }\n\n ['@test Namespace is found and named'](assert) {\n let nsA = lookup.NamespaceA = _namespace.default.create();\n assert.equal(nsA.toString(), 'NamespaceA', 'namespaces should have a name if they are on lookup');\n\n let nsB = lookup.NamespaceB = _namespace.default.create();\n assert.equal(nsB.toString(), 'NamespaceB', 'namespaces work if created after the first namespace processing pass');\n }\n\n ['@test Classes under an Namespace are properly named'](assert) {\n let nsA = lookup.NamespaceA = _namespace.default.create();\n nsA.Foo = _object.default.extend();\n assert.equal(nsA.Foo.toString(), 'NamespaceA.Foo', 'Classes pick up their parent namespace');\n\n nsA.Bar = _object.default.extend();\n assert.equal(nsA.Bar.toString(), 'NamespaceA.Bar', 'New Classes get the naming treatment too');\n\n let nsB = lookup.NamespaceB = _namespace.default.create();\n nsB.Foo = _object.default.extend();\n assert.equal(nsB.Foo.toString(), 'NamespaceB.Foo', 'Classes in new namespaces get the naming treatment');\n }\n\n //test(\"Classes under Ember are properly named\", function() {\n // // ES6TODO: This test does not work reliably when running independent package build with Broccoli config.\n // Ember.TestObject = EmberObject.extend({});\n // equal(Ember.TestObject.toString(), \"Ember.TestObject\", \"class under Ember is given a string representation\");\n //});\n\n ['@test Lowercase namespaces are no longer supported'](assert) {\n let nsC = lookup.namespaceC = _namespace.default.create();\n assert.equal(nsC.toString(), (0, _utils.guidFor)(nsC));\n }\n\n ['@test A namespace can be assigned a custom name'](assert) {\n let nsA = _namespace.default.create({\n name: 'NamespaceA'\n });\n\n try {\n let nsB = lookup.NamespaceB = _namespace.default.create({\n name: 'CustomNamespaceB'\n });\n\n nsA.Foo = _object.default.extend();\n nsB.Foo = _object.default.extend();\n\n assert.equal(nsA.Foo.toString(), 'NamespaceA.Foo', \"The namespace's name is used when the namespace is not in the lookup object\");\n assert.equal(nsB.Foo.toString(), 'CustomNamespaceB.Foo', \"The namespace's name is used when the namespace is in the lookup object\");\n } finally {\n (0, _runloop.run)(nsA, 'destroy');\n }\n }\n\n ['@test Calling namespace.nameClasses() eagerly names all classes'](assert) {\n (0, _metal.setNamespaceSearchDisabled)(true);\n\n let namespace = lookup.NS = _namespace.default.create();\n\n namespace.ClassA = _object.default.extend();\n namespace.ClassB = _object.default.extend();\n\n _namespace.default.processAll();\n\n assert.equal(namespace.ClassA.toString(), 'NS.ClassA');\n assert.equal(namespace.ClassB.toString(), 'NS.ClassB');\n }\n\n ['@test A namespace can be looked up by its name'](assert) {\n let NS = lookup.NS = _namespace.default.create();\n let UI = lookup.UI = _namespace.default.create();\n let CF = lookup.CF = _namespace.default.create();\n\n assert.equal(_namespace.default.byName('NS'), NS);\n assert.equal(_namespace.default.byName('UI'), UI);\n assert.equal(_namespace.default.byName('CF'), CF);\n }\n\n ['@test A nested namespace can be looked up by its name'](assert) {\n let UI = lookup.UI = _namespace.default.create();\n UI.Nav = _namespace.default.create();\n\n assert.equal(_namespace.default.byName('UI.Nav'), UI.Nav);\n\n (0, _runloop.run)(UI.Nav, 'destroy');\n }\n\n ['@test Destroying a namespace before caching lookup removes it from the list of namespaces'](assert) {\n let CF = lookup.CF = _namespace.default.create();\n\n (0, _runloop.run)(CF, 'destroy');\n assert.equal(_namespace.default.byName('CF'), undefined, 'namespace can not be found after destroyed');\n }\n\n ['@test Destroying a namespace after looking up removes it from the list of namespaces'](assert) {\n let CF = lookup.CF = _namespace.default.create();\n\n assert.equal(_namespace.default.byName('CF'), CF, 'precondition - namespace can be looked up by name');\n\n (0, _runloop.run)(CF, 'destroy');\n assert.equal(_namespace.default.byName('CF'), undefined, 'namespace can not be found after destroyed');\n }\n });\n});","enifed('@ember/-internals/runtime/tests/system/native_array/a_test', ['@ember/-internals/runtime/lib/mixins/array', 'internal-test-helpers'], function (_array, _internalTestHelpers) {\n 'use strict';\n\n (0, _internalTestHelpers.moduleFor)('Ember.A', class extends _internalTestHelpers.AbstractTestCase {\n ['@test Ember.A'](assert) {\n assert.deepEqual((0, _array.A)([1, 2]), [1, 2], 'array values were not be modified');\n assert.deepEqual((0, _array.A)(), [], 'returned an array with no arguments');\n assert.deepEqual((0, _array.A)(null), [], 'returned an array with a null argument');\n assert.ok(_array.default.detect((0, _array.A)()), 'returned an ember array');\n assert.ok(_array.default.detect((0, _array.A)([1, 2])), 'returned an ember array');\n }\n\n ['@test new Ember.A'](assert) {\n expectDeprecation(() => {\n assert.deepEqual(new _array.A([1, 2]), [1, 2], 'array values were not be modified');\n assert.deepEqual(new _array.A(), [], 'returned an array with no arguments');\n assert.deepEqual(new _array.A(null), [], 'returned an array with a null argument');\n assert.ok(_array.default.detect(new _array.A()), 'returned an ember array');\n assert.ok(_array.default.detect(new _array.A([1, 2])), 'returned an ember array');\n });\n }\n });\n});","enifed('@ember/-internals/runtime/tests/system/native_array/copyable_suite_test', ['@ember/-internals/runtime/lib/mixins/array', 'internal-test-helpers'], function (_array, _internalTestHelpers) {\n 'use strict';\n\n (0, _internalTestHelpers.moduleFor)('NativeArray Copyable', class extends _internalTestHelpers.AbstractTestCase {\n ['@test deep copy is respected'](assert) {\n let array = (0, _array.A)([{ id: 1 }, { id: 2 }, { id: 3 }]);\n let copiedArray;\n\n expectDeprecation(() => {\n copiedArray = array.copy(true);\n }, `Using \\`NativeArray#copy\\` is deprecated`);\n\n assert.deepEqual(copiedArray, array, 'copied array is equivalent');\n assert.ok(copiedArray[0] !== array[0], 'objects inside should be unique');\n }\n });\n});","enifed('@ember/-internals/runtime/tests/system/native_array/replace_test', ['@ember/-internals/runtime/lib/mixins/array', 'internal-test-helpers'], function (_array, _internalTestHelpers) {\n 'use strict';\n\n (0, _internalTestHelpers.moduleFor)('NativeArray.replace', class extends _internalTestHelpers.AbstractTestCase {\n ['@test raises assertion if third argument is not an array']() {\n expectAssertion(function () {\n (0, _array.A)([1, 2, 3]).replace(1, 1, '');\n }, 'The third argument to replace needs to be an array.');\n }\n\n ['@test it does not raise an assertion if third parameter is not passed'](assert) {\n assert.deepEqual((0, _array.A)([1, 2, 3]).replace(1, 2), (0, _array.A)([1]), 'no assertion raised');\n }\n });\n});","enifed('@ember/-internals/runtime/tests/system/object/computed_test', ['@ember/-internals/metal', '@ember/object/computed', '@ember/-internals/runtime/lib/system/object', 'internal-test-helpers'], function (_metal, _computed, _object, _internalTestHelpers) {\n 'use strict';\n\n function K() {\n return this;\n }\n\n function testWithDefault(assert, expect, x, y, z) {\n assert.equal((0, _metal.get)(x, y), expect);\n assert.equal((0, _metal.getWithDefault)(x, y, z), expect);\n assert.equal(x.getWithDefault(y, z), expect);\n }\n\n (0, _internalTestHelpers.moduleFor)('EmberObject computed property', class extends _internalTestHelpers.AbstractTestCase {\n ['@test computed property on instance'](assert) {\n let MyClass = _object.default.extend({\n foo: (0, _metal.computed)(function () {\n return 'FOO';\n })\n });\n\n testWithDefault(assert, 'FOO', MyClass.create(), 'foo');\n }\n\n ['@test computed property on subclass'](assert) {\n let MyClass = _object.default.extend({\n foo: (0, _metal.computed)(function () {\n return 'FOO';\n })\n });\n\n let Subclass = MyClass.extend({\n foo: (0, _metal.computed)(function () {\n return 'BAR';\n })\n });\n\n testWithDefault(assert, 'BAR', Subclass.create(), 'foo');\n }\n\n ['@test replacing computed property with regular val'](assert) {\n let MyClass = _object.default.extend({\n foo: (0, _metal.computed)(function () {\n return 'FOO';\n })\n });\n\n let Subclass = MyClass.extend({\n foo: 'BAR'\n });\n\n testWithDefault(assert, 'BAR', Subclass.create(), 'foo');\n }\n\n ['@test complex depndent keys'](assert) {\n let MyClass = _object.default.extend({\n init() {\n this._super(...arguments);\n (0, _metal.set)(this, 'bar', { baz: 'BIFF' });\n },\n\n count: 0,\n\n foo: (0, _metal.computed)(function () {\n (0, _metal.set)(this, 'count', (0, _metal.get)(this, 'count') + 1);\n return (0, _metal.get)((0, _metal.get)(this, 'bar'), 'baz') + ' ' + (0, _metal.get)(this, 'count');\n }).property('bar.baz')\n });\n\n let Subclass = MyClass.extend({\n count: 20\n });\n\n let obj1 = MyClass.create();\n let obj2 = Subclass.create();\n\n testWithDefault(assert, 'BIFF 1', obj1, 'foo');\n testWithDefault(assert, 'BIFF 21', obj2, 'foo');\n\n (0, _metal.set)((0, _metal.get)(obj1, 'bar'), 'baz', 'BLARG');\n\n testWithDefault(assert, 'BLARG 2', obj1, 'foo');\n testWithDefault(assert, 'BIFF 21', obj2, 'foo');\n\n (0, _metal.set)((0, _metal.get)(obj2, 'bar'), 'baz', 'BOOM');\n\n testWithDefault(assert, 'BLARG 2', obj1, 'foo');\n testWithDefault(assert, 'BOOM 22', obj2, 'foo');\n }\n\n ['@test complex dependent keys changing complex dependent keys'](assert) {\n let MyClass = _object.default.extend({\n init() {\n this._super(...arguments);\n (0, _metal.set)(this, 'bar', { baz: 'BIFF' });\n },\n\n count: 0,\n\n foo: (0, _metal.computed)(function () {\n (0, _metal.set)(this, 'count', (0, _metal.get)(this, 'count') + 1);\n return (0, _metal.get)((0, _metal.get)(this, 'bar'), 'baz') + ' ' + (0, _metal.get)(this, 'count');\n }).property('bar.baz')\n });\n\n let Subclass = MyClass.extend({\n init() {\n this._super(...arguments);\n (0, _metal.set)(this, 'bar2', { baz: 'BIFF2' });\n },\n\n count: 0,\n\n foo: (0, _metal.computed)(function () {\n (0, _metal.set)(this, 'count', (0, _metal.get)(this, 'count') + 1);\n return (0, _metal.get)((0, _metal.get)(this, 'bar2'), 'baz') + ' ' + (0, _metal.get)(this, 'count');\n }).property('bar2.baz')\n });\n\n let obj2 = Subclass.create();\n\n testWithDefault(assert, 'BIFF2 1', obj2, 'foo');\n\n (0, _metal.set)((0, _metal.get)(obj2, 'bar'), 'baz', 'BLARG');\n testWithDefault(assert, 'BIFF2 1', obj2, 'foo'); // should not invalidate property\n\n (0, _metal.set)((0, _metal.get)(obj2, 'bar2'), 'baz', 'BLARG');\n testWithDefault(assert, 'BLARG 2', obj2, 'foo'); // should not invalidate property\n }\n\n ['@test can retrieve metadata for a computed property'](assert) {\n let MyClass = _object.default.extend({\n computedProperty: (0, _metal.computed)(function () {}).meta({ key: 'keyValue' })\n });\n\n assert.equal((0, _metal.get)(MyClass.metaForProperty('computedProperty'), 'key'), 'keyValue', 'metadata saved on the computed property can be retrieved');\n\n let ClassWithNoMetadata = _object.default.extend({\n computedProperty: (0, _metal.computed)(function () {}).volatile(),\n\n staticProperty: 12\n });\n\n assert.equal(typeof ClassWithNoMetadata.metaForProperty('computedProperty'), 'object', 'returns empty hash if no metadata has been saved');\n\n expectAssertion(function () {\n ClassWithNoMetadata.metaForProperty('nonexistentProperty');\n }, \"metaForProperty() could not find a computed property with key 'nonexistentProperty'.\");\n\n expectAssertion(function () {\n ClassWithNoMetadata.metaForProperty('staticProperty');\n }, \"metaForProperty() could not find a computed property with key 'staticProperty'.\");\n }\n\n ['@test overriding a computed property with null removes it from eachComputedProperty iteration'](assert) {\n let MyClass = _object.default.extend({\n foo: (0, _metal.computed)(function () {}),\n\n fooDidChange: (0, _metal.observer)('foo', function () {}),\n\n bar: (0, _metal.computed)(function () {})\n });\n\n let SubClass = MyClass.extend({\n foo: null\n });\n\n let list = [];\n\n SubClass.eachComputedProperty(name => list.push(name));\n\n assert.deepEqual(list.sort(), ['bar'], 'overridding with null removes from eachComputedProperty listing');\n }\n\n ['@test can iterate over a list of computed properties for a class'](assert) {\n let MyClass = _object.default.extend({\n foo: (0, _metal.computed)(function () {}),\n\n fooDidChange: (0, _metal.observer)('foo', function () {}),\n\n bar: (0, _metal.computed)(function () {}),\n\n qux: (0, _metal.alias)('foo')\n });\n\n let SubClass = MyClass.extend({\n baz: (0, _metal.computed)(function () {})\n });\n\n SubClass.reopen({\n bat: (0, _metal.computed)(function () {}).meta({ iAmBat: true })\n });\n\n let list = [];\n\n MyClass.eachComputedProperty(function (name) {\n list.push(name);\n });\n\n assert.deepEqual(list.sort(), ['bar', 'foo', 'qux'], 'watched and unwatched computed properties are iterated');\n\n list = [];\n\n SubClass.eachComputedProperty(function (name, meta) {\n list.push(name);\n\n if (name === 'bat') {\n assert.deepEqual(meta, { iAmBat: true });\n } else {\n assert.deepEqual(meta, {});\n }\n });\n\n assert.deepEqual(list.sort(), ['bar', 'bat', 'baz', 'foo', 'qux'], 'all inherited properties are included');\n }\n\n ['@test list of properties updates when an additional property is added (such cache busting)'](assert) {\n let MyClass = _object.default.extend({\n foo: (0, _metal.computed)(K),\n\n fooDidChange: (0, _metal.observer)('foo', function () {}),\n\n bar: (0, _metal.computed)(K)\n });\n\n let list = [];\n\n MyClass.eachComputedProperty(function (name) {\n list.push(name);\n });\n\n assert.deepEqual(list.sort(), ['bar', 'foo'].sort(), 'expected two computed properties');\n\n MyClass.reopen({\n baz: (0, _metal.computed)(K)\n });\n\n MyClass.create(); // force apply mixins\n\n list = [];\n\n MyClass.eachComputedProperty(function (name) {\n list.push(name);\n });\n\n assert.deepEqual(list.sort(), ['bar', 'foo', 'baz'].sort(), 'expected three computed properties');\n\n (0, _metal.defineProperty)(MyClass.prototype, 'qux', (0, _metal.computed)(K));\n\n list = [];\n\n MyClass.eachComputedProperty(function (name) {\n list.push(name);\n });\n\n assert.deepEqual(list.sort(), ['bar', 'foo', 'baz', 'qux'].sort(), 'expected four computed properties');\n }\n\n ['@test Calling _super in call outside the immediate function of a CP getter works'](assert) {\n function macro(callback) {\n return (0, _metal.computed)(function () {\n return callback.call(this);\n });\n }\n\n let MyClass = _object.default.extend({\n foo: (0, _metal.computed)(function () {\n return 'FOO';\n })\n });\n\n let SubClass = MyClass.extend({\n foo: macro(function () {\n return this._super();\n })\n });\n\n assert.ok((0, _metal.get)(SubClass.create(), 'foo'), 'FOO', 'super value is fetched');\n }\n\n ['@test Calling _super in apply outside the immediate function of a CP getter works'](assert) {\n function macro(callback) {\n return (0, _metal.computed)(function () {\n return callback.apply(this);\n });\n }\n\n let MyClass = _object.default.extend({\n foo: (0, _metal.computed)(function () {\n return 'FOO';\n })\n });\n\n let SubClass = MyClass.extend({\n foo: macro(function () {\n return this._super();\n })\n });\n\n assert.ok((0, _metal.get)(SubClass.create(), 'foo'), 'FOO', 'super value is fetched');\n }\n\n ['@test observing computed.reads prop and overriding it in create() works'](assert) {\n let Obj = _object.default.extend({\n name: (0, _computed.oneWay)('model.name'),\n nameDidChange: (0, _metal.observer)('name', function () {})\n });\n\n let obj1 = Obj.create({ name: '1' });\n let obj2 = Obj.create({ name: '2' });\n\n assert.equal(obj1.get('name'), '1');\n assert.equal(obj2.get('name'), '2');\n }\n });\n});","enifed('@ember/-internals/runtime/tests/system/object/create_test', ['@ember/-internals/owner', '@ember/-internals/metal', '@ember/-internals/runtime/lib/system/object', 'internal-test-helpers'], function (_owner, _metal, _object, _internalTestHelpers) {\n 'use strict';\n\n (0, _internalTestHelpers.moduleFor)('EmberObject.create', class extends _internalTestHelpers.AbstractTestCase {\n ['@test simple properties are set'](assert) {\n let o = _object.default.create({ ohai: 'there' });\n assert.equal(o.get('ohai'), 'there');\n }\n\n ['@test calls computed property setters'](assert) {\n let MyClass = _object.default.extend({\n foo: (0, _metal.computed)({\n get() {\n return \"this is not the value you're looking for\";\n },\n set(key, value) {\n return value;\n }\n })\n });\n\n let o = MyClass.create({ foo: 'bar' });\n assert.equal(o.get('foo'), 'bar');\n }\n\n ['@test sets up mandatory setters for watched simple properties'](assert) {\n if (true /* DEBUG */) {\n let MyClass = _object.default.extend({\n foo: null,\n bar: null,\n fooDidChange: (0, _metal.observer)('foo', function () {})\n });\n\n let o = MyClass.create({ foo: 'bar', bar: 'baz' });\n assert.equal(o.get('foo'), 'bar');\n\n let descriptor = Object.getOwnPropertyDescriptor(o, 'foo');\n assert.ok(descriptor.set, 'Mandatory setter was setup');\n\n descriptor = Object.getOwnPropertyDescriptor(o, 'bar');\n assert.ok(!descriptor.set, 'Mandatory setter was not setup');\n } else {\n assert.expect(0);\n }\n }\n\n ['@test calls setUnknownProperty if defined'](assert) {\n let setUnknownPropertyCalled = false;\n\n let MyClass = _object.default.extend({\n setUnknownProperty() /* key, value */{\n setUnknownPropertyCalled = true;\n }\n });\n\n MyClass.create({ foo: 'bar' });\n assert.ok(setUnknownPropertyCalled, 'setUnknownProperty was called');\n }\n\n ['@test throws if you try to define a computed property']() {\n expectAssertion(function () {\n _object.default.create({\n foo: (0, _metal.computed)(function () {})\n });\n }, 'EmberObject.create no longer supports defining computed properties. Define computed properties using extend() or reopen() before calling create().');\n }\n\n ['@test throws if you try to call _super in a method']() {\n expectAssertion(function () {\n _object.default.create({\n foo() {\n this._super(...arguments);\n }\n });\n }, 'EmberObject.create no longer supports defining methods that call _super.');\n }\n\n [\"@test throws if you try to 'mixin' a definition\"]() {\n let myMixin = _metal.Mixin.create({\n adder(arg1, arg2) {\n return arg1 + arg2;\n }\n });\n\n expectAssertion(function () {\n _object.default.create(myMixin);\n }, 'EmberObject.create no longer supports mixing in other definitions, use .extend & .create separately instead.');\n }\n\n ['@test inherits properties from passed in EmberObject'](assert) {\n let baseObj = _object.default.create({ foo: 'bar' });\n let secondaryObj = _object.default.create(baseObj);\n\n assert.equal(secondaryObj.foo, baseObj.foo, 'Em.O.create inherits properties from EmberObject parameter');\n }\n\n ['@test throws if you try to pass anything a string as a parameter']() {\n let expected = 'EmberObject.create only accepts objects.';\n\n expectAssertion(() => _object.default.create('some-string'), expected);\n }\n\n ['@test EmberObject.create can take undefined as a parameter'](assert) {\n let o = _object.default.create(undefined);\n assert.deepEqual(_object.default.create(), o);\n }\n\n ['@test can use getOwner in a proxy init GH#16484'](assert) {\n let owner = {};\n let options = {};\n (0, _owner.setOwner)(options, owner);\n\n _object.default.extend({\n init() {\n this._super(...arguments);\n let localOwner = (0, _owner.getOwner)(this);\n\n assert.equal(localOwner, owner, 'should be able to `getOwner` in init');\n },\n unknownProperty() {\n return undefined;\n }\n }).create(options);\n }\n });\n});","enifed('@ember/-internals/runtime/tests/system/object/destroy_test', ['@ember/runloop', '@ember/-internals/metal', '@ember/-internals/meta', '@ember/-internals/runtime/lib/system/object', 'internal-test-helpers'], function (_runloop, _metal, _meta, _object, _internalTestHelpers) {\n 'use strict';\n\n (0, _internalTestHelpers.moduleFor)('@ember/-internals/runtime/system/object/destroy_test', class extends _internalTestHelpers.AbstractTestCase {\n ['@test should schedule objects to be destroyed at the end of the run loop'](assert) {\n let obj = _object.default.create();\n let meta;\n\n (0, _runloop.run)(() => {\n obj.destroy();\n meta = (0, _meta.peekMeta)(obj);\n assert.ok(meta, 'meta is not destroyed immediately');\n assert.ok((0, _metal.get)(obj, 'isDestroying'), 'object is marked as destroying immediately');\n assert.ok(!(0, _metal.get)(obj, 'isDestroyed'), 'object is not destroyed immediately');\n });\n\n meta = (0, _meta.peekMeta)(obj);\n assert.ok((0, _metal.get)(obj, 'isDestroyed'), 'object is destroyed after run loop finishes');\n }\n\n // MANDATORY_SETTER moves value to meta.values\n // a destroyed object removes meta but leaves the accessor\n // that looks it up\n ['@test should raise an exception when modifying watched properties on a destroyed object'](assert) {\n if (true /* DEBUG */) {\n let obj = _object.default.extend({\n fooDidChange: (0, _metal.observer)('foo', function () {})\n }).create({\n foo: 'bar'\n });\n\n (0, _runloop.run)(() => obj.destroy());\n\n assert.throws(() => (0, _metal.set)(obj, 'foo', 'baz'), Error, 'raises an exception');\n } else {\n assert.expect(0);\n }\n }\n\n ['@test observers should not fire after an object has been destroyed'](assert) {\n let count = 0;\n let obj = _object.default.extend({\n fooDidChange: (0, _metal.observer)('foo', function () {\n count++;\n })\n }).create();\n\n obj.set('foo', 'bar');\n\n assert.equal(count, 1, 'observer was fired once');\n\n (0, _runloop.run)(() => {\n (0, _metal.beginPropertyChanges)();\n obj.set('foo', 'quux');\n obj.destroy();\n (0, _metal.endPropertyChanges)();\n });\n\n assert.equal(count, 1, 'observer was not called after object was destroyed');\n }\n\n ['@test destroyed objects should not see each others changes during teardown but a long lived object should'](assert) {\n let shouldChange = 0;\n let shouldNotChange = 0;\n\n let objs = {};\n\n let A = _object.default.extend({\n objs: objs,\n isAlive: true,\n willDestroy() {\n this.set('isAlive', false);\n },\n bDidChange: (0, _metal.observer)('objs.b.isAlive', function () {\n shouldNotChange++;\n }),\n cDidChange: (0, _metal.observer)('objs.c.isAlive', function () {\n shouldNotChange++;\n })\n });\n\n let B = _object.default.extend({\n objs: objs,\n isAlive: true,\n willDestroy() {\n this.set('isAlive', false);\n },\n aDidChange: (0, _metal.observer)('objs.a.isAlive', function () {\n shouldNotChange++;\n }),\n cDidChange: (0, _metal.observer)('objs.c.isAlive', function () {\n shouldNotChange++;\n })\n });\n\n let C = _object.default.extend({\n objs: objs,\n isAlive: true,\n willDestroy() {\n this.set('isAlive', false);\n },\n aDidChange: (0, _metal.observer)('objs.a.isAlive', function () {\n shouldNotChange++;\n }),\n bDidChange: (0, _metal.observer)('objs.b.isAlive', function () {\n shouldNotChange++;\n })\n });\n\n let LongLivedObject = _object.default.extend({\n objs: objs,\n isAliveDidChange: (0, _metal.observer)('objs.a.isAlive', function () {\n shouldChange++;\n })\n });\n\n objs.a = A.create();\n\n objs.b = B.create();\n\n objs.c = C.create();\n\n LongLivedObject.create();\n\n (0, _runloop.run)(() => {\n let keys = Object.keys(objs);\n for (let i = 0; i < keys.length; i++) {\n objs[keys[i]].destroy();\n }\n });\n\n assert.equal(shouldNotChange, 0, 'destroyed graph objs should not see change in willDestroy');\n assert.equal(shouldChange, 1, 'long lived should see change in willDestroy');\n }\n });\n});","enifed('@ember/-internals/runtime/tests/system/object/detectInstance_test', ['@ember/-internals/runtime/lib/system/object', 'internal-test-helpers'], function (_object, _internalTestHelpers) {\n 'use strict';\n\n (0, _internalTestHelpers.moduleFor)('system/object/detectInstance', class extends _internalTestHelpers.AbstractTestCase {\n ['@test detectInstance detects instances correctly'](assert) {\n let A = _object.default.extend();\n let B = A.extend();\n let C = A.extend();\n\n let o = _object.default.create();\n let a = A.create();\n let b = B.create();\n let c = C.create();\n\n assert.ok(_object.default.detectInstance(o), 'o is an instance of EmberObject');\n assert.ok(_object.default.detectInstance(a), 'a is an instance of EmberObject');\n assert.ok(_object.default.detectInstance(b), 'b is an instance of EmberObject');\n assert.ok(_object.default.detectInstance(c), 'c is an instance of EmberObject');\n\n assert.ok(!A.detectInstance(o), 'o is not an instance of A');\n assert.ok(A.detectInstance(a), 'a is an instance of A');\n assert.ok(A.detectInstance(b), 'b is an instance of A');\n assert.ok(A.detectInstance(c), 'c is an instance of A');\n\n assert.ok(!B.detectInstance(o), 'o is not an instance of B');\n assert.ok(!B.detectInstance(a), 'a is not an instance of B');\n assert.ok(B.detectInstance(b), 'b is an instance of B');\n assert.ok(!B.detectInstance(c), 'c is not an instance of B');\n\n assert.ok(!C.detectInstance(o), 'o is not an instance of C');\n assert.ok(!C.detectInstance(a), 'a is not an instance of C');\n assert.ok(!C.detectInstance(b), 'b is not an instance of C');\n assert.ok(C.detectInstance(c), 'c is an instance of C');\n }\n });\n});","enifed('@ember/-internals/runtime/tests/system/object/detect_test', ['@ember/-internals/runtime/lib/system/object', 'internal-test-helpers'], function (_object, _internalTestHelpers) {\n 'use strict';\n\n (0, _internalTestHelpers.moduleFor)('system/object/detect', class extends _internalTestHelpers.AbstractTestCase {\n ['@test detect detects classes correctly'](assert) {\n let A = _object.default.extend();\n let B = A.extend();\n let C = A.extend();\n\n assert.ok(_object.default.detect(_object.default), 'EmberObject is an EmberObject class');\n assert.ok(_object.default.detect(A), 'A is an EmberObject class');\n assert.ok(_object.default.detect(B), 'B is an EmberObject class');\n assert.ok(_object.default.detect(C), 'C is an EmberObject class');\n\n assert.ok(!A.detect(_object.default), 'EmberObject is not an A class');\n assert.ok(A.detect(A), 'A is an A class');\n assert.ok(A.detect(B), 'B is an A class');\n assert.ok(A.detect(C), 'C is an A class');\n\n assert.ok(!B.detect(_object.default), 'EmberObject is not a B class');\n assert.ok(!B.detect(A), 'A is not a B class');\n assert.ok(B.detect(B), 'B is a B class');\n assert.ok(!B.detect(C), 'C is not a B class');\n\n assert.ok(!C.detect(_object.default), 'EmberObject is not a C class');\n assert.ok(!C.detect(A), 'A is not a C class');\n assert.ok(!C.detect(B), 'B is not a C class');\n assert.ok(C.detect(C), 'C is a C class');\n }\n });\n});","enifed('@ember/-internals/runtime/tests/system/object/es-compatibility-test', ['@ember/-internals/runtime/lib/system/object', '@ember/-internals/metal', 'internal-test-helpers'], function (_object, _metal, _internalTestHelpers) {\n 'use strict';\n\n (0, _internalTestHelpers.moduleFor)('EmberObject ES Compatibility', class extends _internalTestHelpers.AbstractTestCase {\n ['@test extending an Ember.Object'](assert) {\n let calls = [];\n\n class MyObject extends _object.default {\n constructor() {\n calls.push('constructor');\n super(...arguments);\n this.postInitProperty = 'post-init-property';\n }\n\n init() {\n calls.push('init');\n super.init(...arguments);\n this.initProperty = 'init-property';\n }\n }\n\n let myObject = MyObject.create({ passedProperty: 'passed-property' });\n\n assert.deepEqual(calls, ['constructor', 'init'], 'constructor then init called (create)');\n assert.equal(myObject.postInitProperty, 'post-init-property', 'constructor property available on instance (create)');\n assert.equal(myObject.initProperty, 'init-property', 'init property available on instance (create)');\n assert.equal(myObject.passedProperty, 'passed-property', 'passed property available on instance (create)');\n }\n\n ['@test normal method super'](assert) {\n let calls = [];\n\n let Foo = _object.default.extend({\n method() {\n calls.push('foo');\n }\n });\n\n let Bar = Foo.extend({\n method() {\n this._super();\n calls.push('bar');\n }\n });\n\n class Baz extends Bar {\n method() {\n super.method();\n calls.push('baz');\n }\n }\n\n let Qux = Baz.extend({\n method() {\n this._super();\n calls.push('qux');\n }\n });\n\n let Quux = Qux.extend({\n method() {\n this._super();\n calls.push('quux');\n }\n });\n\n class Corge extends Quux {\n method() {\n super.method();\n calls.push('corge');\n }\n }\n\n let callValues = ['foo', 'bar', 'baz', 'qux', 'quux', 'corge'];\n\n [Foo, Bar, Baz, Qux, Quux, Corge].forEach((Class, index) => {\n calls = [];\n Class.create().method();\n\n assert.deepEqual(calls, callValues.slice(0, index + 1), 'chain of static methods called with super');\n });\n }\n\n ['@test static method super'](assert) {\n let calls;\n\n let Foo = _object.default.extend();\n Foo.reopenClass({\n method() {\n calls.push('foo');\n }\n });\n\n let Bar = Foo.extend();\n Bar.reopenClass({\n method() {\n this._super();\n calls.push('bar');\n }\n });\n\n class Baz extends Bar {\n static method() {\n super.method();\n calls.push('baz');\n }\n }\n\n let Qux = Baz.extend();\n Qux.reopenClass({\n method() {\n this._super();\n calls.push('qux');\n }\n });\n\n let Quux = Qux.extend();\n Quux.reopenClass({\n method() {\n this._super();\n calls.push('quux');\n }\n });\n\n class Corge extends Quux {\n static method() {\n super.method();\n calls.push('corge');\n }\n }\n\n let callValues = ['foo', 'bar', 'baz', 'qux', 'quux', 'corge'];\n\n [Foo, Bar, Baz, Qux, Quux, Corge].forEach((Class, index) => {\n calls = [];\n Class.method();\n\n assert.deepEqual(calls, callValues.slice(0, index + 1), 'chain of static methods called with super');\n });\n }\n\n ['@test using mixins'](assert) {\n let Mixin1 = _metal.Mixin.create({\n property1: 'data-1'\n });\n\n let Mixin2 = _metal.Mixin.create({\n property2: 'data-2'\n });\n\n class MyObject extends _object.default.extend(Mixin1, Mixin2) {}\n\n let myObject = MyObject.create();\n assert.equal(myObject.property1, 'data-1', 'includes the first mixin');\n assert.equal(myObject.property2, 'data-2', 'includes the second mixin');\n }\n\n ['@test using instanceof'](assert) {\n class MyObject extends _object.default {}\n\n let myObject = MyObject.create();\n\n assert.ok(myObject instanceof MyObject);\n assert.ok(myObject instanceof _object.default);\n }\n\n ['@test using Ember.Object#detect'](assert) {\n let Parent = _object.default.extend();\n class Child extends Parent {}\n let Grandchild = Child.extend();\n\n assert.ok(Parent.detect(Child), 'Parent.detect(Child)');\n assert.ok(Child.detect(Grandchild), 'Child.detect(Grandchild)');\n }\n\n ['@test extending an ES subclass of EmberObject'](assert) {\n let calls = [];\n\n class SubEmberObject extends _object.default {\n constructor() {\n calls.push('constructor');\n super(...arguments);\n }\n\n init() {\n calls.push('init');\n super.init(...arguments);\n }\n }\n\n class MyObject extends SubEmberObject {}\n\n MyObject.create();\n assert.deepEqual(calls, ['constructor', 'init'], 'constructor then init called (create)');\n }\n\n ['@test calling extend on an ES subclass of EmberObject'](assert) {\n let calls = [];\n\n class SubEmberObject extends _object.default {\n constructor() {\n calls.push('before constructor');\n super(...arguments);\n calls.push('after constructor');\n this.foo = 123;\n }\n\n init() {\n calls.push('init');\n super.init(...arguments);\n }\n }\n\n let MyObject = SubEmberObject.extend({});\n\n MyObject.create();\n assert.deepEqual(calls, ['before constructor', 'after constructor', 'init'], 'constructor then init called (create)');\n\n let obj = MyObject.create({\n foo: 456,\n bar: 789\n });\n\n assert.equal(obj.foo, 456, 'sets class fields on instance correctly');\n assert.equal(obj.bar, 789, 'sets passed in properties on instance correctly');\n }\n\n ['@test calling metaForProperty on a native class works'](assert) {\n assert.expect(0);\n\n class SubEmberObject extends _object.default {}\n\n (0, _metal.defineProperty)(SubEmberObject.prototype, 'foo', (0, _metal.computed)('foo', {\n get() {\n return 'bar';\n }\n }));\n\n // able to get meta without throwing an error\n SubEmberObject.metaForProperty('foo');\n }\n\n '@test observes / removeObserver on / removeListener interop'(assert) {\n let fooDidChangeBase = 0;\n let fooDidChangeA = 0;\n let fooDidChangeB = 0;\n let someEventBase = 0;\n let someEventA = 0;\n let someEventB = 0;\n class A extends _object.default.extend({\n fooDidChange: (0, _metal.observer)('foo', function () {\n fooDidChangeBase++;\n }),\n\n onSomeEvent: (0, _metal.on)('someEvent', function () {\n someEventBase++;\n })\n }) {\n init() {\n super.init();\n this.foo = 'bar';\n }\n\n fooDidChange() {\n super.fooDidChange();\n fooDidChangeA++;\n }\n\n onSomeEvent() {\n super.onSomeEvent();\n someEventA++;\n }\n }\n\n class B extends A {\n fooDidChange() {\n super.fooDidChange();\n fooDidChangeB++;\n }\n\n onSomeEvent() {\n super.onSomeEvent();\n someEventB++;\n }\n }\n\n (0, _metal.removeObserver)(B.prototype, 'foo', null, 'fooDidChange');\n (0, _metal.removeListener)(B.prototype, 'someEvent', null, 'onSomeEvent');\n\n assert.equal(fooDidChangeBase, 0);\n assert.equal(fooDidChangeA, 0);\n assert.equal(fooDidChangeB, 0);\n\n assert.equal(someEventBase, 0);\n assert.equal(someEventA, 0);\n assert.equal(someEventB, 0);\n\n let a = A.create();\n a.set('foo', 'something');\n assert.equal(fooDidChangeBase, 1);\n assert.equal(fooDidChangeA, 1);\n assert.equal(fooDidChangeB, 0);\n\n (0, _metal.sendEvent)(a, 'someEvent');\n assert.equal(someEventBase, 1);\n assert.equal(someEventA, 1);\n assert.equal(someEventB, 0);\n\n let b = B.create();\n b.set('foo', 'something');\n assert.equal(fooDidChangeBase, 1);\n assert.equal(fooDidChangeA, 1);\n assert.equal(fooDidChangeB, 0);\n\n (0, _metal.sendEvent)(b, 'someEvent');\n assert.equal(someEventBase, 1);\n assert.equal(someEventA, 1);\n assert.equal(someEventB, 0);\n }\n\n '@test super and _super interop between old and new methods'(assert) {\n let calls = [];\n let changes = [];\n let events = [];\n let lastProps;\n\n class A extends _object.default {\n init(props) {\n calls.push('A init');\n lastProps = props;\n }\n }\n\n let Mixin1 = _metal.Mixin.create({\n init() {\n calls.push('Mixin1 init before _super');\n this._super(...arguments);\n calls.push('Mixin1 init after _super');\n }\n });\n\n let Mixin2 = _metal.Mixin.create({\n init() {\n calls.push('Mixin2 init before _super');\n this._super(...arguments);\n calls.push('Mixin2 init after _super');\n }\n });\n\n class B extends A.extend(Mixin1, Mixin2) {\n init() {\n calls.push('B init before super.init');\n super.init(...arguments);\n calls.push('B init after super.init');\n }\n\n onSomeEvent(evt) {\n events.push(`B onSomeEvent ${evt}`);\n }\n\n fullNameDidChange() {\n changes.push('B fullNameDidChange');\n }\n }\n\n // // define a CP\n (0, _metal.defineProperty)(B.prototype, 'full', (0, _metal.computed)('first', 'last', {\n get() {\n return this.first + ' ' + this.last;\n }\n }));\n\n // Only string observers are allowed for prototypes\n (0, _metal.addObserver)(B.prototype, 'full', null, 'fullNameDidChange');\n\n // Only string listeners are allowed for prototypes\n (0, _metal.addListener)(B.prototype, 'someEvent', null, 'onSomeEvent');\n\n B.reopen({\n init() {\n calls.push('reopen init before _super');\n this._super(...arguments);\n calls.push('reopen init after _super');\n }\n });\n\n let C = B.extend({\n init() {\n calls.push('C init before _super');\n this._super(...arguments);\n calls.push('C init after _super');\n },\n\n onSomeEvent(evt) {\n calls.push('C onSomeEvent before _super');\n this._super(evt);\n calls.push('C onSomeEvent after _super');\n },\n\n fullNameDidChange() {\n calls.push('C fullNameDidChange before _super');\n this._super();\n calls.push('C fullNameDidChange after _super');\n }\n });\n\n class D extends C {\n init() {\n calls.push('D init before super.init');\n super.init(...arguments);\n calls.push('D init after super.init');\n }\n\n onSomeEvent(evt) {\n events.push('D onSomeEvent before super.onSomeEvent');\n super.onSomeEvent(evt);\n events.push('D onSomeEvent after super.onSomeEvent');\n }\n\n fullNameDidChange() {\n changes.push('D fullNameDidChange before super.fullNameDidChange');\n super.fullNameDidChange();\n changes.push('D fullNameDidChange after super.fullNameDidChange');\n }\n\n triggerSomeEvent(...args) {\n (0, _metal.sendEvent)(this, 'someEvent', args);\n }\n }\n\n assert.deepEqual(calls, [], 'nothing has been called');\n assert.deepEqual(changes, [], 'full has not changed');\n assert.deepEqual(events, [], 'onSomeEvent has not been triggered');\n\n let d = D.create({ first: 'Robert', last: 'Jackson' });\n\n assert.deepEqual(calls, ['D init before super.init', 'C init before _super', 'reopen init before _super', 'B init before super.init', 'Mixin2 init before _super', 'Mixin1 init before _super', 'A init', 'Mixin1 init after _super', 'Mixin2 init after _super', 'B init after super.init', 'reopen init after _super', 'C init after _super', 'D init after super.init']);\n assert.deepEqual(changes, [], 'full has not changed');\n assert.deepEqual(events, [], 'onSomeEvent has not been triggered');\n\n assert.deepEqual(lastProps, {\n first: 'Robert',\n last: 'Jackson'\n });\n\n assert.equal(d.full, 'Robert Jackson');\n\n d.setProperties({ first: 'Kris', last: 'Selden' });\n assert.deepEqual(changes, ['D fullNameDidChange before super.fullNameDidChange', 'B fullNameDidChange', 'D fullNameDidChange after super.fullNameDidChange']);\n\n assert.equal(d.full, 'Kris Selden');\n\n d.triggerSomeEvent('event arg');\n assert.deepEqual(events, ['D onSomeEvent before super.onSomeEvent', 'B onSomeEvent event arg', 'D onSomeEvent after super.onSomeEvent']);\n }\n });\n});","enifed('@ember/-internals/runtime/tests/system/object/events_test', ['@ember/-internals/runtime/lib/system/object', '@ember/-internals/runtime/lib/mixins/evented', 'internal-test-helpers'], function (_object, _evented, _internalTestHelpers) {\n 'use strict';\n\n (0, _internalTestHelpers.moduleFor)('Object events', class extends _internalTestHelpers.AbstractTestCase {\n ['@test a listener can be added to an object'](assert) {\n let count = 0;\n let F = function () {\n count++;\n };\n\n let obj = _object.default.extend(_evented.default).create();\n\n obj.on('event!', F);\n obj.trigger('event!');\n\n assert.equal(count, 1, 'the event was triggered');\n\n obj.trigger('event!');\n\n assert.equal(count, 2, 'the event was triggered');\n }\n\n ['@test a listener can be added and removed automatically the first time it is triggered'](assert) {\n let count = 0;\n let F = function () {\n count++;\n };\n\n let obj = _object.default.extend(_evented.default).create();\n\n obj.one('event!', F);\n obj.trigger('event!');\n\n assert.equal(count, 1, 'the event was triggered');\n\n obj.trigger('event!');\n\n assert.equal(count, 1, 'the event was not triggered again');\n }\n\n ['@test triggering an event can have arguments'](assert) {\n let self, args;\n\n let obj = _object.default.extend(_evented.default).create();\n\n obj.on('event!', function () {\n args = [].slice.call(arguments);\n self = this;\n });\n\n obj.trigger('event!', 'foo', 'bar');\n\n assert.deepEqual(args, ['foo', 'bar']);\n assert.equal(self, obj);\n }\n\n ['@test a listener can be added and removed automatically and have arguments'](assert) {\n let self, args;\n let count = 0;\n\n let obj = _object.default.extend(_evented.default).create();\n\n obj.one('event!', function () {\n args = [].slice.call(arguments);\n self = this;\n count++;\n });\n\n obj.trigger('event!', 'foo', 'bar');\n\n assert.deepEqual(args, ['foo', 'bar']);\n assert.equal(self, obj);\n assert.equal(count, 1, 'the event is triggered once');\n\n obj.trigger('event!', 'baz', 'bat');\n\n assert.deepEqual(args, ['foo', 'bar']);\n assert.equal(count, 1, 'the event was not triggered again');\n assert.equal(self, obj);\n }\n\n ['@test binding an event can specify a different target'](assert) {\n let self, args;\n\n let obj = _object.default.extend(_evented.default).create();\n let target = {};\n\n obj.on('event!', target, function () {\n args = [].slice.call(arguments);\n self = this;\n });\n\n obj.trigger('event!', 'foo', 'bar');\n\n assert.deepEqual(args, ['foo', 'bar']);\n assert.equal(self, target);\n }\n\n ['@test a listener registered with one can take method as string and can be added with different target'](assert) {\n let count = 0;\n let target = {};\n target.fn = function () {\n count++;\n };\n\n let obj = _object.default.extend(_evented.default).create();\n\n obj.one('event!', target, 'fn');\n obj.trigger('event!');\n\n assert.equal(count, 1, 'the event was triggered');\n\n obj.trigger('event!');\n\n assert.equal(count, 1, 'the event was not triggered again');\n }\n\n ['@test a listener registered with one can be removed with off'](assert) {\n let obj = _object.default.extend(_evented.default, {\n F() {}\n }).create();\n let F = function () {};\n\n obj.one('event!', F);\n obj.one('event!', obj, 'F');\n\n assert.equal(obj.has('event!'), true, 'has events');\n\n obj.off('event!', F);\n obj.off('event!', obj, 'F');\n\n assert.equal(obj.has('event!'), false, 'has no more events');\n }\n\n ['@test adding and removing listeners should be chainable'](assert) {\n let obj = _object.default.extend(_evented.default).create();\n let F = function () {};\n\n let ret = obj.on('event!', F);\n assert.equal(ret, obj, '#on returns self');\n\n ret = obj.off('event!', F);\n assert.equal(ret, obj, '#off returns self');\n\n ret = obj.one('event!', F);\n assert.equal(ret, obj, '#one returns self');\n }\n });\n});","enifed('@ember/-internals/runtime/tests/system/object/extend_test', ['@ember/-internals/metal', '@ember/-internals/runtime/lib/system/object', 'internal-test-helpers'], function (_metal, _object, _internalTestHelpers) {\n 'use strict';\n\n (0, _internalTestHelpers.moduleFor)('EmberObject.extend', class extends _internalTestHelpers.AbstractTestCase {\n ['@test Basic extend'](assert) {\n let SomeClass = _object.default.extend({ foo: 'BAR' });\n assert.ok(SomeClass.isClass, 'A class has isClass of true');\n let obj = SomeClass.create();\n assert.equal(obj.foo, 'BAR');\n }\n\n ['@test Sub-subclass'](assert) {\n let SomeClass = _object.default.extend({ foo: 'BAR' });\n let AnotherClass = SomeClass.extend({ bar: 'FOO' });\n let obj = AnotherClass.create();\n assert.equal(obj.foo, 'BAR');\n assert.equal(obj.bar, 'FOO');\n }\n\n ['@test Overriding a method several layers deep'](assert) {\n let SomeClass = _object.default.extend({\n fooCnt: 0,\n foo() {\n this.fooCnt++;\n },\n\n barCnt: 0,\n bar() {\n this.barCnt++;\n }\n });\n\n let AnotherClass = SomeClass.extend({\n barCnt: 0,\n bar() {\n this.barCnt++;\n this._super(...arguments);\n }\n });\n\n let FinalClass = AnotherClass.extend({\n fooCnt: 0,\n foo() {\n this.fooCnt++;\n this._super(...arguments);\n }\n });\n\n let obj = FinalClass.create();\n obj.foo();\n obj.bar();\n assert.equal(obj.fooCnt, 2, 'should invoke both');\n assert.equal(obj.barCnt, 2, 'should invoke both');\n\n // Try overriding on create also\n obj = FinalClass.extend({\n foo() {\n this.fooCnt++;\n this._super(...arguments);\n }\n }).create();\n\n obj.foo();\n obj.bar();\n assert.equal(obj.fooCnt, 3, 'should invoke final as well');\n assert.equal(obj.barCnt, 2, 'should invoke both');\n }\n\n ['@test With concatenatedProperties'](assert) {\n let SomeClass = _object.default.extend({\n things: 'foo',\n concatenatedProperties: ['things']\n });\n let AnotherClass = SomeClass.extend({ things: 'bar' });\n let YetAnotherClass = SomeClass.extend({ things: 'baz' });\n let some = SomeClass.create();\n let another = AnotherClass.create();\n let yetAnother = YetAnotherClass.create();\n assert.deepEqual(some.get('things'), ['foo'], 'base class should have just its value');\n assert.deepEqual(another.get('things'), ['foo', 'bar'], \"subclass should have base class' and its own\");\n assert.deepEqual(yetAnother.get('things'), ['foo', 'baz'], \"subclass should have base class' and its own\");\n }\n\n ['@test With concatenatedProperties class properties'](assert) {\n let SomeClass = _object.default.extend();\n SomeClass.reopenClass({\n concatenatedProperties: ['things'],\n things: 'foo'\n });\n let AnotherClass = SomeClass.extend();\n AnotherClass.reopenClass({ things: 'bar' });\n let YetAnotherClass = SomeClass.extend();\n YetAnotherClass.reopenClass({ things: 'baz' });\n let some = SomeClass.create();\n let another = AnotherClass.create();\n let yetAnother = YetAnotherClass.create();\n assert.deepEqual((0, _metal.get)(some.constructor, 'things'), ['foo'], 'base class should have just its value');\n assert.deepEqual((0, _metal.get)(another.constructor, 'things'), ['foo', 'bar'], \"subclass should have base class' and its own\");\n assert.deepEqual((0, _metal.get)(yetAnother.constructor, 'things'), ['foo', 'baz'], \"subclass should have base class' and its own\");\n }\n\n ['@test Overriding a computed property with an observer'](assert) {\n let Parent = _object.default.extend({\n foo: (0, _metal.computed)(function () {\n return 'FOO';\n })\n });\n\n let seen = [];\n\n let Child = Parent.extend({\n foo: (0, _metal.observer)('bar', function () {\n seen.push(this.get('bar'));\n })\n });\n\n let child = Child.create({ bar: 0 });\n\n assert.deepEqual(seen, []);\n\n child.set('bar', 1);\n\n assert.deepEqual(seen, [1]);\n\n child.set('bar', 2);\n\n assert.deepEqual(seen, [1, 2]);\n }\n });\n});","enifed('@ember/-internals/runtime/tests/system/object/observer_test', ['@ember/runloop', '@ember/-internals/metal', '@ember/-internals/runtime/lib/system/object', 'internal-test-helpers'], function (_runloop, _metal, _object, _internalTestHelpers) {\n 'use strict';\n\n (0, _internalTestHelpers.moduleFor)('EmberObject observer', class extends _internalTestHelpers.AbstractTestCase {\n ['@test observer on class'](assert) {\n let MyClass = _object.default.extend({\n count: 0,\n\n foo: (0, _metal.observer)('bar', function () {\n (0, _metal.set)(this, 'count', (0, _metal.get)(this, 'count') + 1);\n })\n });\n\n let obj = MyClass.create();\n assert.equal((0, _metal.get)(obj, 'count'), 0, 'should not invoke observer immediately');\n\n (0, _metal.set)(obj, 'bar', 'BAZ');\n assert.equal((0, _metal.get)(obj, 'count'), 1, 'should invoke observer after change');\n }\n\n ['@test observer on subclass'](assert) {\n let MyClass = _object.default.extend({\n count: 0,\n\n foo: (0, _metal.observer)('bar', function () {\n (0, _metal.set)(this, 'count', (0, _metal.get)(this, 'count') + 1);\n })\n });\n\n let Subclass = MyClass.extend({\n foo: (0, _metal.observer)('baz', function () {\n (0, _metal.set)(this, 'count', (0, _metal.get)(this, 'count') + 1);\n })\n });\n\n let obj = Subclass.create();\n assert.equal((0, _metal.get)(obj, 'count'), 0, 'should not invoke observer immediately');\n\n (0, _metal.set)(obj, 'bar', 'BAZ');\n assert.equal((0, _metal.get)(obj, 'count'), 0, 'should not invoke observer after change');\n\n (0, _metal.set)(obj, 'baz', 'BAZ');\n assert.equal((0, _metal.get)(obj, 'count'), 1, 'should invoke observer after change');\n }\n\n ['@test observer on instance'](assert) {\n let obj = _object.default.extend({\n foo: (0, _metal.observer)('bar', function () {\n (0, _metal.set)(this, 'count', (0, _metal.get)(this, 'count') + 1);\n })\n }).create({\n count: 0\n });\n\n assert.equal((0, _metal.get)(obj, 'count'), 0, 'should not invoke observer immediately');\n\n (0, _metal.set)(obj, 'bar', 'BAZ');\n assert.equal((0, _metal.get)(obj, 'count'), 1, 'should invoke observer after change');\n }\n\n ['@test observer on instance overriding class'](assert) {\n let MyClass = _object.default.extend({\n count: 0,\n\n foo: (0, _metal.observer)('bar', function () {\n (0, _metal.set)(this, 'count', (0, _metal.get)(this, 'count') + 1);\n })\n });\n\n let obj = MyClass.extend({\n foo: (0, _metal.observer)('baz', function () {\n // <-- change property we observe\n (0, _metal.set)(this, 'count', (0, _metal.get)(this, 'count') + 1);\n })\n }).create();\n\n assert.equal((0, _metal.get)(obj, 'count'), 0, 'should not invoke observer immediately');\n\n (0, _metal.set)(obj, 'bar', 'BAZ');\n assert.equal((0, _metal.get)(obj, 'count'), 0, 'should not invoke observer after change');\n\n (0, _metal.set)(obj, 'baz', 'BAZ');\n assert.equal((0, _metal.get)(obj, 'count'), 1, 'should invoke observer after change');\n }\n\n ['@test observer should not fire after being destroyed'](assert) {\n let obj = _object.default.extend({\n count: 0,\n foo: (0, _metal.observer)('bar', function () {\n (0, _metal.set)(this, 'count', (0, _metal.get)(this, 'count') + 1);\n })\n }).create();\n\n assert.equal((0, _metal.get)(obj, 'count'), 0, 'precond - should not invoke observer immediately');\n\n (0, _runloop.run)(() => obj.destroy());\n\n expectAssertion(function () {\n (0, _metal.set)(obj, 'bar', 'BAZ');\n }, `calling set on destroyed object: ${obj}.bar = BAZ`);\n\n assert.equal((0, _metal.get)(obj, 'count'), 0, 'should not invoke observer after change');\n }\n\n // ..........................................................\n // COMPLEX PROPERTIES\n //\n\n ['@test chain observer on class'](assert) {\n let MyClass = _object.default.extend({\n count: 0,\n\n foo: (0, _metal.observer)('bar.baz', function () {\n (0, _metal.set)(this, 'count', (0, _metal.get)(this, 'count') + 1);\n })\n });\n\n let obj1 = MyClass.create({\n bar: { baz: 'biff' }\n });\n\n let obj2 = MyClass.create({\n bar: { baz: 'biff2' }\n });\n\n assert.equal((0, _metal.get)(obj1, 'count'), 0, 'should not invoke yet');\n assert.equal((0, _metal.get)(obj2, 'count'), 0, 'should not invoke yet');\n\n (0, _metal.set)((0, _metal.get)(obj1, 'bar'), 'baz', 'BIFF1');\n assert.equal((0, _metal.get)(obj1, 'count'), 1, 'should invoke observer on obj1');\n assert.equal((0, _metal.get)(obj2, 'count'), 0, 'should not invoke yet');\n\n (0, _metal.set)((0, _metal.get)(obj2, 'bar'), 'baz', 'BIFF2');\n assert.equal((0, _metal.get)(obj1, 'count'), 1, 'should not invoke again');\n assert.equal((0, _metal.get)(obj2, 'count'), 1, 'should invoke observer on obj2');\n }\n\n ['@test chain observer on class'](assert) {\n let MyClass = _object.default.extend({\n count: 0,\n\n foo: (0, _metal.observer)('bar.baz', function () {\n (0, _metal.set)(this, 'count', (0, _metal.get)(this, 'count') + 1);\n })\n });\n\n let obj1 = MyClass.extend().create({\n bar: { baz: 'biff' }\n });\n\n let obj2 = MyClass.extend({\n foo: (0, _metal.observer)('bar2.baz', function () {\n (0, _metal.set)(this, 'count', (0, _metal.get)(this, 'count') + 1);\n })\n }).create({\n bar: { baz: 'biff2' },\n bar2: { baz: 'biff3' }\n });\n\n assert.equal((0, _metal.get)(obj1, 'count'), 0, 'should not invoke yet');\n assert.equal((0, _metal.get)(obj2, 'count'), 0, 'should not invoke yet');\n\n (0, _metal.set)((0, _metal.get)(obj1, 'bar'), 'baz', 'BIFF1');\n assert.equal((0, _metal.get)(obj1, 'count'), 1, 'should invoke observer on obj1');\n assert.equal((0, _metal.get)(obj2, 'count'), 0, 'should not invoke yet');\n\n (0, _metal.set)((0, _metal.get)(obj2, 'bar'), 'baz', 'BIFF2');\n assert.equal((0, _metal.get)(obj1, 'count'), 1, 'should not invoke again');\n assert.equal((0, _metal.get)(obj2, 'count'), 0, 'should not invoke yet');\n\n (0, _metal.set)((0, _metal.get)(obj2, 'bar2'), 'baz', 'BIFF3');\n assert.equal((0, _metal.get)(obj1, 'count'), 1, 'should not invoke again');\n assert.equal((0, _metal.get)(obj2, 'count'), 1, 'should invoke observer on obj2');\n }\n\n ['@test chain observer on class that has a reference to an uninitialized object will finish chains that reference it'](assert) {\n let changed = false;\n\n let ChildClass = _object.default.extend({\n parent: null,\n parentOneTwoDidChange: (0, _metal.observer)('parent.one.two', function () {\n changed = true;\n })\n });\n\n let ParentClass = _object.default.extend({\n one: {\n two: 'old'\n },\n init() {\n this.child = ChildClass.create({\n parent: this\n });\n }\n });\n\n let parent = ParentClass.create();\n\n assert.equal(changed, false, 'precond');\n\n (0, _metal.set)(parent, 'one.two', 'new');\n\n assert.equal(changed, true, 'child should have been notified of change to path');\n\n (0, _metal.set)(parent, 'one', { two: 'newer' });\n\n assert.equal(changed, true, 'child should have been notified of change to path');\n }\n });\n});","enifed('@ember/-internals/runtime/tests/system/object/reopenClass_test', ['@ember/-internals/metal', '@ember/-internals/runtime/lib/system/object', 'internal-test-helpers'], function (_metal, _object, _internalTestHelpers) {\n 'use strict';\n\n (0, _internalTestHelpers.moduleFor)('system/object/reopenClass', class extends _internalTestHelpers.AbstractTestCase {\n ['@test adds new properties to subclass'](assert) {\n let Subclass = _object.default.extend();\n Subclass.reopenClass({\n foo() {\n return 'FOO';\n },\n bar: 'BAR'\n });\n\n assert.equal(Subclass.foo(), 'FOO', 'Adds method');\n assert.equal((0, _metal.get)(Subclass, 'bar'), 'BAR', 'Adds property');\n }\n\n ['@test class properties inherited by subclasses'](assert) {\n let Subclass = _object.default.extend();\n Subclass.reopenClass({\n foo() {\n return 'FOO';\n },\n bar: 'BAR'\n });\n\n let SubSub = Subclass.extend();\n\n assert.equal(SubSub.foo(), 'FOO', 'Adds method');\n assert.equal((0, _metal.get)(SubSub, 'bar'), 'BAR', 'Adds property');\n }\n });\n});","enifed('@ember/-internals/runtime/tests/system/object/reopen_test', ['@ember/-internals/metal', '@ember/-internals/runtime/lib/system/object', 'internal-test-helpers'], function (_metal, _object, _internalTestHelpers) {\n 'use strict';\n\n (0, _internalTestHelpers.moduleFor)('system/core_object/reopen', class extends _internalTestHelpers.AbstractTestCase {\n ['@test adds new properties to subclass instance'](assert) {\n let Subclass = _object.default.extend();\n Subclass.reopen({\n foo() {\n return 'FOO';\n },\n bar: 'BAR'\n });\n\n assert.equal(Subclass.create().foo(), 'FOO', 'Adds method');\n assert.equal((0, _metal.get)(Subclass.create(), 'bar'), 'BAR', 'Adds property');\n }\n\n ['@test reopened properties inherited by subclasses'](assert) {\n let Subclass = _object.default.extend();\n let SubSub = Subclass.extend();\n\n Subclass.reopen({\n foo() {\n return 'FOO';\n },\n bar: 'BAR'\n });\n\n assert.equal(SubSub.create().foo(), 'FOO', 'Adds method');\n assert.equal((0, _metal.get)(SubSub.create(), 'bar'), 'BAR', 'Adds property');\n }\n\n ['@test allows reopening already instantiated classes'](assert) {\n let Subclass = _object.default.extend();\n\n Subclass.create();\n\n Subclass.reopen({\n trololol: true\n });\n\n assert.equal(Subclass.create().get('trololol'), true, 'reopen works');\n }\n });\n});","enifed('@ember/-internals/runtime/tests/system/object/strict-mode-test', ['@ember/-internals/runtime/lib/system/object', 'internal-test-helpers'], function (_object, _internalTestHelpers) {\n 'use strict';\n\n (0, _internalTestHelpers.moduleFor)('strict mode tests', class extends _internalTestHelpers.AbstractTestCase {\n ['@test __superWrapper does not throw errors in strict mode'](assert) {\n let Foo = _object.default.extend({\n blah() {\n return 'foo';\n }\n });\n\n let Bar = Foo.extend({\n blah() {\n return 'bar';\n },\n\n callBlah() {\n let blah = this.blah;\n\n return blah();\n }\n });\n\n let bar = Bar.create();\n\n assert.equal(bar.callBlah(), 'bar', 'can call local function without call/apply');\n }\n });\n});","enifed('@ember/-internals/runtime/tests/system/object/toString_test', ['@ember/runloop', '@ember/-internals/utils', '@ember/-internals/environment', '@ember/-internals/runtime/lib/system/object', '@ember/-internals/runtime/lib/system/namespace', 'internal-test-helpers'], function (_runloop, _utils, _environment, _object, _namespace, _internalTestHelpers) {\n 'use strict';\n\n let originalLookup = _environment.context.lookup;\n let lookup;\n\n (0, _internalTestHelpers.moduleFor)('system/object/toString', class extends _internalTestHelpers.AbstractTestCase {\n beforeEach() {\n _environment.context.lookup = lookup = {};\n }\n\n afterEach() {\n _environment.context.lookup = originalLookup;\n }\n\n ['@test toString() returns the same value if called twice'](assert) {\n let Foo = _namespace.default.create();\n Foo.toString = function () {\n return 'Foo';\n };\n\n Foo.Bar = _object.default.extend();\n\n assert.equal(Foo.Bar.toString(), 'Foo.Bar');\n assert.equal(Foo.Bar.toString(), 'Foo.Bar');\n\n let obj = Foo.Bar.create();\n\n assert.equal(obj.toString(), '');\n assert.equal(obj.toString(), '');\n\n assert.equal(Foo.Bar.toString(), 'Foo.Bar');\n\n (0, _runloop.run)(Foo, 'destroy');\n }\n\n ['@test toString on a class returns a useful value when nested in a namespace'](assert) {\n let obj;\n\n let Foo = _namespace.default.create();\n Foo.toString = function () {\n return 'Foo';\n };\n\n Foo.Bar = _object.default.extend();\n assert.equal(Foo.Bar.toString(), 'Foo.Bar');\n\n obj = Foo.Bar.create();\n assert.equal(obj.toString(), '');\n\n Foo.Baz = Foo.Bar.extend();\n assert.equal(Foo.Baz.toString(), 'Foo.Baz');\n\n obj = Foo.Baz.create();\n assert.equal(obj.toString(), '');\n\n obj = Foo.Bar.create();\n assert.equal(obj.toString(), '');\n\n (0, _runloop.run)(Foo, 'destroy');\n }\n\n ['@test toString on a namespace finds the namespace in lookup'](assert) {\n let Foo = lookup.Foo = _namespace.default.create();\n\n assert.equal(Foo.toString(), 'Foo');\n\n (0, _runloop.run)(Foo, 'destroy');\n }\n\n ['@test toString on a namespace finds the namespace in lookup'](assert) {\n let Foo = lookup.Foo = _namespace.default.create();\n let obj;\n\n Foo.Bar = _object.default.extend();\n\n assert.equal(Foo.Bar.toString(), 'Foo.Bar');\n\n obj = Foo.Bar.create();\n assert.equal(obj.toString(), '');\n\n (0, _runloop.run)(Foo, 'destroy');\n }\n\n ['@test toString on a namespace falls back to modulePrefix, if defined'](assert) {\n let Foo = _namespace.default.create({ modulePrefix: 'foo' });\n\n assert.equal(Foo.toString(), 'foo');\n\n (0, _runloop.run)(Foo, 'destroy');\n }\n\n ['@test toString includes toStringExtension if defined'](assert) {\n let Foo = _object.default.extend({\n toStringExtension() {\n return 'fooey';\n }\n });\n let foo = Foo.create();\n let Bar = _object.default.extend({});\n let bar = Bar.create();\n\n // simulate these classes being defined on a Namespace\n (0, _utils.setName)(Foo, 'Foo');\n (0, _utils.setName)(Bar, 'Bar');\n\n assert.equal(bar.toString(), '', 'does not include toStringExtension part');\n assert.equal(foo.toString(), '', 'Includes toStringExtension result');\n }\n });\n});","enifed('@ember/-internals/runtime/tests/system/object_proxy_test', ['@ember/-internals/metal', '@ember/-internals/utils', '@ember/-internals/runtime/lib/system/object_proxy', 'internal-test-helpers'], function (_metal, _utils, _object_proxy, _internalTestHelpers) {\n 'use strict';\n\n (0, _internalTestHelpers.moduleFor)('ObjectProxy', class extends _internalTestHelpers.AbstractTestCase {\n ['@test should not proxy properties passed to create'](assert) {\n let Proxy = _object_proxy.default.extend({\n cp: (0, _metal.computed)({\n get() {\n return this._cp;\n },\n set(key, value) {\n this._cp = value;\n return this._cp;\n }\n })\n });\n let proxy = Proxy.create({\n prop: 'Foo',\n cp: 'Bar'\n });\n\n assert.equal((0, _metal.get)(proxy, 'prop'), 'Foo', 'should not have tried to proxy set');\n assert.equal(proxy._cp, 'Bar', 'should use CP setter');\n }\n\n ['@test should proxy properties to content'](assert) {\n let content = {\n firstName: 'Tom',\n lastName: 'Dale',\n unknownProperty(key) {\n return key + ' unknown';\n }\n };\n let proxy = _object_proxy.default.create();\n\n assert.equal((0, _metal.get)(proxy, 'firstName'), undefined, 'get on proxy without content should return undefined');\n expectAssertion(() => {\n (0, _metal.set)(proxy, 'firstName', 'Foo');\n }, /Cannot delegate set\\('firstName', Foo\\) to the 'content'/i);\n\n (0, _metal.set)(proxy, 'content', content);\n\n assert.equal((0, _metal.get)(proxy, 'firstName'), 'Tom', 'get on proxy with content should forward to content');\n assert.equal((0, _metal.get)(proxy, 'lastName'), 'Dale', 'get on proxy with content should forward to content');\n assert.equal((0, _metal.get)(proxy, 'foo'), 'foo unknown', 'get on proxy with content should forward to content');\n\n (0, _metal.set)(proxy, 'lastName', 'Huda');\n\n assert.equal((0, _metal.get)(content, 'lastName'), 'Huda', 'content should have new value from set on proxy');\n assert.equal((0, _metal.get)(proxy, 'lastName'), 'Huda', 'proxy should have new value from set on proxy');\n\n (0, _metal.set)(proxy, 'content', { firstName: 'Yehuda', lastName: 'Katz' });\n\n assert.equal((0, _metal.get)(proxy, 'firstName'), 'Yehuda', 'proxy should reflect updated content');\n assert.equal((0, _metal.get)(proxy, 'lastName'), 'Katz', 'proxy should reflect updated content');\n }\n\n ['@test getting proxied properties with Ember.get should work'](assert) {\n let proxy = _object_proxy.default.create({\n content: {\n foo: 'FOO'\n }\n });\n\n assert.equal((0, _metal.get)(proxy, 'foo'), 'FOO');\n }\n\n [`@test JSON.stringify doens't assert`](assert) {\n let proxy = _object_proxy.default.create({\n content: {\n foo: 'FOO'\n }\n });\n\n assert.equal(JSON.stringify(proxy), JSON.stringify({ content: { foo: 'FOO' } }));\n }\n\n ['@test calling a function on the proxy avoids the assertion'](assert) {\n if (true /* DEBUG */ && _utils.HAS_NATIVE_PROXY) {\n let proxy = _object_proxy.default.extend({\n init() {\n if (!this.foobar) {\n this.foobar = function () {\n let content = (0, _metal.get)(this, 'content');\n return content.foobar.apply(content, []);\n };\n }\n }\n }).create({\n content: {\n foobar() {\n return 'xoxo';\n }\n }\n });\n\n assert.equal(proxy.foobar(), 'xoxo', 'should be able to use a function from a proxy');\n } else {\n assert.expect(0);\n }\n }\n\n [`@test setting a property on the proxy avoids the assertion`](assert) {\n let proxy = _object_proxy.default.create({\n toJSON: undefined,\n content: {\n toJSON() {\n return 'hello';\n }\n }\n });\n\n assert.equal(JSON.stringify(proxy), JSON.stringify({ content: 'hello' }));\n }\n\n [`@test setting a property on the proxy's prototype avoids the assertion`](assert) {\n let proxy = _object_proxy.default.extend({\n toJSON: null\n }).create({\n content: {\n toJSON() {\n return 'hello';\n }\n }\n });\n\n assert.equal(JSON.stringify(proxy), JSON.stringify({ content: 'hello' }));\n }\n\n ['@test getting proxied properties with [] should be an error'](assert) {\n if (true /* DEBUG */ && _utils.HAS_NATIVE_PROXY) {\n let proxy = _object_proxy.default.create({\n content: {\n foo: 'FOO'\n }\n });\n\n expectAssertion(() => proxy.foo, /\\.get\\('foo'\\)/);\n } else {\n assert.expect(0);\n }\n }\n\n ['@test should work with watched properties'](assert) {\n let content1 = { firstName: 'Tom', lastName: 'Dale' };\n let content2 = { firstName: 'Yehuda', lastName: 'Katz' };\n let count = 0;\n let last;\n\n let Proxy = _object_proxy.default.extend({\n fullName: (0, _metal.computed)(function () {\n let firstName = this.get('firstName');\n let lastName = this.get('lastName');\n\n if (firstName && lastName) {\n return firstName + ' ' + lastName;\n }\n return firstName || lastName;\n }).property('firstName', 'lastName')\n });\n\n let proxy = Proxy.create();\n\n (0, _metal.addObserver)(proxy, 'fullName', function () {\n last = (0, _metal.get)(proxy, 'fullName');\n count++;\n });\n\n // proxy without content returns undefined\n assert.equal((0, _metal.get)(proxy, 'fullName'), undefined);\n\n // setting content causes all watched properties to change\n (0, _metal.set)(proxy, 'content', content1);\n // both dependent keys changed\n assert.equal(count, 2);\n assert.equal(last, 'Tom Dale');\n\n // setting property in content causes proxy property to change\n (0, _metal.set)(content1, 'lastName', 'Huda');\n assert.equal(count, 3);\n assert.equal(last, 'Tom Huda');\n\n // replacing content causes all watched properties to change\n (0, _metal.set)(proxy, 'content', content2);\n // both dependent keys changed\n assert.equal(count, 5);\n assert.equal(last, 'Yehuda Katz');\n // content1 is no longer watched\n assert.ok(!(0, _metal.isWatching)(content1, 'firstName'), 'not watching firstName');\n assert.ok(!(0, _metal.isWatching)(content1, 'lastName'), 'not watching lastName');\n\n // setting property in new content\n (0, _metal.set)(content2, 'firstName', 'Tomhuda');\n assert.equal(last, 'Tomhuda Katz');\n assert.equal(count, 6);\n\n // setting property in proxy syncs with new content\n (0, _metal.set)(proxy, 'lastName', 'Katzdale');\n assert.equal(count, 7);\n assert.equal(last, 'Tomhuda Katzdale');\n assert.equal((0, _metal.get)(content2, 'firstName'), 'Tomhuda');\n assert.equal((0, _metal.get)(content2, 'lastName'), 'Katzdale');\n }\n\n ['@test set and get should work with paths'](assert) {\n let content = { foo: { bar: 'baz' } };\n let proxy = _object_proxy.default.create({ content });\n let count = 0;\n\n proxy.set('foo.bar', 'hello');\n assert.equal(proxy.get('foo.bar'), 'hello');\n assert.equal(proxy.get('content.foo.bar'), 'hello');\n\n proxy.addObserver('foo.bar', function () {\n count++;\n });\n\n proxy.set('foo.bar', 'bye');\n\n assert.equal(count, 1);\n assert.equal(proxy.get('foo.bar'), 'bye');\n assert.equal(proxy.get('content.foo.bar'), 'bye');\n }\n\n ['@test should transition between watched and unwatched strategies'](assert) {\n let content = { foo: 'foo' };\n let proxy = _object_proxy.default.create({ content: content });\n let count = 0;\n\n function observer() {\n count++;\n }\n\n assert.equal((0, _metal.get)(proxy, 'foo'), 'foo');\n\n (0, _metal.set)(content, 'foo', 'bar');\n\n assert.equal((0, _metal.get)(proxy, 'foo'), 'bar');\n\n (0, _metal.set)(proxy, 'foo', 'foo');\n\n assert.equal((0, _metal.get)(content, 'foo'), 'foo');\n assert.equal((0, _metal.get)(proxy, 'foo'), 'foo');\n\n (0, _metal.addObserver)(proxy, 'foo', observer);\n\n assert.equal(count, 0);\n assert.equal((0, _metal.get)(proxy, 'foo'), 'foo');\n\n (0, _metal.set)(content, 'foo', 'bar');\n\n assert.equal(count, 1);\n assert.equal((0, _metal.get)(proxy, 'foo'), 'bar');\n\n (0, _metal.set)(proxy, 'foo', 'foo');\n\n assert.equal(count, 2);\n assert.equal((0, _metal.get)(content, 'foo'), 'foo');\n assert.equal((0, _metal.get)(proxy, 'foo'), 'foo');\n\n (0, _metal.removeObserver)(proxy, 'foo', observer);\n\n (0, _metal.set)(content, 'foo', 'bar');\n\n assert.equal((0, _metal.get)(proxy, 'foo'), 'bar');\n\n (0, _metal.set)(proxy, 'foo', 'foo');\n\n assert.equal((0, _metal.get)(content, 'foo'), 'foo');\n assert.equal((0, _metal.get)(proxy, 'foo'), 'foo');\n }\n\n ['@test setting `undefined` to a proxied content property should override its existing value'](assert) {\n let proxyObject = _object_proxy.default.create({\n content: {\n prop: 'emberjs'\n }\n });\n (0, _metal.set)(proxyObject, 'prop', undefined);\n assert.equal((0, _metal.get)(proxyObject, 'prop'), undefined, 'sets the `undefined` value to the proxied content');\n }\n });\n});","enifed('@ember/-internals/utils/tests/cache_test', ['@ember/-internals/utils', 'internal-test-helpers'], function (_utils, _internalTestHelpers) {\n 'use strict';\n\n (0, _internalTestHelpers.moduleFor)('Cache', class extends _internalTestHelpers.AbstractTestCase {\n ['@test basic'](assert) {\n let cache = new _utils.Cache(100, key => key.toUpperCase());\n\n assert.equal(cache.get('foo'), 'FOO');\n assert.equal(cache.get('bar'), 'BAR');\n assert.equal(cache.get('foo'), 'FOO');\n }\n\n ['@test explicit sets'](assert) {\n let cache = new _utils.Cache(100, key => key.toUpperCase());\n\n assert.equal(cache.get('foo'), 'FOO');\n\n assert.equal(cache.set('foo', 'FOO!!!'), 'FOO!!!');\n\n assert.equal(cache.get('foo'), 'FOO!!!');\n\n assert.strictEqual(cache.set('foo', undefined), undefined);\n\n assert.strictEqual(cache.get('foo'), undefined);\n }\n\n ['@test caches computation correctly'](assert) {\n let count = 0;\n let cache = new _utils.Cache(100, key => {\n count++;\n return key.toUpperCase();\n });\n\n assert.equal(count, 0);\n cache.get('foo');\n assert.equal(count, 1);\n cache.get('bar');\n assert.equal(count, 2);\n cache.get('bar');\n assert.equal(count, 2);\n cache.get('foo');\n assert.equal(count, 2);\n }\n\n ['@test handles undefined value correctly'](assert) {\n let count = 0;\n let cache = new _utils.Cache(100, () => {\n count++;\n });\n\n assert.equal(count, 0);\n assert.strictEqual(cache.get('foo'), undefined);\n assert.equal(count, 1);\n assert.strictEqual(cache.get('bar'), undefined);\n assert.equal(count, 2);\n assert.strictEqual(cache.get('bar'), undefined);\n assert.equal(count, 2);\n assert.strictEqual(cache.get('foo'), undefined);\n assert.equal(count, 2);\n }\n\n ['@test continues working after reaching cache limit'](assert) {\n let cache = new _utils.Cache(3, key => key.toUpperCase());\n\n cache.get('a');\n cache.get('b');\n cache.get('c');\n\n assert.equal(cache.get('d'), 'D');\n assert.equal(cache.get('a'), 'A');\n assert.equal(cache.get('b'), 'B');\n assert.equal(cache.get('c'), 'C');\n }\n });\n});","enifed('@ember/-internals/utils/tests/can_invoke_test', ['@ember/-internals/utils', 'internal-test-helpers'], function (_utils, _internalTestHelpers) {\n 'use strict';\n\n let obj;\n\n (0, _internalTestHelpers.moduleFor)('Ember.canInvoke', class extends _internalTestHelpers.AbstractTestCase {\n constructor() {\n super();\n\n obj = {\n foobar: 'foobar',\n aMethodThatExists() {}\n };\n }\n\n teardown() {\n obj = undefined;\n }\n\n [\"@test should return false if the object doesn't exist\"](assert) {\n assert.equal((0, _utils.canInvoke)(undefined, 'aMethodThatDoesNotExist'), false);\n }\n\n ['@test should return true for falsy values that have methods'](assert) {\n assert.equal((0, _utils.canInvoke)(false, 'valueOf'), true);\n assert.equal((0, _utils.canInvoke)('', 'charAt'), true);\n assert.equal((0, _utils.canInvoke)(0, 'toFixed'), true);\n }\n\n ['@test should return true if the method exists on the object'](assert) {\n assert.equal((0, _utils.canInvoke)(obj, 'aMethodThatExists'), true);\n }\n\n [\"@test should return false if the method doesn't exist on the object\"](assert) {\n assert.equal((0, _utils.canInvoke)(obj, 'aMethodThatDoesNotExist'), false);\n }\n\n ['@test should return false if the property exists on the object but is a non-function'](assert) {\n assert.equal((0, _utils.canInvoke)(obj, 'foobar'), false);\n }\n });\n});","enifed('@ember/-internals/utils/tests/checkHasSuper_test', ['@ember/-internals/browser-environment', '@ember/-internals/utils', 'internal-test-helpers'], function (_browserEnvironment, _utils, _internalTestHelpers) {\n 'use strict';\n\n // Only run this test on browsers that we are certain should have function\n // source available. This allows the test suite to continue to pass on other\n // platforms that correctly (for them) fall back to the \"always wrap\" code.\n if (_browserEnvironment.isChrome || _browserEnvironment.isFirefox) {\n (0, _internalTestHelpers.moduleFor)('checkHasSuper', class extends _internalTestHelpers.AbstractTestCase {\n ['@test does not super wrap needlessly [GH #12462]'](assert) {\n assert.notOk((0, _utils.checkHasSuper)(function () {}), 'empty function does not have super');\n }\n });\n }\n});","enifed('@ember/-internals/utils/tests/generate_guid_test', ['@ember/-internals/utils', 'internal-test-helpers'], function (_utils, _internalTestHelpers) {\n 'use strict';\n\n (0, _internalTestHelpers.moduleFor)('Ember.generateGuid', class extends _internalTestHelpers.AbstractTestCase {\n ['@test Prefix'](assert) {\n let a = {};\n\n assert.ok((0, _utils.generateGuid)(a, 'tyrell').indexOf('tyrell') > -1, 'guid can be prefixed');\n }\n });\n});","enifed('@ember/-internals/utils/tests/guid_for_test', ['@ember/-internals/utils', 'internal-test-helpers'], function (_utils, _internalTestHelpers) {\n 'use strict';\n\n function sameGuid(assert, a, b, message) {\n assert.equal((0, _utils.guidFor)(a), (0, _utils.guidFor)(b), message);\n }\n\n function diffGuid(assert, a, b, message) {\n assert.ok((0, _utils.guidFor)(a) !== (0, _utils.guidFor)(b), message);\n }\n\n function nanGuid(assert, obj) {\n let type = typeof obj;\n assert.ok(isNaN(parseInt((0, _utils.guidFor)(obj), 0)), 'guids for ' + type + \"don't parse to numbers\");\n }\n\n (0, _internalTestHelpers.moduleFor)('guidFor', class extends _internalTestHelpers.AbstractTestCase {\n ['@test Object'](assert) {\n let a = {};\n let b = {};\n\n sameGuid(assert, a, a, 'same object always yields same guid');\n diffGuid(assert, a, b, 'different objects yield different guids');\n nanGuid(assert, a);\n }\n\n ['@test strings'](assert) {\n let a = 'string A';\n let aprime = 'string A';\n let b = 'String B';\n\n sameGuid(assert, a, a, 'same string always yields same guid');\n sameGuid(assert, a, aprime, 'identical strings always yield the same guid');\n diffGuid(assert, a, b, 'different strings yield different guids');\n nanGuid(assert, a);\n }\n\n ['@test numbers'](assert) {\n let a = 23;\n let aprime = 23;\n let b = 34;\n\n sameGuid(assert, a, a, 'same numbers always yields same guid');\n sameGuid(assert, a, aprime, 'identical numbers always yield the same guid');\n diffGuid(assert, a, b, 'different numbers yield different guids');\n nanGuid(assert, a);\n }\n\n ['@test symbols'](assert) {\n if (typeof Symbol === 'undefined') {\n assert.ok(true, 'symbols are not supported on this browser');\n return;\n }\n\n let a = Symbol('a');\n let b = Symbol('b');\n\n sameGuid(assert, a, a, 'same symbols always yields same guid');\n diffGuid(assert, a, b, 'different symbols yield different guids');\n nanGuid(assert, a);\n }\n\n ['@test booleans'](assert) {\n let a = true;\n let aprime = true;\n let b = false;\n\n sameGuid(assert, a, a, 'same booleans always yields same guid');\n sameGuid(assert, a, aprime, 'identical booleans always yield the same guid');\n diffGuid(assert, a, b, 'different boolean yield different guids');\n nanGuid(assert, a);\n nanGuid(assert, b);\n }\n\n ['@test null and undefined'](assert) {\n let a = null;\n let aprime = null;\n let b;\n\n sameGuid(assert, a, a, 'null always returns the same guid');\n sameGuid(assert, b, b, 'undefined always returns the same guid');\n sameGuid(assert, a, aprime, 'different nulls return the same guid');\n diffGuid(assert, a, b, 'null and undefined return different guids');\n nanGuid(assert, a);\n nanGuid(assert, b);\n }\n\n ['@test arrays'](assert) {\n let a = ['a', 'b', 'c'];\n let aprime = ['a', 'b', 'c'];\n let b = ['1', '2', '3'];\n\n sameGuid(assert, a, a, 'same instance always yields same guid');\n diffGuid(assert, a, aprime, 'identical arrays always yield the same guid');\n diffGuid(assert, a, b, 'different arrays yield different guids');\n nanGuid(assert, a);\n }\n });\n});","enifed('@ember/-internals/utils/tests/inspect_test', ['@ember/-internals/utils', 'internal-test-helpers'], function (_utils, _internalTestHelpers) {\n 'use strict';\n\n (0, _internalTestHelpers.moduleFor)('Ember.inspect', class extends _internalTestHelpers.AbstractTestCase {\n ['@test strings'](assert) {\n assert.equal((0, _utils.inspect)('foo'), '\"foo\"');\n }\n\n ['@test numbers'](assert) {\n assert.equal((0, _utils.inspect)(2.6), '2.6');\n }\n\n ['@test null'](assert) {\n assert.equal((0, _utils.inspect)(null), 'null');\n }\n\n ['@test undefined'](assert) {\n assert.equal((0, _utils.inspect)(undefined), 'undefined');\n }\n\n ['@test true'](assert) {\n assert.equal((0, _utils.inspect)(true), 'true');\n }\n\n ['@test false'](assert) {\n assert.equal((0, _utils.inspect)(false), 'false');\n }\n\n ['@test object'](assert) {\n assert.equal((0, _utils.inspect)({}), '{ }');\n assert.equal((0, _utils.inspect)({ foo: 'bar' }), '{ foo: \"bar\" }');\n let obj = {\n foo() {\n return this;\n }\n };\n // IE 11 doesn't have function name\n if (obj.foo.name) {\n assert.equal((0, _utils.inspect)(obj), `{ foo: [Function:foo] }`);\n } else {\n assert.equal((0, _utils.inspect)(obj), `{ foo: [Function] }`);\n }\n }\n\n ['@test objects without a prototype'](assert) {\n let prototypelessObj = Object.create(null);\n prototypelessObj.a = 1;\n prototypelessObj.b = [Object.create(null)];\n assert.equal((0, _utils.inspect)({ foo: prototypelessObj }), '{ foo: { a: 1, b: [ { } ] } }');\n }\n\n ['@test array'](assert) {\n assert.equal((0, _utils.inspect)([1, 2, 3]), '[ 1, 2, 3 ]');\n }\n\n ['@test array list limit'](assert) {\n let a = [];\n for (let i = 0; i < 120; i++) {\n a.push(1);\n }\n assert.equal((0, _utils.inspect)(a), `[ ${a.slice(0, 100).join(', ')}, ... 20 more items ]`);\n }\n\n ['@test object list limit'](assert) {\n let obj = {};\n let pairs = [];\n for (let i = 0; i < 120; i++) {\n obj['key' + i] = i;\n pairs.push(`key${i}: ${i}`);\n }\n assert.equal((0, _utils.inspect)(obj), `{ ${pairs.slice(0, 100).join(', ')}, ... 20 more keys }`);\n }\n\n ['@test depth limit'](assert) {\n assert.equal((0, _utils.inspect)([[[['here', { a: 1 }, [1]]]]]), '[ [ [ [ \"here\", [Object], [Array] ] ] ] ]');\n }\n\n ['@test odd key'](assert) {\n assert.equal((0, _utils.inspect)({\n [`Hello world!\nHow are you?`]: 1\n }), '{ \"Hello world!\\\\nHow are you?\": 1 }');\n }\n\n ['@test node call'](assert) {\n let obj = { a: 1 };\n obj.inspect = _utils.inspect;\n let depth = 2;\n let options = {};\n assert.equal(obj.inspect(depth, options), obj);\n }\n\n ['@test cycle'](assert) {\n let obj = {};\n obj.a = obj;\n let arr = [obj];\n arr.push(arr);\n assert.equal((0, _utils.inspect)(arr), '[ { a: [Circular] }, [Circular] ]');\n }\n\n ['@test custom toString'](assert) {\n class Component {\n static toString() {\n return '@ember/component';\n }\n\n toString() {\n return `<${this.constructor}:ember234>`;\n }\n }\n\n assert.equal((0, _utils.inspect)([new Component(), Component]), '[ <@ember/component:ember234>, @ember/component ]');\n }\n\n ['@test regexp'](assert) {\n assert.equal((0, _utils.inspect)(/regexp/), '/regexp/');\n }\n\n ['@test date'](assert) {\n let inspected = (0, _utils.inspect)(new Date('Sat Apr 30 2011 13:24:11'));\n assert.ok(inspected.match(/Sat Apr 30/), 'The inspected date has its date');\n assert.ok(inspected.match(/2011/), 'The inspected date has its year');\n assert.ok(inspected.match(/13:24:11/), 'The inspected date has its time');\n }\n\n ['@test inspect outputs the toString() representation of Symbols'](assert) {\n if (_utils.HAS_NATIVE_SYMBOL) {\n let symbol = Symbol('test');\n assert.equal((0, _utils.inspect)(symbol), 'Symbol(test)');\n } else {\n assert.expect(0);\n }\n }\n });\n});","enifed('@ember/-internals/utils/tests/is_proxy_test', ['@ember/-internals/utils', 'internal-test-helpers'], function (_utils, _internalTestHelpers) {\n 'use strict';\n\n (0, _internalTestHelpers.moduleFor)('@ember/-internals/utils isProxy', class extends _internalTestHelpers.AbstractTestCase {\n ['@test basic'](assert) {\n let proxy = {};\n (0, _utils.setProxy)(proxy);\n\n assert.equal((0, _utils.isProxy)(proxy), true);\n\n assert.equal((0, _utils.isProxy)({}), false);\n assert.equal((0, _utils.isProxy)(undefined), false);\n assert.equal((0, _utils.isProxy)(null), false);\n }\n });\n});","enifed('@ember/-internals/utils/tests/make_array_test', ['@ember/-internals/utils', 'internal-test-helpers'], function (_utils, _internalTestHelpers) {\n 'use strict';\n\n (0, _internalTestHelpers.moduleFor)('Ember.makeArray', class extends _internalTestHelpers.AbstractTestCase {\n ['@test undefined'](assert) {\n assert.deepEqual((0, _utils.makeArray)(), []);\n assert.deepEqual((0, _utils.makeArray)(undefined), []);\n }\n\n ['@test null'](assert) {\n assert.deepEqual((0, _utils.makeArray)(null), []);\n }\n\n ['@test string'](assert) {\n assert.deepEqual((0, _utils.makeArray)('lindsay'), ['lindsay']);\n }\n\n ['@test number'](assert) {\n assert.deepEqual((0, _utils.makeArray)(0), [0]);\n assert.deepEqual((0, _utils.makeArray)(1), [1]);\n }\n\n ['@test array'](assert) {\n assert.deepEqual((0, _utils.makeArray)([1, 2, 42]), [1, 2, 42]);\n }\n\n ['@test true'](assert) {\n assert.deepEqual((0, _utils.makeArray)(true), [true]);\n }\n\n ['@test false'](assert) {\n assert.deepEqual((0, _utils.makeArray)(false), [false]);\n }\n\n ['@test object'](assert) {\n assert.deepEqual((0, _utils.makeArray)({}), [{}]);\n }\n });\n});","enifed('@ember/-internals/utils/tests/to-string-test', ['@ember/-internals/utils', 'internal-test-helpers'], function (_utils, _internalTestHelpers) {\n 'use strict';\n\n (0, _internalTestHelpers.moduleFor)('@ember/-internals/utils toString', class extends _internalTestHelpers.AbstractTestCase {\n [`@test toString uses an object's toString method when available`](assert) {\n let obj = {\n toString() {\n return 'bob';\n }\n };\n\n assert.strictEqual((0, _utils.toString)(obj), 'bob');\n }\n\n ['@test toString falls back to Object.prototype.toString'](assert) {\n let obj = Object.create(null);\n\n assert.strictEqual((0, _utils.toString)(obj), {}.toString());\n }\n\n ['@test toString does not fail when called on Arrays with objects without toString method'](assert) {\n let obj = Object.create(null);\n let arr = [obj, 2];\n\n assert.strictEqual((0, _utils.toString)(arr), `${{}.toString()},2`);\n }\n });\n});","enifed('@ember/-internals/utils/tests/try_invoke_test', ['@ember/-internals/utils', 'internal-test-helpers'], function (_utils, _internalTestHelpers) {\n 'use strict';\n\n let obj;\n\n (0, _internalTestHelpers.moduleFor)('Ember.tryInvoke', class extends _internalTestHelpers.AbstractTestCase {\n constructor() {\n super();\n\n obj = {\n aMethodThatExists() {\n return true;\n },\n aMethodThatTakesArguments(arg1, arg2) {\n return arg1 === arg2;\n }\n };\n }\n\n teardown() {\n obj = undefined;\n }\n\n [\"@test should return undefined when the object doesn't exist\"](assert) {\n assert.equal((0, _utils.tryInvoke)(undefined, 'aMethodThatDoesNotExist'), undefined);\n }\n\n [\"@test should return undefined when asked to perform a method that doesn't exist on the object\"](assert) {\n assert.equal((0, _utils.tryInvoke)(obj, 'aMethodThatDoesNotExist'), undefined);\n }\n\n ['@test should return what the method returns when asked to perform a method that exists on the object'](assert) {\n assert.equal((0, _utils.tryInvoke)(obj, 'aMethodThatExists'), true);\n }\n\n ['@test should return what the method returns when asked to perform a method that takes arguments and exists on the object'](assert) {\n assert.equal((0, _utils.tryInvoke)(obj, 'aMethodThatTakesArguments', [true, true]), true);\n }\n });\n});","enifed('@ember/application/tests/application_instance_test', ['@ember/engine', '@ember/application', '@ember/application/instance', '@ember/runloop', '@ember/-internals/container', 'internal-test-helpers', '@ember/-internals/runtime', '@ember/debug'], function (_engine, _application, _instance, _runloop, _container, _internalTestHelpers, _runtime, _debug) {\n 'use strict';\n\n const originalDebug = (0, _debug.getDebugFunction)('debug');\n const noop = function () {};\n\n let application, appInstance;\n\n (0, _internalTestHelpers.moduleFor)('ApplicationInstance', class extends _internalTestHelpers.AbstractTestCase {\n constructor() {\n (0, _debug.setDebugFunction)('debug', noop);\n super();\n\n document.getElementById('qunit-fixture').innerHTML = `\n
HI
HI
\n `;\n application = (0, _runloop.run)(() => _application.default.create({ rootElement: '#one', router: null }));\n }\n\n teardown() {\n (0, _debug.setDebugFunction)('debug', originalDebug);\n if (appInstance) {\n (0, _runloop.run)(appInstance, 'destroy');\n appInstance = null;\n }\n\n if (application) {\n (0, _runloop.run)(application, 'destroy');\n application = null;\n }\n\n document.getElementById('qunit-fixture').innerHTML = '';\n }\n\n ['@test an application instance can be created based upon an application'](assert) {\n appInstance = (0, _runloop.run)(() => _instance.default.create({ application }));\n\n assert.ok(appInstance, 'instance should be created');\n assert.equal(appInstance.application, application, 'application should be set to parent');\n }\n\n ['@test customEvents added to the application before setupEventDispatcher'](assert) {\n assert.expect(1);\n\n appInstance = (0, _runloop.run)(() => _instance.default.create({ application }));\n appInstance.setupRegistry();\n\n application.customEvents = {\n awesome: 'sauce'\n };\n\n let eventDispatcher = appInstance.lookup('event_dispatcher:main');\n eventDispatcher.setup = function (events) {\n assert.equal(events.awesome, 'sauce');\n };\n\n appInstance.setupEventDispatcher();\n }\n\n ['@test customEvents added to the application before setupEventDispatcher'](assert) {\n assert.expect(1);\n\n appInstance = (0, _runloop.run)(() => _instance.default.create({ application }));\n appInstance.setupRegistry();\n\n application.customEvents = {\n awesome: 'sauce'\n };\n\n let eventDispatcher = appInstance.lookup('event_dispatcher:main');\n eventDispatcher.setup = function (events) {\n assert.equal(events.awesome, 'sauce');\n };\n\n appInstance.setupEventDispatcher();\n }\n\n ['@test customEvents added to the application instance before setupEventDispatcher'](assert) {\n assert.expect(1);\n\n appInstance = (0, _runloop.run)(() => _instance.default.create({ application }));\n appInstance.setupRegistry();\n\n appInstance.customEvents = {\n awesome: 'sauce'\n };\n\n let eventDispatcher = appInstance.lookup('event_dispatcher:main');\n eventDispatcher.setup = function (events) {\n assert.equal(events.awesome, 'sauce');\n };\n\n appInstance.setupEventDispatcher();\n }\n\n ['@test unregistering a factory clears all cached instances of that factory'](assert) {\n assert.expect(5);\n\n appInstance = (0, _runloop.run)(() => _instance.default.create({ application }));\n\n let PostController1 = (0, _internalTestHelpers.factory)();\n let PostController2 = (0, _internalTestHelpers.factory)();\n\n appInstance.register('controller:post', PostController1);\n\n let postController1 = appInstance.lookup('controller:post');\n let postController1Factory = appInstance.factoryFor('controller:post');\n assert.ok(postController1 instanceof PostController1, 'precond - lookup creates instance');\n assert.equal(PostController1, postController1Factory.class, 'precond - factoryFor().class matches');\n\n appInstance.unregister('controller:post');\n appInstance.register('controller:post', PostController2);\n\n let postController2 = appInstance.lookup('controller:post');\n let postController2Factory = appInstance.factoryFor('controller:post');\n assert.ok(postController2 instanceof PostController2, 'lookup creates instance');\n assert.equal(PostController2, postController2Factory.class, 'factoryFor().class matches');\n\n assert.notStrictEqual(postController1, postController2, 'lookup creates a brand new instance, because the previous one was reset');\n }\n\n ['@skip unregistering a factory clears caches with source of that factory'](assert) {\n assert.expect(1);\n\n appInstance = (0, _runloop.run)(() => _instance.default.create({ application }));\n\n let PostController1 = (0, _internalTestHelpers.factory)();\n let PostController2 = (0, _internalTestHelpers.factory)();\n\n appInstance.register('controller:post', PostController1);\n\n appInstance.lookup('controller:post');\n let postControllerLookupWithSource = appInstance.lookup('controller:post', {\n source: 'doesnt-even-matter'\n });\n\n appInstance.unregister('controller:post');\n appInstance.register('controller:post', PostController2);\n\n // The cache that is source-specific is not cleared\n assert.ok(postControllerLookupWithSource !== appInstance.lookup('controller:post', {\n source: 'doesnt-even-matter'\n }), 'lookup with source creates a new instance');\n }\n\n ['@test can build and boot a registered engine'](assert) {\n assert.expect(11);\n\n let ChatEngine = _engine.default.extend();\n let chatEngineInstance;\n\n application.register('engine:chat', ChatEngine);\n\n (0, _runloop.run)(() => {\n appInstance = _instance.default.create({ application });\n appInstance.setupRegistry();\n chatEngineInstance = appInstance.buildChildEngineInstance('chat');\n });\n\n return chatEngineInstance.boot().then(() => {\n assert.ok(true, 'boot successful');\n\n let registrations = ['route:basic', 'service:-routing', 'service:-glimmer-environment'];\n\n registrations.forEach(key => {\n assert.strictEqual(chatEngineInstance.resolveRegistration(key), appInstance.resolveRegistration(key), `Engine and parent app share registrations for '${key}'`);\n });\n\n let singletons = ['router:main', _container.privatize`-bucket-cache:main`, '-view-registry:main', '-environment:main', 'service:-document', 'event_dispatcher:main'];\n\n let env = appInstance.lookup('-environment:main');\n singletons.push(env.isInteractive ? 'renderer:-dom' : 'renderer:-inert');\n\n singletons.forEach(key => {\n assert.strictEqual(chatEngineInstance.lookup(key), appInstance.lookup(key), `Engine and parent app share singleton '${key}'`);\n });\n });\n }\n\n ['@test can build a registry via ApplicationInstance.setupRegistry() -- simulates ember-test-helpers'](assert) {\n let namespace = _runtime.Object.create({\n Resolver: { create: function () {} }\n });\n\n let registry = _application.default.buildRegistry(namespace);\n\n _instance.default.setupRegistry(registry);\n\n assert.equal(registry.resolve('service:-document'), document);\n }\n });\n});","enifed('@ember/application/tests/application_test', ['ember/version', '@ember/-internals/environment', '@ember/-internals/metal', '@ember/debug', '@ember/application', '@ember/-internals/routing', '@ember/-internals/views', '@ember/controller', '@ember/-internals/runtime', '@ember/-internals/glimmer', '@ember/-internals/container', '@ember/polyfills', 'internal-test-helpers', '@ember/runloop'], function (_version, _environment, _metal, _debug, _application, _routing, _views, _controller, _runtime, _glimmer, _container, _polyfills, _internalTestHelpers, _runloop) {\n 'use strict';\n\n (0, _internalTestHelpers.moduleFor)('Application, autobooting multiple apps', class extends _internalTestHelpers.ApplicationTestCase {\n get fixture() {\n return `\n
\n
HI
\n
\n
HI
\n `;\n }\n\n get applicationOptions() {\n return (0, _polyfills.assign)(super.applicationOptions, {\n rootElement: '#one',\n router: null,\n autoboot: true\n });\n }\n\n createSecondApplication(options) {\n let myOptions = (0, _polyfills.assign)(this.applicationOptions, options);\n return this.secondApp = _application.default.create(myOptions);\n }\n\n teardown() {\n super.teardown();\n\n if (this.secondApp) {\n this.runTask(() => this.secondApp.destroy());\n }\n }\n\n [`@test you can make a new application in a non-overlapping element`](assert) {\n let app = this.runTask(() => this.createSecondApplication({\n rootElement: '#two'\n }));\n\n this.runTask(() => app.destroy());\n assert.ok(true, 'should not raise');\n }\n\n [`@test you cannot make a new application that is a parent of an existing application`]() {\n expectAssertion(() => {\n this.runTask(() => this.createSecondApplication({\n rootElement: this.applicationOptions.rootElement\n }));\n });\n }\n\n [`@test you cannot make a new application that is a descendant of an existing application`]() {\n expectAssertion(() => {\n this.runTask(() => this.createSecondApplication({\n rootElement: '#one-child'\n }));\n });\n }\n\n [`@test you cannot make a new application that is a duplicate of an existing application`]() {\n expectAssertion(() => {\n this.runTask(() => this.createSecondApplication({\n rootElement: '#one'\n }));\n });\n }\n\n [`@test you cannot make two default applications without a rootElement error`]() {\n expectAssertion(() => {\n this.runTask(() => this.createSecondApplication());\n });\n }\n }); /*globals EmberDev */\n\n\n (0, _internalTestHelpers.moduleFor)('Application', class extends _internalTestHelpers.ApplicationTestCase {\n [`@test builds a registry`](assert) {\n let { application } = this;\n assert.strictEqual(application.resolveRegistration('application:main'), application, `application:main is registered`);\n assert.deepEqual(application.registeredOptionsForType('component'), { singleton: false }, `optionsForType 'component'`);\n assert.deepEqual(application.registeredOptionsForType('view'), { singleton: false }, `optionsForType 'view'`);\n\n (0, _internalTestHelpers.verifyRegistration)(assert, application, 'controller:basic');\n (0, _internalTestHelpers.verifyRegistration)(assert, application, '-view-registry:main');\n (0, _internalTestHelpers.verifyInjection)(assert, application, 'view', '_viewRegistry', '-view-registry:main');\n (0, _internalTestHelpers.verifyInjection)(assert, application, 'route', '_topLevelViewTemplate', 'template:-outlet');\n (0, _internalTestHelpers.verifyRegistration)(assert, application, 'route:basic');\n (0, _internalTestHelpers.verifyRegistration)(assert, application, 'event_dispatcher:main');\n (0, _internalTestHelpers.verifyInjection)(assert, application, 'router:main', 'namespace', 'application:main');\n (0, _internalTestHelpers.verifyInjection)(assert, application, 'view:-outlet', 'namespace', 'application:main');\n\n (0, _internalTestHelpers.verifyRegistration)(assert, application, 'location:auto');\n (0, _internalTestHelpers.verifyRegistration)(assert, application, 'location:hash');\n (0, _internalTestHelpers.verifyRegistration)(assert, application, 'location:history');\n (0, _internalTestHelpers.verifyRegistration)(assert, application, 'location:none');\n\n (0, _internalTestHelpers.verifyInjection)(assert, application, 'controller', 'target', 'router:main');\n (0, _internalTestHelpers.verifyInjection)(assert, application, 'controller', 'namespace', 'application:main');\n\n (0, _internalTestHelpers.verifyRegistration)(assert, application, _container.privatize`-bucket-cache:main`);\n (0, _internalTestHelpers.verifyInjection)(assert, application, 'router', '_bucketCache', _container.privatize`-bucket-cache:main`);\n (0, _internalTestHelpers.verifyInjection)(assert, application, 'route', '_bucketCache', _container.privatize`-bucket-cache:main`);\n\n (0, _internalTestHelpers.verifyInjection)(assert, application, 'route', '_router', 'router:main');\n\n (0, _internalTestHelpers.verifyRegistration)(assert, application, 'component:-text-field');\n (0, _internalTestHelpers.verifyRegistration)(assert, application, 'component:-text-area');\n (0, _internalTestHelpers.verifyRegistration)(assert, application, 'component:-checkbox');\n (0, _internalTestHelpers.verifyRegistration)(assert, application, 'component:link-to');\n\n (0, _internalTestHelpers.verifyRegistration)(assert, application, 'service:-routing');\n (0, _internalTestHelpers.verifyInjection)(assert, application, 'service:-routing', 'router', 'router:main');\n\n // DEBUGGING\n (0, _internalTestHelpers.verifyRegistration)(assert, application, 'resolver-for-debugging:main');\n (0, _internalTestHelpers.verifyInjection)(assert, application, 'container-debug-adapter:main', 'resolver', 'resolver-for-debugging:main');\n (0, _internalTestHelpers.verifyInjection)(assert, application, 'data-adapter:main', 'containerDebugAdapter', 'container-debug-adapter:main');\n (0, _internalTestHelpers.verifyRegistration)(assert, application, 'container-debug-adapter:main');\n (0, _internalTestHelpers.verifyRegistration)(assert, application, 'component-lookup:main');\n\n (0, _internalTestHelpers.verifyRegistration)(assert, application, 'service:-glimmer-environment');\n (0, _internalTestHelpers.verifyRegistration)(assert, application, 'service:-dom-changes');\n (0, _internalTestHelpers.verifyRegistration)(assert, application, 'service:-dom-tree-construction');\n (0, _internalTestHelpers.verifyInjection)(assert, application, 'service:-glimmer-environment', 'appendOperations', 'service:-dom-tree-construction');\n (0, _internalTestHelpers.verifyInjection)(assert, application, 'service:-glimmer-environment', 'updateOperations', 'service:-dom-changes');\n (0, _internalTestHelpers.verifyInjection)(assert, application, 'renderer', 'env', 'service:-glimmer-environment');\n (0, _internalTestHelpers.verifyRegistration)(assert, application, 'view:-outlet');\n (0, _internalTestHelpers.verifyRegistration)(assert, application, 'renderer:-dom');\n (0, _internalTestHelpers.verifyRegistration)(assert, application, 'renderer:-inert');\n (0, _internalTestHelpers.verifyRegistration)(assert, application, _container.privatize`template:components/-default`);\n (0, _internalTestHelpers.verifyRegistration)(assert, application, 'template:-outlet');\n (0, _internalTestHelpers.verifyInjection)(assert, application, 'view:-outlet', 'template', 'template:-outlet');\n (0, _internalTestHelpers.verifyInjection)(assert, application, 'template', 'compiler', _container.privatize`template-compiler:main`);\n\n assert.deepEqual(application.registeredOptionsForType('helper'), { instantiate: false }, `optionsForType 'helper'`);\n }\n });\n\n (0, _internalTestHelpers.moduleFor)('Application, default resolver with autoboot', class extends _internalTestHelpers.DefaultResolverApplicationTestCase {\n constructor() {\n super(...arguments);\n this.originalLookup = _environment.context.lookup;\n }\n\n teardown() {\n _environment.context.lookup = this.originalLookup;\n super.teardown();\n (0, _glimmer.setTemplates)({});\n }\n\n get applicationOptions() {\n return (0, _polyfills.assign)(super.applicationOptions, {\n autoboot: true\n });\n }\n\n [`@test acts like a namespace`](assert) {\n this.application = this.runTask(() => this.createApplication());\n let Foo = this.application.Foo = _runtime.Object.extend();\n assert.equal(Foo.toString(), 'TestApp.Foo', 'Classes pick up their parent namespace');\n }\n\n [`@test can specify custom router`](assert) {\n let MyRouter = _routing.Router.extend();\n this.runTask(() => {\n this.createApplication();\n this.application.Router = MyRouter;\n });\n\n assert.ok(this.application.__deprecatedInstance__.lookup('router:main') instanceof MyRouter, 'application resolved the correct router');\n }\n\n [`@test Minimal Application initialized with just an application template`]() {\n this.setupFixture('');\n this.runTask(() => this.createApplication());\n this.assertInnerHTML('Hello World');\n }\n });\n\n (0, _internalTestHelpers.moduleFor)('Application, autobooting', class extends _internalTestHelpers.AutobootApplicationTestCase {\n constructor() {\n super(...arguments);\n this.originalLogVersion = _environment.ENV.LOG_VERSION;\n this.originalDebug = (0, _debug.getDebugFunction)('debug');\n this.originalWarn = (0, _debug.getDebugFunction)('warn');\n }\n\n teardown() {\n (0, _debug.setDebugFunction)('warn', this.originalWarn);\n (0, _debug.setDebugFunction)('debug', this.originalDebug);\n _environment.ENV.LOG_VERSION = this.originalLogVersion;\n super.teardown();\n }\n\n [`@test initialized application goes to initial route`]() {\n this.runTask(() => {\n this.createApplication();\n this.addTemplate('application', '{{outlet}}');\n this.addTemplate('index', '
Hi from index
');\n });\n\n this.assertText('Hi from index');\n }\n\n [`@test ready hook is called before routing begins`](assert) {\n assert.expect(2);\n\n this.runTask(() => {\n function registerRoute(application, name, callback) {\n let route = _routing.Route.extend({\n activate: callback\n });\n\n application.register('route:' + name, route);\n }\n\n let MyApplication = _application.default.extend({\n ready() {\n registerRoute(this, 'index', () => {\n assert.ok(true, 'last-minute route is activated');\n });\n }\n });\n\n let app = this.createApplication({}, MyApplication);\n\n registerRoute(app, 'application', () => assert.ok(true, 'normal route is activated'));\n });\n }\n\n [`@test initialize application via initialize call`](assert) {\n this.runTask(() => this.createApplication());\n // This is not a public way to access the container; we just\n // need to make some assertions about the created router\n let router = this.applicationInstance.lookup('router:main');\n assert.equal(router instanceof _routing.Router, true, 'Router was set from initialize call');\n assert.equal(router.location instanceof _routing.NoneLocation, true, 'Location was set from location implementation name');\n }\n\n [`@test initialize application with stateManager via initialize call from Router class`](assert) {\n this.runTask(() => {\n this.createApplication();\n this.addTemplate('application', '
Hello!
');\n });\n // This is not a public way to access the container; we just\n // need to make some assertions about the created router\n let router = this.application.__deprecatedInstance__.lookup('router:main');\n assert.equal(router instanceof _routing.Router, true, 'Router was set from initialize call');\n this.assertText('Hello!');\n }\n\n [`@test Application Controller backs the appplication template`]() {\n this.runTask(() => {\n this.createApplication();\n this.addTemplate('application', '
{{greeting}}
');\n this.add('controller:application', _controller.default.extend({\n greeting: 'Hello!'\n }));\n });\n this.assertText('Hello!');\n }\n\n [`@test enable log of libraries with an ENV var`](assert) {\n if (EmberDev && EmberDev.runningProdBuild) {\n assert.ok(true, 'Logging does not occur in production builds');\n return;\n }\n\n let messages = [];\n\n _environment.ENV.LOG_VERSION = true;\n\n (0, _debug.setDebugFunction)('debug', message => messages.push(message));\n\n _metal.libraries.register('my-lib', '2.0.0a');\n\n this.runTask(() => this.createApplication());\n\n assert.equal(messages[1], 'Ember : ' + _version.default);\n if (_views.jQueryDisabled) {\n assert.equal(messages[2], 'my-lib : ' + '2.0.0a');\n } else {\n assert.equal(messages[2], 'jQuery : ' + (0, _views.jQuery)().jquery);\n assert.equal(messages[3], 'my-lib : ' + '2.0.0a');\n }\n\n _metal.libraries.deRegister('my-lib');\n }\n\n [`@test disable log of version of libraries with an ENV var`](assert) {\n let logged = false;\n\n _environment.ENV.LOG_VERSION = false;\n\n (0, _debug.setDebugFunction)('debug', () => logged = true);\n\n this.runTask(() => this.createApplication());\n\n assert.ok(!logged, 'library version logging skipped');\n }\n\n [`@test can resolve custom router`](assert) {\n let CustomRouter = _routing.Router.extend();\n\n this.runTask(() => {\n this.createApplication();\n this.add('router:main', CustomRouter);\n });\n\n assert.ok(this.application.__deprecatedInstance__.lookup('router:main') instanceof CustomRouter, 'application resolved the correct router');\n }\n\n [`@test does not leak itself in onLoad._loaded`](assert) {\n assert.equal(_application._loaded.application, undefined);\n this.runTask(() => this.createApplication());\n assert.equal(_application._loaded.application, this.application);\n this.runTask(() => this.application.destroy());\n assert.equal(_application._loaded.application, undefined);\n }\n\n [`@test can build a registry via Application.buildRegistry() --- simulates ember-test-helpers`](assert) {\n let namespace = _runtime.Object.create({\n Resolver: { create: function () {} }\n });\n\n let registry = _application.default.buildRegistry(namespace);\n\n assert.equal(registry.resolve('application:main'), namespace);\n }\n });\n\n (0, _internalTestHelpers.moduleFor)('Application#buildRegistry', class extends _internalTestHelpers.AbstractTestCase {\n [`@test can build a registry via Application.buildRegistry() --- simulates ember-test-helpers`](assert) {\n let namespace = _runtime.Object.create({\n Resolver: { create() {} }\n });\n\n let registry = _application.default.buildRegistry(namespace);\n\n assert.equal(registry.resolve('application:main'), namespace);\n }\n });\n\n (0, _internalTestHelpers.moduleFor)('Application - instance tracking', class extends _internalTestHelpers.ApplicationTestCase {\n ['@test tracks built instance'](assert) {\n let instance = this.application.buildInstance();\n (0, _runloop.run)(() => {\n this.application.destroy();\n });\n\n assert.ok(instance.isDestroyed, 'instance was destroyed');\n }\n\n ['@test tracks built instances'](assert) {\n let instanceA = this.application.buildInstance();\n let instanceB = this.application.buildInstance();\n (0, _runloop.run)(() => {\n this.application.destroy();\n });\n\n assert.ok(instanceA.isDestroyed, 'instanceA was destroyed');\n assert.ok(instanceB.isDestroyed, 'instanceB was destroyed');\n }\n });\n});","enifed('@ember/application/tests/bootstrap-test', ['@ember/polyfills', 'internal-test-helpers'], function (_polyfills, _internalTestHelpers) {\n 'use strict';\n\n (0, _internalTestHelpers.moduleFor)('Application with default resolver and autoboot', class extends _internalTestHelpers.DefaultResolverApplicationTestCase {\n get fixture() {\n return `\n \n\n \n \n `;\n }\n\n get applicationOptions() {\n return (0, _polyfills.assign)(super.applicationOptions, {\n autoboot: true,\n rootElement: '#app'\n });\n }\n\n ['@test templates in script tags are extracted at application creation'](assert) {\n this.runTask(() => this.createApplication());\n assert.equal(document.getElementById('app').textContent, 'Hello World!');\n }\n });\n});","enifed('@ember/application/tests/dependency_injection/custom_resolver_test', ['@ember/application/globals-resolver', '@ember/polyfills', 'internal-test-helpers'], function (_globalsResolver, _polyfills, _internalTestHelpers) {\n 'use strict';\n\n (0, _internalTestHelpers.moduleFor)('Application with extended default resolver and autoboot', class extends _internalTestHelpers.DefaultResolverApplicationTestCase {\n get applicationOptions() {\n let applicationTemplate = this.compile(`
Fallback
`);\n\n let Resolver = _globalsResolver.default.extend({\n resolveTemplate(resolvable) {\n if (resolvable.fullNameWithoutType === 'application') {\n return applicationTemplate;\n } else {\n return this._super(resolvable);\n }\n }\n });\n\n return (0, _polyfills.assign)(super.applicationOptions, {\n Resolver,\n autoboot: true\n });\n }\n\n [`@test a resolver can be supplied to application`]() {\n this.runTask(() => this.createApplication());\n this.assertText('Fallback');\n }\n });\n});","enifed('@ember/application/tests/dependency_injection/default_resolver_test', ['internal-test-helpers', '@ember/-internals/environment', '@ember/controller', '@ember/service', '@ember/-internals/runtime', '@ember/-internals/routing', '@ember/-internals/glimmer', '@ember/debug'], function (_internalTestHelpers, _environment, _controller, _service, _runtime, _routing, _glimmer, _debug) {\n 'use strict';\n\n /* globals EmberDev */\n (0, _internalTestHelpers.moduleFor)('Application Dependency Injection - Integration - default resolver', class extends _internalTestHelpers.DefaultResolverApplicationTestCase {\n beforeEach() {\n this.runTask(() => this.createApplication());\n return this.visit('/');\n }\n\n get privateRegistry() {\n return this.application.__registry__;\n }\n\n /*\n * This first batch of tests are integration tests against the public\n * applicationInstance API.\n */\n\n [`@test the default resolver looks up templates in Ember.TEMPLATES`](assert) {\n let fooTemplate = this.addTemplate('foo', `foo template`);\n let fooBarTemplate = this.addTemplate('fooBar', `fooBar template`);\n let fooBarBazTemplate = this.addTemplate('fooBar/baz', `fooBar/baz template`);\n\n assert.equal(this.applicationInstance.factoryFor('template:foo').class, fooTemplate, 'resolves template:foo');\n assert.equal(this.applicationInstance.factoryFor('template:fooBar').class, fooBarTemplate, 'resolves template:foo_bar');\n assert.equal(this.applicationInstance.factoryFor('template:fooBar.baz').class, fooBarBazTemplate, 'resolves template:foo_bar.baz');\n }\n\n [`@test the default resolver looks up basic name as no prefix`](assert) {\n let instance = this.applicationInstance.lookup('controller:basic');\n assert.ok(_controller.default.detect(instance), 'locator looks up correct controller');\n }\n\n [`@test the default resolver looks up arbitrary types on the namespace`](assert) {\n let Class = this.application.FooManager = _runtime.Object.extend();\n let resolvedClass = this.application.resolveRegistration('manager:foo');\n assert.equal(Class, resolvedClass, 'looks up FooManager on application');\n }\n\n [`@test the default resolver resolves models on the namespace`](assert) {\n let Class = this.application.Post = _runtime.Object.extend();\n let factoryClass = this.applicationInstance.factoryFor('model:post').class;\n assert.equal(Class, factoryClass, 'looks up Post model on application');\n }\n\n [`@test the default resolver resolves *:main on the namespace`](assert) {\n let Class = this.application.FooBar = _runtime.Object.extend();\n let factoryClass = this.applicationInstance.factoryFor('foo-bar:main').class;\n assert.equal(Class, factoryClass, 'looks up FooBar type without name on application');\n }\n\n [`@test the default resolver resolves container-registered helpers`](assert) {\n let shorthandHelper = (0, _glimmer.helper)(() => {});\n let helper = _glimmer.Helper.extend();\n\n this.application.register('helper:shorthand', shorthandHelper);\n this.application.register('helper:complete', helper);\n\n let lookedUpShorthandHelper = this.applicationInstance.factoryFor('helper:shorthand').class;\n\n assert.ok(lookedUpShorthandHelper.isHelperFactory, 'shorthand helper isHelper');\n\n let lookedUpHelper = this.applicationInstance.factoryFor('helper:complete').class;\n\n assert.ok(lookedUpHelper.isHelperFactory, 'complete helper is factory');\n assert.ok(helper.detect(lookedUpHelper), 'looked up complete helper');\n }\n\n [`@test the default resolver resolves container-registered helpers via lookupFor`](assert) {\n let shorthandHelper = (0, _glimmer.helper)(() => {});\n let helper = _glimmer.Helper.extend();\n\n this.application.register('helper:shorthand', shorthandHelper);\n this.application.register('helper:complete', helper);\n\n let lookedUpShorthandHelper = this.applicationInstance.factoryFor('helper:shorthand').class;\n\n assert.ok(lookedUpShorthandHelper.isHelperFactory, 'shorthand helper isHelper');\n\n let lookedUpHelper = this.applicationInstance.factoryFor('helper:complete').class;\n\n assert.ok(lookedUpHelper.isHelperFactory, 'complete helper is factory');\n assert.ok(helper.detect(lookedUpHelper), 'looked up complete helper');\n }\n\n [`@test the default resolver resolves helpers on the namespace`](assert) {\n let ShorthandHelper = (0, _glimmer.helper)(() => {});\n let CompleteHelper = _glimmer.Helper.extend();\n\n this.application.ShorthandHelper = ShorthandHelper;\n this.application.CompleteHelper = CompleteHelper;\n\n let resolvedShorthand = this.application.resolveRegistration('helper:shorthand');\n let resolvedComplete = this.application.resolveRegistration('helper:complete');\n\n assert.equal(resolvedShorthand, ShorthandHelper, 'resolve fetches the shorthand helper factory');\n assert.equal(resolvedComplete, CompleteHelper, 'resolve fetches the complete helper factory');\n }\n\n [`@test the default resolver resolves to the same instance, no matter the notation `](assert) {\n this.application.NestedPostController = _controller.default.extend({});\n\n assert.equal(this.applicationInstance.lookup('controller:nested-post'), this.applicationInstance.lookup('controller:nested_post'), 'looks up NestedPost controller on application');\n }\n\n [`@test the default resolver throws an error if the fullName to resolve is invalid`]() {\n expectAssertion(() => {\n this.applicationInstance.resolveRegistration(undefined);\n }, /fullName must be a proper full name/);\n expectAssertion(() => {\n this.applicationInstance.resolveRegistration(null);\n }, /fullName must be a proper full name/);\n expectAssertion(() => {\n this.applicationInstance.resolveRegistration('');\n }, /fullName must be a proper full name/);\n expectAssertion(() => {\n this.applicationInstance.resolveRegistration('');\n }, /fullName must be a proper full name/);\n expectAssertion(() => {\n this.applicationInstance.resolveRegistration(':');\n }, /fullName must be a proper full name/);\n expectAssertion(() => {\n this.applicationInstance.resolveRegistration('model');\n }, /fullName must be a proper full name/);\n expectAssertion(() => {\n this.applicationInstance.resolveRegistration('model:');\n }, /fullName must be a proper full name/);\n expectAssertion(() => {\n this.applicationInstance.resolveRegistration(':type');\n }, /fullName must be a proper full name/);\n }\n\n /*\n * The following are integration tests against the private registry API.\n */\n\n [`@test lookup description`](assert) {\n this.application.toString = () => 'App';\n\n assert.equal(this.privateRegistry.describe('controller:foo'), 'App.FooController', 'Type gets appended at the end');\n assert.equal(this.privateRegistry.describe('controller:foo.bar'), 'App.FooBarController', 'dots are removed');\n assert.equal(this.privateRegistry.describe('model:foo'), 'App.Foo', \"models don't get appended at the end\");\n }\n\n [`@test assertion for routes without isRouteFactory property`]() {\n this.application.FooRoute = _glimmer.Component.extend();\n\n expectAssertion(() => {\n this.privateRegistry.resolve(`route:foo`);\n }, /to resolve to an Ember.Route/, 'Should assert');\n }\n\n [`@test no assertion for routes that extend from Route`](assert) {\n assert.expect(0);\n this.application.FooRoute = _routing.Route.extend();\n this.privateRegistry.resolve(`route:foo`);\n }\n\n [`@test deprecation warning for service factories without isServiceFactory property`]() {\n expectAssertion(() => {\n this.application.FooService = _runtime.Object.extend();\n this.privateRegistry.resolve('service:foo');\n }, /Expected service:foo to resolve to an Ember.Service but instead it was TestApp\\.FooService\\./);\n }\n\n [`@test no deprecation warning for service factories that extend from Service`](assert) {\n assert.expect(0);\n this.application.FooService = _service.default.extend();\n this.privateRegistry.resolve('service:foo');\n }\n\n [`@test deprecation warning for component factories without isComponentFactory property`]() {\n expectAssertion(() => {\n this.application.FooComponent = _runtime.Object.extend();\n this.privateRegistry.resolve('component:foo');\n }, /Expected component:foo to resolve to an Ember\\.Component but instead it was TestApp\\.FooComponent\\./);\n }\n\n [`@test no deprecation warning for component factories that extend from Component`]() {\n expectNoDeprecation();\n this.application.FooView = _glimmer.Component.extend();\n this.privateRegistry.resolve('component:foo');\n }\n\n [`@test knownForType returns each item for a given type found`](assert) {\n this.application.FooBarHelper = 'foo';\n this.application.BazQuxHelper = 'bar';\n\n let found = this.privateRegistry.resolver.knownForType('helper');\n\n assert.deepEqual(found, {\n 'helper:foo-bar': true,\n 'helper:baz-qux': true\n });\n }\n\n [`@test knownForType is not required to be present on the resolver`](assert) {\n delete this.privateRegistry.resolver.knownForType;\n\n this.privateRegistry.resolver.knownForType('helper', () => {});\n\n assert.ok(true, 'does not error');\n }\n });\n\n (0, _internalTestHelpers.moduleFor)('Application Dependency Injection - Integration - default resolver w/ other namespace', class extends _internalTestHelpers.DefaultResolverApplicationTestCase {\n beforeEach() {\n this.UserInterface = _environment.context.lookup.UserInterface = _runtime.Namespace.create();\n this.runTask(() => this.createApplication());\n return this.visit('/');\n }\n\n teardown() {\n let UserInterfaceNamespace = _runtime.Namespace.NAMESPACES_BY_ID['UserInterface'];\n if (UserInterfaceNamespace) {\n this.runTask(() => {\n UserInterfaceNamespace.destroy();\n });\n }\n super.teardown();\n }\n\n [`@test the default resolver can look things up in other namespaces`](assert) {\n this.UserInterface.NavigationController = _controller.default.extend();\n\n let nav = this.applicationInstance.lookup('controller:userInterface/navigation');\n\n assert.ok(nav instanceof this.UserInterface.NavigationController, 'the result should be an instance of the specified class');\n }\n });\n\n (0, _internalTestHelpers.moduleFor)('Application Dependency Injection - Integration - default resolver', class extends _internalTestHelpers.DefaultResolverApplicationTestCase {\n constructor() {\n super();\n this._originalLookup = _environment.context.lookup;\n this._originalInfo = (0, _debug.getDebugFunction)('info');\n }\n\n beforeEach() {\n this.runTask(() => this.createApplication());\n return this.visit('/');\n }\n\n teardown() {\n (0, _debug.setDebugFunction)('info', this._originalInfo);\n _environment.context.lookup = this._originalLookup;\n super.teardown();\n }\n\n [`@test the default resolver logs hits if 'LOG_RESOLVER' is set`](assert) {\n if (EmberDev && EmberDev.runningProdBuild) {\n assert.ok(true, 'Logging does not occur in production builds');\n return;\n }\n\n assert.expect(3);\n\n this.application.LOG_RESOLVER = true;\n this.application.ScoobyDoo = _runtime.Object.extend();\n this.application.toString = () => 'App';\n\n (0, _debug.setDebugFunction)('info', function (symbol, name, padding, lookupDescription) {\n assert.equal(symbol, '[✓]', 'proper symbol is printed when a module is found');\n assert.equal(name, 'doo:scooby', 'proper lookup value is logged');\n assert.equal(lookupDescription, 'App.ScoobyDoo');\n });\n\n this.applicationInstance.resolveRegistration('doo:scooby');\n }\n\n [`@test the default resolver logs misses if 'LOG_RESOLVER' is set`](assert) {\n if (EmberDev && EmberDev.runningProdBuild) {\n assert.ok(true, 'Logging does not occur in production builds');\n return;\n }\n\n assert.expect(3);\n\n this.application.LOG_RESOLVER = true;\n this.application.toString = () => 'App';\n\n (0, _debug.setDebugFunction)('info', function (symbol, name, padding, lookupDescription) {\n assert.equal(symbol, '[ ]', 'proper symbol is printed when a module is not found');\n assert.equal(name, 'doo:scooby', 'proper lookup value is logged');\n assert.equal(lookupDescription, 'App.ScoobyDoo');\n });\n\n this.applicationInstance.resolveRegistration('doo:scooby');\n }\n\n [`@test doesn't log without LOG_RESOLVER`](assert) {\n if (EmberDev && EmberDev.runningProdBuild) {\n assert.ok(true, 'Logging does not occur in production builds');\n return;\n }\n\n let infoCount = 0;\n\n this.application.ScoobyDoo = _runtime.Object.extend();\n\n (0, _debug.setDebugFunction)('info', () => infoCount = infoCount + 1);\n\n this.applicationInstance.resolveRegistration('doo:scooby');\n this.applicationInstance.resolveRegistration('doo:scrappy');\n assert.equal(infoCount, 0, 'console.info should not be called if LOG_RESOLVER is not set');\n }\n });\n});","enifed('@ember/application/tests/dependency_injection/normalization_test', ['@ember/runloop', '@ember/application', 'internal-test-helpers'], function (_runloop, _application, _internalTestHelpers) {\n 'use strict';\n\n let application, registry;\n\n (0, _internalTestHelpers.moduleFor)('Application Dependency Injection - normalize', class extends _internalTestHelpers.AbstractTestCase {\n constructor() {\n super();\n\n application = (0, _runloop.run)(_application.default, 'create');\n registry = application.__registry__;\n }\n\n teardown() {\n super.teardown();\n (0, _runloop.run)(application, 'destroy');\n application = undefined;\n registry = undefined;\n }\n\n ['@test normalization'](assert) {\n assert.ok(registry.normalize, 'registry#normalize is present');\n\n assert.equal(registry.normalize('foo:bar'), 'foo:bar');\n\n assert.equal(registry.normalize('controller:posts'), 'controller:posts');\n assert.equal(registry.normalize('controller:posts_index'), 'controller:postsIndex');\n assert.equal(registry.normalize('controller:posts.index'), 'controller:postsIndex');\n assert.equal(registry.normalize('controller:posts-index'), 'controller:postsIndex');\n assert.equal(registry.normalize('controller:posts.post.index'), 'controller:postsPostIndex');\n assert.equal(registry.normalize('controller:posts_post.index'), 'controller:postsPostIndex');\n assert.equal(registry.normalize('controller:posts.post_index'), 'controller:postsPostIndex');\n assert.equal(registry.normalize('controller:posts.post-index'), 'controller:postsPostIndex');\n assert.equal(registry.normalize('controller:postsIndex'), 'controller:postsIndex');\n assert.equal(registry.normalize('controller:blogPosts.index'), 'controller:blogPostsIndex');\n assert.equal(registry.normalize('controller:blog/posts.index'), 'controller:blog/postsIndex');\n assert.equal(registry.normalize('controller:blog/posts-index'), 'controller:blog/postsIndex');\n assert.equal(registry.normalize('controller:blog/posts.post.index'), 'controller:blog/postsPostIndex');\n assert.equal(registry.normalize('controller:blog/posts_post.index'), 'controller:blog/postsPostIndex');\n assert.equal(registry.normalize('controller:blog/posts_post-index'), 'controller:blog/postsPostIndex');\n\n assert.equal(registry.normalize('template:blog/posts_index'), 'template:blog/posts_index');\n }\n\n ['@test normalization is indempotent'](assert) {\n let examples = ['controller:posts', 'controller:posts.post.index', 'controller:blog/posts.post_index', 'template:foo_bar'];\n\n examples.forEach(example => {\n assert.equal(registry.normalize(registry.normalize(example)), registry.normalize(example));\n });\n }\n });\n});","enifed('@ember/application/tests/dependency_injection/to_string_test', ['@ember/polyfills', '@ember/-internals/utils', '@ember/-internals/runtime', 'internal-test-helpers'], function (_polyfills, _utils, _runtime, _internalTestHelpers) {\n 'use strict';\n\n (0, _internalTestHelpers.moduleFor)('Application Dependency Injection - DefaultResolver#toString', class extends _internalTestHelpers.DefaultResolverApplicationTestCase {\n constructor() {\n super();\n this.runTask(() => this.createApplication());\n this.application.Post = _runtime.Object.extend();\n }\n\n beforeEach() {\n return this.visit('/');\n }\n\n ['@test factories'](assert) {\n let PostFactory = this.applicationInstance.factoryFor('model:post').class;\n assert.equal(PostFactory.toString(), 'TestApp.Post', 'expecting the model to be post');\n }\n\n ['@test instances'](assert) {\n let post = this.applicationInstance.lookup('model:post');\n let guid = (0, _utils.guidFor)(post);\n\n assert.equal(post.toString(), '', 'expecting the model to be post');\n }\n });\n\n (0, _internalTestHelpers.moduleFor)('Application Dependency Injection - Resolver#toString', class extends _internalTestHelpers.ApplicationTestCase {\n beforeEach() {\n return this.visit('/');\n }\n\n get applicationOptions() {\n return (0, _polyfills.assign)(super.applicationOptions, {\n Resolver: class extends _internalTestHelpers.ModuleBasedTestResolver {\n makeToString(_, fullName) {\n return fullName;\n }\n }\n });\n }\n\n ['@test toString called on a resolver'](assert) {\n this.add('model:peter', _runtime.Object.extend());\n\n let peter = this.applicationInstance.lookup('model:peter');\n let guid = (0, _utils.guidFor)(peter);\n assert.equal(peter.toString(), ``, 'expecting the supermodel to be peter');\n }\n });\n});","enifed('@ember/application/tests/dependency_injection_test', ['@ember/-internals/environment', '@ember/runloop', '@ember/-internals/runtime', '@ember/application', 'internal-test-helpers'], function (_environment, _runloop, _runtime, _application, _internalTestHelpers) {\n 'use strict';\n\n let originalLookup = _environment.context.lookup;\n let registry, locator, application;\n\n (0, _internalTestHelpers.moduleFor)('Application Dependency Injection', class extends _internalTestHelpers.AbstractTestCase {\n constructor() {\n super();\n\n application = (0, _runloop.run)(_application.default, 'create');\n\n application.Person = _runtime.Object.extend({});\n application.Orange = _runtime.Object.extend({});\n application.Email = _runtime.Object.extend({});\n application.User = _runtime.Object.extend({});\n application.PostIndexController = _runtime.Object.extend({});\n\n application.register('model:person', application.Person, {\n singleton: false\n });\n application.register('model:user', application.User, {\n singleton: false\n });\n application.register('fruit:favorite', application.Orange);\n application.register('communication:main', application.Email, {\n singleton: false\n });\n application.register('controller:postIndex', application.PostIndexController, {\n singleton: true\n });\n\n registry = application.__registry__;\n locator = application.__container__;\n\n _environment.context.lookup = {};\n }\n\n teardown() {\n super.teardown();\n (0, _runloop.run)(application, 'destroy');\n registry = application = locator = null;\n _environment.context.lookup = originalLookup;\n }\n\n ['@test container lookup is normalized'](assert) {\n let dotNotationController = locator.lookup('controller:post.index');\n let camelCaseController = locator.lookup('controller:postIndex');\n\n assert.ok(dotNotationController instanceof application.PostIndexController);\n assert.ok(camelCaseController instanceof application.PostIndexController);\n\n assert.equal(dotNotationController, camelCaseController);\n }\n\n ['@test registered entities can be looked up later'](assert) {\n assert.equal(registry.resolve('model:person'), application.Person);\n assert.equal(registry.resolve('model:user'), application.User);\n assert.equal(registry.resolve('fruit:favorite'), application.Orange);\n assert.equal(registry.resolve('communication:main'), application.Email);\n assert.equal(registry.resolve('controller:postIndex'), application.PostIndexController);\n\n assert.equal(locator.lookup('fruit:favorite'), locator.lookup('fruit:favorite'), 'singleton lookup worked');\n assert.ok(locator.lookup('model:user') !== locator.lookup('model:user'), 'non-singleton lookup worked');\n }\n\n ['@test injections'](assert) {\n application.inject('model', 'fruit', 'fruit:favorite');\n application.inject('model:user', 'communication', 'communication:main');\n\n let user = locator.lookup('model:user');\n let person = locator.lookup('model:person');\n let fruit = locator.lookup('fruit:favorite');\n\n assert.equal(user.get('fruit'), fruit);\n assert.equal(person.get('fruit'), fruit);\n\n assert.ok(application.Email.detectInstance(user.get('communication')));\n }\n });\n});","enifed('@ember/application/tests/initializers_test', ['@ember/polyfills', 'internal-test-helpers', '@ember/application'], function (_polyfills, _internalTestHelpers, _application) {\n 'use strict';\n\n (0, _internalTestHelpers.moduleFor)('Application initializers', class extends _internalTestHelpers.AutobootApplicationTestCase {\n get fixture() {\n return `
ONE
\n
TWO
\n `;\n }\n\n get applicationOptions() {\n return (0, _polyfills.assign)(super.applicationOptions, {\n rootElement: '#one'\n });\n }\n\n createSecondApplication(options, MyApplication = _application.default) {\n let myOptions = (0, _polyfills.assign)(this.applicationOptions, {\n rootElement: '#two'\n }, options);\n let secondApp = this.secondApp = MyApplication.create(myOptions);\n return secondApp;\n }\n\n teardown() {\n super.teardown();\n\n if (this.secondApp) {\n this.runTask(() => this.secondApp.destroy());\n }\n }\n\n [`@test initializers require proper 'name' and 'initialize' properties`]() {\n let MyApplication = _application.default.extend();\n\n expectAssertion(() => {\n MyApplication.initializer({ name: 'initializer' });\n });\n\n expectAssertion(() => {\n MyApplication.initializer({ initialize() {} });\n });\n }\n\n [`@test initializers that throw errors cause the boot promise to reject with the error`](assert) {\n assert.expect(2);\n\n let MyApplication = _application.default.extend();\n\n MyApplication.initializer({\n name: 'initializer',\n initialize() {\n throw new Error('boot failure');\n }\n });\n\n this.runTask(() => {\n this.createApplication({\n autoboot: false\n }, MyApplication);\n });\n\n let app = this.application;\n\n try {\n this.runTask(() => {\n app.boot().then(() => {\n assert.ok(false, 'The boot promise should not resolve when there is a boot error');\n }, error => {\n assert.ok(error instanceof Error, 'The boot promise should reject with an error');\n assert.equal(error.message, 'boot failure');\n });\n });\n } catch (error) {\n assert.ok(false, 'The boot method should not throw');\n throw error;\n }\n }\n\n [`@test initializers are passed an App`](assert) {\n let MyApplication = _application.default.extend();\n\n MyApplication.initializer({\n name: 'initializer',\n initialize(App) {\n assert.ok(App instanceof _application.default, 'initialize is passed an Application');\n }\n });\n\n this.runTask(() => this.createApplication({}, MyApplication));\n }\n\n [`@test initializers can be registered in a specified order`](assert) {\n let order = [];\n let MyApplication = _application.default.extend();\n\n MyApplication.initializer({\n name: 'fourth',\n after: 'third',\n initialize() {\n order.push('fourth');\n }\n });\n\n MyApplication.initializer({\n name: 'second',\n after: 'first',\n before: 'third',\n initialize() {\n order.push('second');\n }\n });\n\n MyApplication.initializer({\n name: 'fifth',\n after: 'fourth',\n before: 'sixth',\n initialize() {\n order.push('fifth');\n }\n });\n\n MyApplication.initializer({\n name: 'first',\n before: 'second',\n initialize() {\n order.push('first');\n }\n });\n\n MyApplication.initializer({\n name: 'third',\n initialize() {\n order.push('third');\n }\n });\n\n MyApplication.initializer({\n name: 'sixth',\n initialize() {\n order.push('sixth');\n }\n });\n\n this.runTask(() => this.createApplication({}, MyApplication));\n\n assert.deepEqual(order, ['first', 'second', 'third', 'fourth', 'fifth', 'sixth']);\n }\n\n [`@test initializers can be registered in a specified order as an array`](assert) {\n let order = [];\n let MyApplication = _application.default.extend();\n\n MyApplication.initializer({\n name: 'third',\n initialize() {\n order.push('third');\n }\n });\n\n MyApplication.initializer({\n name: 'second',\n after: 'first',\n before: ['third', 'fourth'],\n initialize() {\n order.push('second');\n }\n });\n\n MyApplication.initializer({\n name: 'fourth',\n after: ['second', 'third'],\n initialize() {\n order.push('fourth');\n }\n });\n\n MyApplication.initializer({\n name: 'fifth',\n after: 'fourth',\n before: 'sixth',\n initialize() {\n order.push('fifth');\n }\n });\n\n MyApplication.initializer({\n name: 'first',\n before: ['second'],\n initialize() {\n order.push('first');\n }\n });\n\n MyApplication.initializer({\n name: 'sixth',\n initialize() {\n order.push('sixth');\n }\n });\n\n this.runTask(() => this.createApplication({}, MyApplication));\n\n assert.deepEqual(order, ['first', 'second', 'third', 'fourth', 'fifth', 'sixth']);\n }\n\n [`@test initializers can have multiple dependencies`](assert) {\n let order = [];\n let MyApplication = _application.default.extend();\n let a = {\n name: 'a',\n before: 'b',\n initialize() {\n order.push('a');\n }\n };\n let b = {\n name: 'b',\n initialize() {\n order.push('b');\n }\n };\n let c = {\n name: 'c',\n after: 'b',\n initialize() {\n order.push('c');\n }\n };\n let afterB = {\n name: 'after b',\n after: 'b',\n initialize() {\n order.push('after b');\n }\n };\n let afterC = {\n name: 'after c',\n after: 'c',\n initialize() {\n order.push('after c');\n }\n };\n\n MyApplication.initializer(b);\n MyApplication.initializer(a);\n MyApplication.initializer(afterC);\n MyApplication.initializer(afterB);\n MyApplication.initializer(c);\n\n this.runTask(() => this.createApplication({}, MyApplication));\n\n assert.ok(order.indexOf(a.name) < order.indexOf(b.name), 'a < b');\n assert.ok(order.indexOf(b.name) < order.indexOf(c.name), 'b < c');\n assert.ok(order.indexOf(b.name) < order.indexOf(afterB.name), 'b < afterB');\n assert.ok(order.indexOf(c.name) < order.indexOf(afterC.name), 'c < afterC');\n }\n\n [`@test initializers set on Application subclasses are not shared between apps`](assert) {\n let firstInitializerRunCount = 0;\n let secondInitializerRunCount = 0;\n let FirstApp = _application.default.extend();\n\n FirstApp.initializer({\n name: 'first',\n initialize() {\n firstInitializerRunCount++;\n }\n });\n\n let SecondApp = _application.default.extend();\n\n SecondApp.initializer({\n name: 'second',\n initialize() {\n secondInitializerRunCount++;\n }\n });\n\n this.runTask(() => this.createApplication({}, FirstApp));\n\n assert.equal(firstInitializerRunCount, 1, 'first initializer only was run');\n assert.equal(secondInitializerRunCount, 0, 'first initializer only was run');\n\n this.runTask(() => this.createSecondApplication({}, SecondApp));\n\n assert.equal(firstInitializerRunCount, 1, 'second initializer only was run');\n assert.equal(secondInitializerRunCount, 1, 'second initializer only was run');\n }\n\n [`@test initializers are concatenated`](assert) {\n let firstInitializerRunCount = 0;\n let secondInitializerRunCount = 0;\n let FirstApp = _application.default.extend();\n\n FirstApp.initializer({\n name: 'first',\n initialize() {\n firstInitializerRunCount++;\n }\n });\n\n let SecondApp = FirstApp.extend();\n SecondApp.initializer({\n name: 'second',\n initialize() {\n secondInitializerRunCount++;\n }\n });\n\n this.runTask(() => this.createApplication({}, FirstApp));\n\n assert.equal(firstInitializerRunCount, 1, 'first initializer only was run when base class created');\n assert.equal(secondInitializerRunCount, 0, 'first initializer only was run when base class created');\n\n firstInitializerRunCount = 0;\n this.runTask(() => this.createSecondApplication({}, SecondApp));\n\n assert.equal(firstInitializerRunCount, 1, 'first initializer was run when subclass created');\n assert.equal(secondInitializerRunCount, 1, 'second initializers was run when subclass created');\n }\n\n [`@test initializers are per-app`](assert) {\n assert.expect(2);\n\n let FirstApp = _application.default.extend();\n\n FirstApp.initializer({\n name: 'abc',\n initialize() {}\n });\n\n expectAssertion(() => {\n FirstApp.initializer({\n name: 'abc',\n initialize() {}\n });\n });\n\n let SecondApp = _application.default.extend();\n SecondApp.instanceInitializer({\n name: 'abc',\n initialize() {}\n });\n\n assert.ok(true, 'Two apps can have initializers named the same.');\n }\n\n [`@test initializers are executed in their own context`](assert) {\n assert.expect(1);\n let MyApplication = _application.default.extend();\n\n MyApplication.initializer({\n name: 'coolInitializer',\n myProperty: 'cool',\n initialize() {\n assert.equal(this.myProperty, 'cool', 'should have access to its own context');\n }\n });\n\n this.runTask(() => this.createApplication({}, MyApplication));\n }\n });\n});","enifed('@ember/application/tests/instance_initializers_test', ['@ember/polyfills', 'internal-test-helpers', '@ember/application/instance', '@ember/application'], function (_polyfills, _internalTestHelpers, _instance, _application) {\n 'use strict';\n\n (0, _internalTestHelpers.moduleFor)('Application instance initializers', class extends _internalTestHelpers.AutobootApplicationTestCase {\n get fixture() {\n return `
ONE
\n
TWO
\n `;\n }\n\n get applicationOptions() {\n return (0, _polyfills.assign)(super.applicationOptions, {\n rootElement: '#one'\n });\n }\n\n createSecondApplication(options, MyApplication = _application.default) {\n let myOptions = (0, _polyfills.assign)(this.applicationOptions, {\n rootElement: '#two'\n }, options);\n let secondApp = this.secondApp = MyApplication.create(myOptions);\n return secondApp;\n }\n\n teardown() {\n super.teardown();\n\n if (this.secondApp) {\n this.runTask(() => this.secondApp.destroy());\n }\n }\n\n [`@test initializers require proper 'name' and 'initialize' properties`]() {\n let MyApplication = _application.default.extend();\n\n expectAssertion(() => {\n MyApplication.instanceInitializer({ name: 'initializer' });\n });\n\n expectAssertion(() => {\n MyApplication.instanceInitializer({ initialize() {} });\n });\n\n this.runTask(() => this.createApplication({}, MyApplication));\n }\n\n [`@test initializers are passed an app instance`](assert) {\n let MyApplication = _application.default.extend();\n\n MyApplication.instanceInitializer({\n name: 'initializer',\n initialize(instance) {\n assert.ok(instance instanceof _instance.default, 'initialize is passed an application instance');\n }\n });\n\n this.runTask(() => this.createApplication({}, MyApplication));\n }\n\n [`@test initializers can be registered in a specified order`](assert) {\n let order = [];\n let MyApplication = _application.default.extend();\n\n MyApplication.instanceInitializer({\n name: 'fourth',\n after: 'third',\n initialize() {\n order.push('fourth');\n }\n });\n\n MyApplication.instanceInitializer({\n name: 'second',\n after: 'first',\n before: 'third',\n initialize() {\n order.push('second');\n }\n });\n\n MyApplication.instanceInitializer({\n name: 'fifth',\n after: 'fourth',\n before: 'sixth',\n initialize() {\n order.push('fifth');\n }\n });\n\n MyApplication.instanceInitializer({\n name: 'first',\n before: 'second',\n initialize() {\n order.push('first');\n }\n });\n\n MyApplication.instanceInitializer({\n name: 'third',\n initialize() {\n order.push('third');\n }\n });\n\n MyApplication.instanceInitializer({\n name: 'sixth',\n initialize() {\n order.push('sixth');\n }\n });\n\n this.runTask(() => this.createApplication({}, MyApplication));\n\n assert.deepEqual(order, ['first', 'second', 'third', 'fourth', 'fifth', 'sixth']);\n }\n\n [`@test initializers can be registered in a specified order as an array`](assert) {\n let order = [];\n let MyApplication = _application.default.extend();\n\n MyApplication.instanceInitializer({\n name: 'third',\n initialize() {\n order.push('third');\n }\n });\n\n MyApplication.instanceInitializer({\n name: 'second',\n after: 'first',\n before: ['third', 'fourth'],\n initialize() {\n order.push('second');\n }\n });\n\n MyApplication.instanceInitializer({\n name: 'fourth',\n after: ['second', 'third'],\n initialize() {\n order.push('fourth');\n }\n });\n\n MyApplication.instanceInitializer({\n name: 'fifth',\n after: 'fourth',\n before: 'sixth',\n initialize() {\n order.push('fifth');\n }\n });\n\n MyApplication.instanceInitializer({\n name: 'first',\n before: ['second'],\n initialize() {\n order.push('first');\n }\n });\n\n MyApplication.instanceInitializer({\n name: 'sixth',\n initialize() {\n order.push('sixth');\n }\n });\n\n this.runTask(() => this.createApplication({}, MyApplication));\n\n assert.deepEqual(order, ['first', 'second', 'third', 'fourth', 'fifth', 'sixth']);\n }\n\n [`@test initializers can have multiple dependencies`](assert) {\n let order = [];\n let MyApplication = _application.default.extend();\n let a = {\n name: 'a',\n before: 'b',\n initialize() {\n order.push('a');\n }\n };\n let b = {\n name: 'b',\n initialize() {\n order.push('b');\n }\n };\n let c = {\n name: 'c',\n after: 'b',\n initialize() {\n order.push('c');\n }\n };\n let afterB = {\n name: 'after b',\n after: 'b',\n initialize() {\n order.push('after b');\n }\n };\n let afterC = {\n name: 'after c',\n after: 'c',\n initialize() {\n order.push('after c');\n }\n };\n\n MyApplication.instanceInitializer(b);\n MyApplication.instanceInitializer(a);\n MyApplication.instanceInitializer(afterC);\n MyApplication.instanceInitializer(afterB);\n MyApplication.instanceInitializer(c);\n\n this.runTask(() => this.createApplication({}, MyApplication));\n\n assert.ok(order.indexOf(a.name) < order.indexOf(b.name), 'a < b');\n assert.ok(order.indexOf(b.name) < order.indexOf(c.name), 'b < c');\n assert.ok(order.indexOf(b.name) < order.indexOf(afterB.name), 'b < afterB');\n assert.ok(order.indexOf(c.name) < order.indexOf(afterC.name), 'c < afterC');\n }\n\n [`@test initializers set on Application subclasses should not be shared between apps`](assert) {\n let firstInitializerRunCount = 0;\n let secondInitializerRunCount = 0;\n let FirstApp = _application.default.extend();\n\n FirstApp.instanceInitializer({\n name: 'first',\n initialize() {\n firstInitializerRunCount++;\n }\n });\n\n let SecondApp = _application.default.extend();\n SecondApp.instanceInitializer({\n name: 'second',\n initialize() {\n secondInitializerRunCount++;\n }\n });\n\n this.runTask(() => this.createApplication({}, FirstApp));\n\n assert.equal(firstInitializerRunCount, 1, 'first initializer only was run');\n assert.equal(secondInitializerRunCount, 0, 'first initializer only was run');\n\n this.runTask(() => this.createSecondApplication({}, SecondApp));\n\n assert.equal(firstInitializerRunCount, 1, 'second initializer only was run');\n assert.equal(secondInitializerRunCount, 1, 'second initializer only was run');\n }\n\n [`@test initializers are concatenated`](assert) {\n let firstInitializerRunCount = 0;\n let secondInitializerRunCount = 0;\n let FirstApp = _application.default.extend();\n\n FirstApp.instanceInitializer({\n name: 'first',\n initialize() {\n firstInitializerRunCount++;\n }\n });\n\n let SecondApp = FirstApp.extend();\n SecondApp.instanceInitializer({\n name: 'second',\n initialize() {\n secondInitializerRunCount++;\n }\n });\n\n this.runTask(() => this.createApplication({}, FirstApp));\n\n assert.equal(firstInitializerRunCount, 1, 'first initializer only was run when base class created');\n assert.equal(secondInitializerRunCount, 0, 'first initializer only was run when base class created');\n\n firstInitializerRunCount = 0;\n this.runTask(() => this.createSecondApplication({}, SecondApp));\n\n assert.equal(firstInitializerRunCount, 1, 'first initializer was run when subclass created');\n assert.equal(secondInitializerRunCount, 1, 'second initializers was run when subclass created');\n }\n\n [`@test initializers are per-app`](assert) {\n assert.expect(2);\n\n let FirstApp = _application.default.extend();\n FirstApp.instanceInitializer({\n name: 'abc',\n initialize() {}\n });\n\n expectAssertion(function () {\n FirstApp.instanceInitializer({\n name: 'abc',\n initialize() {}\n });\n });\n\n this.runTask(() => this.createApplication({}, FirstApp));\n\n let SecondApp = _application.default.extend();\n SecondApp.instanceInitializer({\n name: 'abc',\n initialize() {}\n });\n\n this.runTask(() => this.createSecondApplication({}, SecondApp));\n\n assert.ok(true, 'Two apps can have initializers named the same.');\n }\n\n [`@test initializers are run before ready hook`](assert) {\n assert.expect(2);\n\n let MyApplication = _application.default.extend({\n ready() {\n assert.ok(true, 'ready is called');\n readyWasCalled = false;\n }\n });\n let readyWasCalled = false;\n\n MyApplication.instanceInitializer({\n name: 'initializer',\n initialize() {\n assert.ok(!readyWasCalled, 'ready is not yet called');\n }\n });\n\n this.runTask(() => this.createApplication({}, MyApplication));\n }\n\n [`@test initializers are executed in their own context`](assert) {\n assert.expect(1);\n\n let MyApplication = _application.default.extend();\n\n MyApplication.instanceInitializer({\n name: 'coolInitializer',\n myProperty: 'cool',\n initialize() {\n assert.equal(this.myProperty, 'cool', 'should have access to its own context');\n }\n });\n\n this.runTask(() => this.createApplication({}, MyApplication));\n }\n\n [`@test initializers get an instance on app reset`](assert) {\n assert.expect(2);\n\n let MyApplication = _application.default.extend();\n\n MyApplication.instanceInitializer({\n name: 'giveMeAnInstance',\n initialize(instance) {\n assert.ok(!!instance, 'Initializer got an instance');\n }\n });\n\n this.runTask(() => this.createApplication({}, MyApplication));\n\n this.runTask(() => this.application.reset());\n }\n });\n});","enifed('@ember/application/tests/lazy_load_test', ['@ember/runloop', '@ember/application', 'internal-test-helpers'], function (_runloop, _application, _internalTestHelpers) {\n 'use strict';\n\n (0, _internalTestHelpers.moduleFor)('Lazy Loading', class extends _internalTestHelpers.AbstractTestCase {\n afterEach() {\n let keys = Object.keys(_application._loaded);\n for (let i = 0; i < keys.length; i++) {\n delete _application._loaded[keys[i]];\n }\n }\n\n ['@test if a load hook is registered, it is executed when runLoadHooks are exected'](assert) {\n let count = 0;\n\n (0, _runloop.run)(function () {\n (0, _application.onLoad)('__test_hook__', function (object) {\n count += object;\n });\n });\n\n (0, _runloop.run)(function () {\n (0, _application.runLoadHooks)('__test_hook__', 1);\n });\n\n assert.equal(count, 1, 'the object was passed into the load hook');\n }\n\n ['@test if runLoadHooks was already run, it executes newly added hooks immediately'](assert) {\n let count = 0;\n (0, _runloop.run)(() => {\n (0, _application.onLoad)('__test_hook__', object => count += object);\n });\n\n (0, _runloop.run)(() => (0, _application.runLoadHooks)('__test_hook__', 1));\n\n count = 0;\n (0, _runloop.run)(() => {\n (0, _application.onLoad)('__test_hook__', object => count += object);\n });\n\n assert.equal(count, 1, 'the original object was passed into the load hook');\n }\n\n [\"@test hooks in ENV.EMBER_LOAD_HOOKS['hookName'] get executed\"](assert) {\n // Note that the necessary code to perform this test is run before\n // the Ember lib is loaded in tests/index.html\n\n (0, _runloop.run)(() => {\n (0, _application.runLoadHooks)('__before_ember_test_hook__', 1);\n });\n\n assert.equal(window.ENV.__test_hook_count__, 1, 'the object was passed into the load hook');\n }\n\n ['@test load hooks trigger a custom event'](assert) {\n if (typeof window === 'object' && typeof window.dispatchEvent === 'function' && typeof CustomEvent === 'function') {\n let eventObject = 'super duper awesome events';\n\n window.addEventListener('__test_hook_for_events__', function (e) {\n assert.ok(true, 'custom event was fired');\n assert.equal(e.detail, eventObject, 'event details are provided properly');\n });\n\n (0, _runloop.run)(() => {\n (0, _application.runLoadHooks)('__test_hook_for_events__', eventObject);\n });\n } else {\n assert.expect(0);\n }\n }\n });\n});","enifed('@ember/application/tests/logging_test', ['internal-test-helpers', '@ember/controller', '@ember/-internals/routing', '@ember/polyfills'], function (_internalTestHelpers, _controller, _routing, _polyfills) {\n 'use strict';\n\n /*globals EmberDev */\n\n class LoggingApplicationTestCase extends _internalTestHelpers.ApplicationTestCase {\n constructor() {\n super();\n\n this.logs = {};\n\n /* eslint-disable no-console */\n this._originalLogger = console.info;\n\n console.info = (_, { fullName }) => {\n if (!this.logs.hasOwnProperty(fullName)) {\n this.logs[fullName] = 0;\n }\n /* eslint-ensable no-console */\n this.logs[fullName]++;\n };\n\n this.router.map(function () {\n this.route('posts', { resetNamespace: true });\n });\n }\n\n teardown() {\n /* eslint-disable no-console */\n console.info = this._originalLogger;\n /* eslint-enable no-console */\n super.teardown();\n }\n }\n\n (0, _internalTestHelpers.moduleFor)('Application with LOG_ACTIVE_GENERATION=true', class extends LoggingApplicationTestCase {\n get applicationOptions() {\n return (0, _polyfills.assign)(super.applicationOptions, {\n LOG_ACTIVE_GENERATION: true\n });\n }\n\n ['@test log class generation if logging enabled'](assert) {\n if (EmberDev && EmberDev.runningProdBuild) {\n assert.ok(true, 'Logging does not occur in production builds');\n return;\n }\n\n return this.visit('/posts').then(() => {\n assert.equal(Object.keys(this.logs).length, 4, 'expected logs');\n });\n }\n\n ['@test actively generated classes get logged'](assert) {\n if (EmberDev && EmberDev.runningProdBuild) {\n assert.ok(true, 'Logging does not occur in production builds');\n return;\n }\n\n return this.visit('/posts').then(() => {\n assert.equal(this.logs['controller:application'], 1, 'expected: ApplicationController was generated');\n assert.equal(this.logs['controller:posts'], 1, 'expected: PostsController was generated');\n\n assert.equal(this.logs['route:application'], 1, 'expected: ApplicationRoute was generated');\n assert.equal(this.logs['route:posts'], 1, 'expected: PostsRoute was generated');\n });\n }\n\n ['@test predefined classes do not get logged'](assert) {\n this.add('controller:application', _controller.default.extend());\n this.add('controller:posts', _controller.default.extend());\n this.add('route:application', _routing.Route.extend());\n this.add('route:posts', _routing.Route.extend());\n\n return this.visit('/posts').then(() => {\n assert.ok(!this.logs['controller:application'], 'did not expect: ApplicationController was generated');\n assert.ok(!this.logs['controller:posts'], 'did not expect: PostsController was generated');\n\n assert.ok(!this.logs['route:application'], 'did not expect: ApplicationRoute was generated');\n assert.ok(!this.logs['route:posts'], 'did not expect: PostsRoute was generated');\n });\n }\n });\n\n (0, _internalTestHelpers.moduleFor)('Application when LOG_ACTIVE_GENERATION=false', class extends LoggingApplicationTestCase {\n get applicationOptions() {\n return (0, _polyfills.assign)(super.applicationOptions, {\n LOG_ACTIVE_GENERATION: false\n });\n }\n\n [`@test do NOT log class generation if logging disabled`](assert) {\n return this.visit('/posts').then(() => {\n assert.equal(Object.keys(this.logs).length, 0, 'expected logs');\n });\n }\n });\n\n (0, _internalTestHelpers.moduleFor)('Application with LOG_VIEW_LOOKUPS=true', class extends LoggingApplicationTestCase {\n get applicationOptions() {\n return (0, _polyfills.assign)(super.applicationOptions, {\n LOG_VIEW_LOOKUPS: true\n });\n }\n\n [`@test log when template and view are missing when flag is active`](assert) {\n if (EmberDev && EmberDev.runningProdBuild) {\n assert.ok(true, 'Logging does not occur in production builds');\n return;\n }\n\n this.addTemplate('application', '{{outlet}}');\n\n return this.visit('/').then(() => this.visit('/posts')).then(() => {\n assert.equal(this.logs['template:application'], undefined, 'expected: Should not log template:application since it exists.');\n assert.equal(this.logs['template:index'], 1, 'expected: Could not find \"index\" template or view.');\n assert.equal(this.logs['template:posts'], 1, 'expected: Could not find \"posts\" template or view.');\n });\n }\n });\n\n (0, _internalTestHelpers.moduleFor)('Application with LOG_VIEW_LOOKUPS=false', class extends LoggingApplicationTestCase {\n get applicationOptions() {\n return (0, _polyfills.assign)(super.applicationOptions, {\n LOG_VIEW_LOOKUPS: false\n });\n }\n\n [`@test do not log when template and view are missing when flag is not true`](assert) {\n return this.visit('/posts').then(() => {\n assert.equal(Object.keys(this.logs).length, 0, 'expected no logs');\n });\n }\n\n [`@test do not log which views are used with templates when flag is not true`](assert) {\n return this.visit('/posts').then(() => {\n assert.equal(Object.keys(this.logs).length, 0, 'expected no logs');\n });\n }\n });\n});","enifed('@ember/application/tests/readiness_test', ['internal-test-helpers', '@ember/runloop', '@ember/application'], function (_internalTestHelpers, _runloop, _application) {\n 'use strict';\n\n let jQuery, application, Application;\n let readyWasCalled, domReady, readyCallbacks;\n\n // We are using a small mock of jQuery because jQuery is third-party code with\n // very well-defined semantics, and we want to confirm that a jQuery stub run\n // in a more minimal server environment that implements this behavior will be\n // sufficient for Ember's requirements.\n (0, _internalTestHelpers.moduleFor)('Application readiness', class extends _internalTestHelpers.ApplicationTestCase {\n constructor() {\n super();\n\n readyWasCalled = 0;\n readyCallbacks = [];\n\n let jQueryInstance = {\n ready(callback) {\n readyCallbacks.push(callback);\n if (jQuery.isReady) {\n domReady();\n }\n }\n };\n\n jQuery = function () {\n return jQueryInstance;\n };\n jQuery.isReady = false;\n\n let domReadyCalled = 0;\n domReady = function () {\n if (domReadyCalled !== 0) {\n return;\n }\n domReadyCalled++;\n for (let i = 0; i < readyCallbacks.length; i++) {\n readyCallbacks[i]();\n }\n };\n\n Application = _application.default.extend({\n $: jQuery,\n\n ready() {\n readyWasCalled++;\n }\n });\n }\n\n teardown() {\n if (application) {\n (0, _runloop.run)(() => application.destroy());\n jQuery = readyCallbacks = domReady = Application = application = undefined;\n }\n }\n\n // These tests are confirming that if the callbacks passed into jQuery's ready hook is called\n // synchronously during the application's initialization, we get the same behavior as if\n // it was triggered after initialization.\n\n [\"@test Application's ready event is called right away if jQuery is already ready\"](assert) {\n jQuery.isReady = true;\n\n (0, _runloop.run)(() => {\n application = Application.create({ router: false });\n\n assert.equal(readyWasCalled, 0, 'ready is not called until later');\n });\n\n assert.equal(readyWasCalled, 1, 'ready was called');\n\n domReady();\n\n assert.equal(readyWasCalled, 1, \"application's ready was not called again\");\n }\n\n [\"@test Application's ready event is called after the document becomes ready\"](assert) {\n (0, _runloop.run)(() => {\n application = Application.create({ router: false });\n });\n\n assert.equal(readyWasCalled, 0, \"ready wasn't called yet\");\n\n domReady();\n\n assert.equal(readyWasCalled, 1, 'ready was called now that DOM is ready');\n }\n\n [\"@test Application's ready event can be deferred by other components\"](assert) {\n (0, _runloop.run)(() => {\n application = Application.create({ router: false });\n application.deferReadiness();\n });\n\n assert.equal(readyWasCalled, 0, \"ready wasn't called yet\");\n\n domReady();\n\n assert.equal(readyWasCalled, 0, \"ready wasn't called yet\");\n\n (0, _runloop.run)(() => {\n application.advanceReadiness();\n assert.equal(readyWasCalled, 0);\n });\n\n assert.equal(readyWasCalled, 1, 'ready was called now all readiness deferrals are advanced');\n }\n\n [\"@test Application's ready event can be deferred by other components\"](assert) {\n jQuery.isReady = false;\n\n (0, _runloop.run)(() => {\n application = Application.create({ router: false });\n application.deferReadiness();\n assert.equal(readyWasCalled, 0, \"ready wasn't called yet\");\n });\n\n domReady();\n\n assert.equal(readyWasCalled, 0, \"ready wasn't called yet\");\n\n (0, _runloop.run)(() => {\n application.advanceReadiness();\n });\n\n assert.equal(readyWasCalled, 1, 'ready was called now all readiness deferrals are advanced');\n\n expectAssertion(() => {\n application.deferReadiness();\n });\n }\n });\n});","enifed('@ember/application/tests/reset_test', ['@ember/runloop', '@ember/-internals/metal', '@ember/controller', '@ember/-internals/routing', 'internal-test-helpers'], function (_runloop, _metal, _controller, _routing, _internalTestHelpers) {\n 'use strict';\n\n (0, _internalTestHelpers.moduleFor)('Application - resetting', class extends _internalTestHelpers.AutobootApplicationTestCase {\n ['@test Brings its own run-loop if not provided'](assert) {\n assert.expect(0);\n (0, _runloop.run)(() => this.createApplication());\n this.application.reset();\n }\n\n ['@test Does not bring its own run loop if one is already provided'](assert) {\n assert.expect(3);\n\n let didBecomeReady = false;\n\n (0, _runloop.run)(() => this.createApplication());\n\n (0, _runloop.run)(() => {\n this.application.ready = () => {\n didBecomeReady = true;\n };\n\n this.application.reset();\n\n this.application.deferReadiness();\n assert.ok(!didBecomeReady, 'app is not ready');\n });\n\n assert.ok(!didBecomeReady, 'app is not ready');\n (0, _runloop.run)(this.application, 'advanceReadiness');\n assert.ok(didBecomeReady, 'app is ready');\n }\n\n ['@test When an application is reset, new instances of controllers are generated'](assert) {\n (0, _runloop.run)(() => {\n this.createApplication();\n this.add('controller:academic', _controller.default.extend());\n });\n\n let firstController = this.applicationInstance.lookup('controller:academic');\n let secondController = this.applicationInstance.lookup('controller:academic');\n\n this.application.reset();\n\n let thirdController = this.applicationInstance.lookup('controller:academic');\n\n assert.strictEqual(firstController, secondController, 'controllers looked up in succession should be the same instance');\n\n assert.ok(firstController.isDestroying, 'controllers are destroyed when their application is reset');\n\n assert.notStrictEqual(firstController, thirdController, 'controllers looked up after the application is reset should not be the same instance');\n }\n\n ['@test When an application is reset, the eventDispatcher is destroyed and recreated'](assert) {\n let eventDispatcherWasSetup = 0;\n let eventDispatcherWasDestroyed = 0;\n\n let mockEventDispatcher = {\n setup() {\n eventDispatcherWasSetup++;\n },\n destroy() {\n eventDispatcherWasDestroyed++;\n }\n };\n\n (0, _runloop.run)(() => {\n this.createApplication();\n this.add('event_dispatcher:main', {\n create: () => mockEventDispatcher\n });\n\n assert.equal(eventDispatcherWasSetup, 0);\n assert.equal(eventDispatcherWasDestroyed, 0);\n });\n\n assert.equal(eventDispatcherWasSetup, 1);\n assert.equal(eventDispatcherWasDestroyed, 0);\n\n this.application.reset();\n\n assert.equal(eventDispatcherWasDestroyed, 1);\n assert.equal(eventDispatcherWasSetup, 2, 'setup called after reset');\n }\n\n ['@test When an application is reset, the router URL is reset to `/`'](assert) {\n (0, _runloop.run)(() => {\n this.createApplication();\n\n this.add('router:main', _routing.Router.extend({\n location: 'none'\n }));\n\n this.router.map(function () {\n this.route('one');\n this.route('two');\n });\n });\n\n let initialRouter, initialApplicationController;\n return this.visit('/one').then(() => {\n initialApplicationController = this.applicationInstance.lookup('controller:application');\n initialRouter = this.applicationInstance.lookup('router:main');\n let location = initialRouter.get('location');\n\n assert.equal(location.getURL(), '/one');\n assert.equal((0, _metal.get)(initialApplicationController, 'currentPath'), 'one');\n\n this.application.reset();\n\n return this.application._bootPromise;\n }).then(() => {\n let applicationController = this.applicationInstance.lookup('controller:application');\n assert.strictEqual(applicationController, undefined, 'application controller no longer exists');\n\n return this.visit('/one');\n }).then(() => {\n let applicationController = this.applicationInstance.lookup('controller:application');\n let router = this.applicationInstance.lookup('router:main');\n let location = router.get('location');\n\n assert.notEqual(initialRouter, router, 'a different router instance was created');\n assert.notEqual(initialApplicationController, applicationController, 'a different application controller is created');\n\n assert.equal(location.getURL(), '/one');\n assert.equal((0, _metal.get)(applicationController, 'currentPath'), 'one');\n });\n }\n\n ['@test When an application with advance/deferReadiness is reset, the app does correctly become ready after reset'](assert) {\n let readyCallCount = 0;\n\n (0, _runloop.run)(() => {\n this.createApplication({\n ready() {\n readyCallCount++;\n }\n });\n\n this.application.deferReadiness();\n assert.equal(readyCallCount, 0, 'ready has not yet been called');\n });\n\n (0, _runloop.run)(this.application, 'advanceReadiness');\n\n assert.equal(readyCallCount, 1, 'ready was called once');\n\n this.application.reset();\n\n assert.equal(readyCallCount, 2, 'ready was called twice');\n }\n });\n});","enifed('@ember/application/tests/visit_test', ['internal-test-helpers', '@ember/service', '@ember/-internals/runtime', '@ember/runloop', '@ember/application', '@ember/application/instance', '@ember/engine', '@ember/-internals/routing', '@ember/-internals/glimmer', 'ember-template-compiler', '@ember/-internals/environment'], function (_internalTestHelpers, _service, _runtime, _runloop, _application, _instance, _engine, _routing, _glimmer, _emberTemplateCompiler, _environment) {\n 'use strict';\n\n function expectAsyncError() {\n _runtime.RSVP.off('error');\n }\n\n (0, _internalTestHelpers.moduleFor)('Application - visit()', class extends _internalTestHelpers.ApplicationTestCase {\n teardown() {\n _runtime.RSVP.on('error', _runtime.onerrorDefault);\n _environment.ENV._APPLICATION_TEMPLATE_WRAPPER = false;\n super.teardown();\n }\n\n createApplication(options) {\n return super.createApplication(options, _application.default.extend());\n }\n\n assertEmptyFixture(message) {\n this.assert.strictEqual(document.getElementById('qunit-fixture').children.length, 0, `there are no elements in the fixture element ${message ? message : ''}`);\n }\n\n [`@test does not add serialize-mode markers by default`](assert) {\n let templateContent = '
Hi, Mom!
';\n this.addTemplate('index', templateContent);\n let rootElement = document.createElement('div');\n\n let bootOptions = {\n isBrowser: false,\n rootElement\n };\n\n _environment.ENV._APPLICATION_TEMPLATE_WRAPPER = false;\n return this.visit('/', bootOptions).then(() => {\n assert.equal(rootElement.innerHTML, templateContent, 'without serialize flag renders as expected');\n });\n }\n\n [`@test _renderMode: rehydration`](assert) {\n assert.expect(2);\n\n let indexTemplate = '
Hi, Mom!
';\n this.addTemplate('index', indexTemplate);\n let rootElement = document.createElement('div');\n\n let bootOptions = {\n isBrowser: false,\n rootElement,\n _renderMode: 'serialize'\n };\n\n _environment.ENV._APPLICATION_TEMPLATE_WRAPPER = false;\n\n return this.visit('/', bootOptions).then(instance => {\n assert.ok((0, _glimmer.isSerializationFirstNode)(instance.rootElement.firstChild), 'glimmer-vm comment node was not found');\n }).then(() => {\n return this.runTask(() => {\n this.applicationInstance.destroy();\n this.applicationInstance = null;\n });\n }).then(() => {\n bootOptions = {\n isBrowser: false,\n rootElement,\n _renderMode: 'rehydrate'\n };\n\n this.application.visit('/', bootOptions).then(instance => {\n assert.equal(instance.rootElement.innerHTML, indexTemplate, 'was not properly rehydrated');\n });\n });\n }\n\n // This tests whether the application is \"autobooted\" by registering an\n // instance initializer and asserting it never gets run. Since this is\n // inherently testing that async behavior *doesn't* happen, we set a\n // 500ms timeout to verify that when autoboot is set to false, the\n // instance initializer that would normally get called on DOM ready\n // does not fire.\n [`@test Applications with autoboot set to false do not autoboot`](assert) {\n function delay(time) {\n return new _runtime.RSVP.Promise(resolve => (0, _runloop.later)(resolve, time));\n }\n\n let appBooted = 0;\n let instanceBooted = 0;\n\n this.application.initializer({\n name: 'assert-no-autoboot',\n initialize() {\n appBooted++;\n }\n });\n\n this.application.instanceInitializer({\n name: 'assert-no-autoboot',\n initialize() {\n instanceBooted++;\n }\n });\n\n assert.ok(!this.applicationInstance, 'precond - no instance');\n assert.ok(appBooted === 0, 'precond - not booted');\n assert.ok(instanceBooted === 0, 'precond - not booted');\n\n // Continue after 500ms\n return delay(500).then(() => {\n assert.ok(appBooted === 0, '500ms elapsed without app being booted');\n assert.ok(instanceBooted === 0, '500ms elapsed without instances being booted');\n\n return this.runTask(() => this.application.boot());\n }).then(() => {\n assert.ok(appBooted === 1, 'app should boot when manually calling `app.boot()`');\n assert.ok(instanceBooted === 0, 'no instances should be booted automatically when manually calling `app.boot()');\n });\n }\n\n [`@test calling visit() on an app without first calling boot() should boot the app`](assert) {\n let appBooted = 0;\n let instanceBooted = 0;\n\n this.application.initializer({\n name: 'assert-no-autoboot',\n initialize() {\n appBooted++;\n }\n });\n\n this.application.instanceInitializer({\n name: 'assert-no-autoboot',\n initialize() {\n instanceBooted++;\n }\n });\n\n return this.visit('/').then(() => {\n assert.ok(appBooted === 1, 'the app should be booted`');\n assert.ok(instanceBooted === 1, 'an instances should be booted');\n });\n }\n\n [`@test calling visit() on an already booted app should not boot it again`](assert) {\n let appBooted = 0;\n let instanceBooted = 0;\n\n this.application.initializer({\n name: 'assert-no-autoboot',\n initialize() {\n appBooted++;\n }\n });\n\n this.application.instanceInitializer({\n name: 'assert-no-autoboot',\n initialize() {\n instanceBooted++;\n }\n });\n\n return this.runTask(() => this.application.boot()).then(() => {\n assert.ok(appBooted === 1, 'the app should be booted');\n assert.ok(instanceBooted === 0, 'no instances should be booted');\n\n return this.visit('/');\n }).then(() => {\n assert.ok(appBooted === 1, 'the app should not be booted again');\n assert.ok(instanceBooted === 1, 'an instance should be booted');\n\n /*\n * Destroy the instance.\n */\n return this.runTask(() => {\n this.applicationInstance.destroy();\n this.applicationInstance = null;\n });\n }).then(() => {\n /*\n * Visit on the application a second time. The application should remain\n * booted, but a new instance will be created.\n */\n return this.application.visit('/').then(instance => {\n this.applicationInstance = instance;\n });\n }).then(() => {\n assert.ok(appBooted === 1, 'the app should not be booted again');\n assert.ok(instanceBooted === 2, 'another instance should be booted');\n });\n }\n\n [`@test visit() rejects on application boot failure`](assert) {\n this.application.initializer({\n name: 'error',\n initialize() {\n throw new Error('boot failure');\n }\n });\n\n expectAsyncError();\n\n return this.visit('/').then(() => {\n assert.ok(false, 'It should not resolve the promise');\n }, error => {\n assert.ok(error instanceof Error, 'It should reject the promise with the boot error');\n assert.equal(error.message, 'boot failure');\n });\n }\n\n [`@test visit() rejects on instance boot failure`](assert) {\n this.application.instanceInitializer({\n name: 'error',\n initialize() {\n throw new Error('boot failure');\n }\n });\n\n expectAsyncError();\n\n return this.visit('/').then(() => {\n assert.ok(false, 'It should not resolve the promise');\n }, error => {\n assert.ok(error instanceof Error, 'It should reject the promise with the boot error');\n assert.equal(error.message, 'boot failure');\n });\n }\n\n [`@test visit() follows redirects`](assert) {\n this.router.map(function () {\n this.route('a');\n this.route('b', { path: '/b/:b' });\n this.route('c', { path: '/c/:c' });\n });\n\n this.add('route:a', _routing.Route.extend({\n afterModel() {\n this.replaceWith('b', 'zomg');\n }\n }));\n\n this.add('route:b', _routing.Route.extend({\n afterModel(params) {\n this.transitionTo('c', params.b);\n }\n }));\n\n /*\n * First call to `visit` is `this.application.visit` and returns the\n * applicationInstance.\n */\n return this.visit('/a').then(instance => {\n assert.ok(instance instanceof _instance.default, 'promise is resolved with an ApplicationInstance');\n assert.equal(instance.getURL(), '/c/zomg', 'It should follow all redirects');\n });\n }\n\n [`@test visit() rejects if an error occurred during a transition`](assert) {\n this.router.map(function () {\n this.route('a');\n this.route('b', { path: '/b/:b' });\n this.route('c', { path: '/c/:c' });\n });\n\n this.add('route:a', _routing.Route.extend({\n afterModel() {\n this.replaceWith('b', 'zomg');\n }\n }));\n\n this.add('route:b', _routing.Route.extend({\n afterModel(params) {\n this.transitionTo('c', params.b);\n }\n }));\n\n this.add('route:c', _routing.Route.extend({\n afterModel() {\n throw new Error('transition failure');\n }\n }));\n\n expectAsyncError();\n\n return this.visit('/a').then(() => {\n assert.ok(false, 'It should not resolve the promise');\n }, error => {\n assert.ok(error instanceof Error, 'It should reject the promise with the boot error');\n assert.equal(error.message, 'transition failure');\n });\n }\n\n [`@test visit() chain`](assert) {\n this.router.map(function () {\n this.route('a');\n this.route('b');\n this.route('c');\n });\n\n return this.visit('/').then(instance => {\n assert.ok(instance instanceof _instance.default, 'promise is resolved with an ApplicationInstance');\n assert.equal(instance.getURL(), '/');\n\n return instance.visit('/a');\n }).then(instance => {\n assert.ok(instance instanceof _instance.default, 'promise is resolved with an ApplicationInstance');\n assert.equal(instance.getURL(), '/a');\n\n return instance.visit('/b');\n }).then(instance => {\n assert.ok(instance instanceof _instance.default, 'promise is resolved with an ApplicationInstance');\n assert.equal(instance.getURL(), '/b');\n\n return instance.visit('/c');\n }).then(instance => {\n assert.ok(instance instanceof _instance.default, 'promise is resolved with an ApplicationInstance');\n assert.equal(instance.getURL(), '/c');\n });\n }\n\n [`@test visit() returns a promise that resolves when the view has rendered`](assert) {\n this.addTemplate('application', `
Hello world
`);\n\n this.assertEmptyFixture();\n\n return this.visit('/').then(instance => {\n assert.ok(instance instanceof _instance.default, 'promise is resolved with an ApplicationInstance');\n assert.equal(this.element.textContent, 'Hello world', 'the application was rendered once the promise resolves');\n });\n }\n\n [`@test visit() returns a promise that resolves without rendering when shouldRender is set to false`](assert) {\n assert.expect(3);\n\n this.addTemplate('application', '
Hello world
');\n\n this.assertEmptyFixture();\n\n return this.visit('/', { shouldRender: false }).then(instance => {\n assert.ok(instance instanceof _instance.default, 'promise is resolved with an ApplicationInstance');\n\n this.assertEmptyFixture('after visit');\n });\n }\n\n [`@test visit() renders a template when shouldRender is set to true`](assert) {\n assert.expect(3);\n\n this.addTemplate('application', '
Hello world
');\n\n this.assertEmptyFixture();\n\n return this.visit('/', { shouldRender: true }).then(instance => {\n assert.ok(instance instanceof _instance.default, 'promise is resolved with an ApplicationInstance');\n assert.strictEqual(document.querySelector('#qunit-fixture').children.length, 1, 'there is 1 element in the fixture element after visit');\n });\n }\n\n [`@test visit() returns a promise that resolves without rendering when shouldRender is set to false with Engines`](assert) {\n assert.expect(3);\n\n this.router.map(function () {\n this.mount('blog');\n });\n\n this.addTemplate('application', '
Hello world
');\n\n // Register engine\n let BlogEngine = _engine.default.extend();\n this.add('engine:blog', BlogEngine);\n\n // Register engine route map\n let BlogMap = function () {};\n this.add('route-map:blog', BlogMap);\n\n this.assertEmptyFixture();\n\n return this.visit('/blog', { shouldRender: false }).then(instance => {\n assert.ok(instance instanceof _instance.default, 'promise is resolved with an ApplicationInstance');\n\n this.assertEmptyFixture('after visit');\n });\n }\n\n [`@test visit() does not setup the event_dispatcher:main if isInteractive is false (with Engines) GH#15615`](assert) {\n assert.expect(3);\n\n this.router.map(function () {\n this.mount('blog');\n });\n\n this.addTemplate('application', '
Hello world
{{outlet}}');\n this.add('event_dispatcher:main', {\n create() {\n throw new Error('should not happen!');\n }\n });\n\n // Register engine\n let BlogEngine = _engine.default.extend({\n init(...args) {\n this._super.apply(this, args);\n this.register('template:application', (0, _emberTemplateCompiler.compile)('{{cache-money}}'));\n this.register('template:components/cache-money', (0, _emberTemplateCompiler.compile)(`\n
Dis cache money
\n `));\n this.register('component:cache-money', _glimmer.Component.extend({}));\n }\n });\n this.add('engine:blog', BlogEngine);\n\n // Register engine route map\n let BlogMap = function () {};\n this.add('route-map:blog', BlogMap);\n\n this.assertEmptyFixture();\n\n return this.visit('/blog', { isInteractive: false }).then(instance => {\n assert.ok(instance instanceof _instance.default, 'promise is resolved with an ApplicationInstance');\n assert.strictEqual(this.element.querySelector('p').textContent, 'Dis cache money', 'Engine component is resolved');\n });\n }\n\n [`@test visit() on engine resolves engine component`](assert) {\n assert.expect(2);\n\n this.router.map(function () {\n this.mount('blog');\n });\n\n // Register engine\n let BlogEngine = _engine.default.extend({\n init(...args) {\n this._super.apply(this, args);\n this.register('template:application', (0, _emberTemplateCompiler.compile)('{{cache-money}}'));\n this.register('template:components/cache-money', (0, _emberTemplateCompiler.compile)(`\n
\n `);\n this.addTemplate('index', `{{index-wrapper}}`);\n\n this.runTask(() => {\n this.application.advanceReadiness();\n });\n\n let { application: { testHelpers: { wait, triggerEvent } } } = this;\n return wait().then(() => {\n return triggerEvent('.input', '#limited', 'keydown', {\n keyCode: 13\n });\n }).then(() => {\n assert.equal(event.keyCode, 13, 'options were passed');\n assert.equal(event.type, 'keydown', 'correct event was triggered');\n assert.equal(event.target.getAttribute('id'), 'inside-scope', 'triggered on the correct element');\n });\n }\n });\n\n (0, _internalTestHelpers.moduleFor)('ember-testing: debugging helpers', class extends HelpersApplicationTestCase {\n afterEach() {\n super.afterEach();\n (0, _debug.setDebugFunction)('info', originalInfo);\n }\n\n constructor() {\n super();\n this.runTask(() => {\n this.application.advanceReadiness();\n });\n }\n\n [`@test pauseTest pauses`](assert) {\n assert.expect(1);\n // overwrite info to supress the console output (see https://github.com/emberjs/ember.js/issues/16391)\n (0, _debug.setDebugFunction)('info', noop);\n\n let { andThen, pauseTest } = this.application.testHelpers;\n\n andThen(() => {\n _test.default.adapter.asyncStart = () => {\n assert.ok(true, 'Async start should be called after waiting for other helpers');\n };\n });\n\n pauseTest();\n }\n\n [`@test resumeTest resumes paused tests`](assert) {\n assert.expect(1);\n // overwrite info to supress the console output (see https://github.com/emberjs/ember.js/issues/16391)\n (0, _debug.setDebugFunction)('info', noop);\n\n let { application: { testHelpers: { pauseTest, resumeTest } } } = this;\n\n (0, _runloop.later)(() => resumeTest(), 20);\n return pauseTest().then(() => {\n assert.ok(true, 'pauseTest promise was resolved');\n });\n }\n\n [`@test resumeTest throws if nothing to resume`](assert) {\n assert.expect(1);\n\n assert.throws(() => {\n this.application.testHelpers.resumeTest();\n }, /Testing has not been paused. There is nothing to resume./);\n }\n });\n\n (0, _internalTestHelpers.moduleFor)('ember-testing: routing helpers', class extends HelpersTestCase {\n constructor() {\n super();\n this.runTask(() => {\n this.createApplication();\n this.application.setupForTesting();\n this.application.injectTestHelpers();\n this.router.map(function () {\n this.route('posts', { resetNamespace: true }, function () {\n this.route('new');\n this.route('edit', { resetNamespace: true });\n });\n });\n });\n this.runTask(() => {\n this.application.advanceReadiness();\n });\n }\n\n [`@test currentRouteName for '/'`](assert) {\n assert.expect(3);\n\n let { application: { testHelpers } } = this;\n return testHelpers.visit('/').then(() => {\n assert.equal(testHelpers.currentRouteName(), 'index', `should equal 'index'.`);\n assert.equal(testHelpers.currentPath(), 'index', `should equal 'index'.`);\n assert.equal(testHelpers.currentURL(), '/', `should equal '/'.`);\n });\n }\n\n [`@test currentRouteName for '/posts'`](assert) {\n assert.expect(3);\n\n let { application: { testHelpers } } = this;\n return testHelpers.visit('/posts').then(() => {\n assert.equal(testHelpers.currentRouteName(), 'posts.index', `should equal 'posts.index'.`);\n assert.equal(testHelpers.currentPath(), 'posts.index', `should equal 'posts.index'.`);\n assert.equal(testHelpers.currentURL(), '/posts', `should equal '/posts'.`);\n });\n }\n\n [`@test currentRouteName for '/posts/new'`](assert) {\n assert.expect(3);\n\n let { application: { testHelpers } } = this;\n return testHelpers.visit('/posts/new').then(() => {\n assert.equal(testHelpers.currentRouteName(), 'posts.new', `should equal 'posts.new'.`);\n assert.equal(testHelpers.currentPath(), 'posts.new', `should equal 'posts.new'.`);\n assert.equal(testHelpers.currentURL(), '/posts/new', `should equal '/posts/new'.`);\n });\n }\n\n [`@test currentRouteName for '/posts/edit'`](assert) {\n assert.expect(3);\n\n let { application: { testHelpers } } = this;\n return testHelpers.visit('/posts/edit').then(() => {\n assert.equal(testHelpers.currentRouteName(), 'edit', `should equal 'edit'.`);\n assert.equal(testHelpers.currentPath(), 'posts.edit', `should equal 'posts.edit'.`);\n assert.equal(testHelpers.currentURL(), '/posts/edit', `should equal '/posts/edit'.`);\n });\n }\n });\n\n (0, _internalTestHelpers.moduleFor)('ember-testing: pendingRequests', class extends HelpersApplicationTestCase {\n trigger(type, xhr) {\n (0, _views.jQuery)(document).trigger(type, xhr);\n }\n\n [`@test pendingRequests is maintained for ajaxSend and ajaxComplete events`](assert) {\n let done = assert.async();\n assert.equal((0, _pending_requests.pendingRequests)(), 0);\n\n let xhr = { some: 'xhr' };\n\n this.trigger('ajaxSend', xhr);\n assert.equal((0, _pending_requests.pendingRequests)(), 1, 'Ember.Test.pendingRequests was incremented');\n\n this.trigger('ajaxComplete', xhr);\n setTimeout(function () {\n assert.equal((0, _pending_requests.pendingRequests)(), 0, 'Ember.Test.pendingRequests was decremented');\n done();\n }, 0);\n }\n\n [`@test pendingRequests is ignores ajaxComplete events from past setupForTesting calls`](assert) {\n assert.equal((0, _pending_requests.pendingRequests)(), 0);\n\n let xhr = { some: 'xhr' };\n\n this.trigger('ajaxSend', xhr);\n assert.equal((0, _pending_requests.pendingRequests)(), 1, 'Ember.Test.pendingRequests was incremented');\n\n (0, _setup_for_testing.default)();\n\n assert.equal((0, _pending_requests.pendingRequests)(), 0, 'Ember.Test.pendingRequests was reset');\n\n let altXhr = { some: 'more xhr' };\n\n this.trigger('ajaxSend', altXhr);\n assert.equal((0, _pending_requests.pendingRequests)(), 1, 'Ember.Test.pendingRequests was incremented');\n\n this.trigger('ajaxComplete', xhr);\n assert.equal((0, _pending_requests.pendingRequests)(), 1, 'Ember.Test.pendingRequests is not impressed with your unexpected complete');\n }\n\n [`@test pendingRequests is reset by setupForTesting`](assert) {\n (0, _pending_requests.incrementPendingRequests)();\n\n (0, _setup_for_testing.default)();\n\n assert.equal((0, _pending_requests.pendingRequests)(), 0, 'pendingRequests is reset');\n }\n });\n\n (0, _internalTestHelpers.moduleFor)('ember-testing: async router', class extends HelpersTestCase {\n constructor() {\n super();\n\n this.runTask(() => {\n this.createApplication();\n\n this.router.map(function () {\n this.route('user', { resetNamespace: true }, function () {\n this.route('profile');\n this.route('edit');\n });\n });\n\n // Emulate a long-running unscheduled async operation.\n let resolveLater = () => new _runtime.RSVP.Promise(resolve => {\n /*\n * The wait() helper has a 10ms tick. We should resolve() after\n * at least one tick to test whether wait() held off while the\n * async router was still loading. 20ms should be enough.\n */\n (0, _runloop.later)(resolve, { firstName: 'Tom' }, 20);\n });\n\n this.add('route:user', _routing.Route.extend({\n model() {\n return resolveLater();\n }\n }));\n\n this.add('route:user.profile', _routing.Route.extend({\n beforeModel() {\n return resolveLater().then(() => this.transitionTo('user.edit'));\n }\n }));\n\n this.application.setupForTesting();\n });\n\n this.application.injectTestHelpers();\n this.runTask(() => {\n this.application.advanceReadiness();\n });\n }\n\n [`@test currentRouteName for '/user'`](assert) {\n assert.expect(4);\n\n let { application: { testHelpers } } = this;\n return testHelpers.visit('/user').then(() => {\n assert.equal(testHelpers.currentRouteName(), 'user.index', `should equal 'user.index'.`);\n assert.equal(testHelpers.currentPath(), 'user.index', `should equal 'user.index'.`);\n assert.equal(testHelpers.currentURL(), '/user', `should equal '/user'.`);\n let userRoute = this.applicationInstance.lookup('route:user');\n assert.equal(userRoute.get('controller.model.firstName'), 'Tom', `should equal 'Tom'.`);\n });\n }\n\n [`@test currentRouteName for '/user/profile'`](assert) {\n assert.expect(4);\n\n let { application: { testHelpers } } = this;\n return testHelpers.visit('/user/profile').then(() => {\n assert.equal(testHelpers.currentRouteName(), 'user.edit', `should equal 'user.edit'.`);\n assert.equal(testHelpers.currentPath(), 'user.edit', `should equal 'user.edit'.`);\n assert.equal(testHelpers.currentURL(), '/user/edit', `should equal '/user/edit'.`);\n let userRoute = this.applicationInstance.lookup('route:user');\n assert.equal(userRoute.get('controller.model.firstName'), 'Tom', `should equal 'Tom'.`);\n });\n }\n });\n\n (0, _internalTestHelpers.moduleFor)('ember-testing: can override built-in helpers', class extends HelpersTestCase {\n constructor() {\n super();\n this.runTask(() => {\n this.createApplication();\n this.application.setupForTesting();\n });\n this._originalVisitHelper = _test.default._helpers.visit;\n this._originalFindHelper = _test.default._helpers.find;\n }\n\n teardown() {\n _test.default._helpers.visit = this._originalVisitHelper;\n _test.default._helpers.find = this._originalFindHelper;\n super.teardown();\n }\n\n [`@test can override visit helper`](assert) {\n assert.expect(1);\n\n _test.default.registerHelper('visit', () => {\n assert.ok(true, 'custom visit helper was called');\n });\n\n this.application.injectTestHelpers();\n\n return this.application.testHelpers.visit();\n }\n\n [`@test can override find helper`](assert) {\n assert.expect(1);\n\n _test.default.registerHelper('find', () => {\n assert.ok(true, 'custom find helper was called');\n\n return ['not empty array'];\n });\n\n this.application.injectTestHelpers();\n\n return this.application.testHelpers.findWithAssert('.who-cares');\n }\n });\n }\n});","enifed('ember-testing/tests/integration_test', ['internal-test-helpers', 'ember-testing/lib/test', '@ember/-internals/runtime', '@ember/-internals/routing', '@ember/-internals/views'], function (_internalTestHelpers, _test, _runtime, _routing, _views) {\n 'use strict';\n\n (0, _internalTestHelpers.moduleFor)('ember-testing Integration tests of acceptance', class extends _internalTestHelpers.AutobootApplicationTestCase {\n constructor() {\n super();\n\n this.modelContent = [];\n this._originalAdapter = _test.default.adapter;\n\n this.runTask(() => {\n this.createApplication();\n\n this.addTemplate('people', `\n
\n {{#each model as |person|}}\n
{{person.firstName}}
\n {{/each}}\n
\n `);\n\n this.router.map(function () {\n this.route('people', { path: '/' });\n });\n\n this.add('route:people', _routing.Route.extend({\n model: () => this.modelContent\n }));\n\n this.application.setupForTesting();\n });\n\n this.runTask(() => {\n this.application.reset();\n });\n\n this.application.injectTestHelpers();\n }\n\n teardown() {\n super.teardown();\n _test.default.adapter = this._originalAdapter;\n }\n\n [`@test template is bound to empty array of people`](assert) {\n if (!_views.jQueryDisabled) {\n this.runTask(() => this.application.advanceReadiness());\n window.visit('/').then(() => {\n let rows = window.find('.name').length;\n assert.equal(rows, 0, 'successfully stubbed an empty array of people');\n });\n } else {\n this.runTask(() => this.application.advanceReadiness());\n window.visit('/').then(() => {\n expectAssertion(() => window.find('.name'), 'If jQuery is disabled, please import and use helpers from @ember/test-helpers [https://github.com/emberjs/ember-test-helpers]. Note: `find` is not an available helper.');\n });\n }\n }\n\n [`@test template is bound to array of 2 people`](assert) {\n if (!_views.jQueryDisabled) {\n this.modelContent = (0, _runtime.A)([]);\n this.modelContent.pushObject({ firstName: 'x' });\n this.modelContent.pushObject({ firstName: 'y' });\n\n this.runTask(() => this.application.advanceReadiness());\n window.visit('/').then(() => {\n let rows = window.find('.name').length;\n assert.equal(rows, 2, 'successfully stubbed a non empty array of people');\n });\n } else {\n assert.expect(0);\n }\n }\n\n [`@test 'visit' can be called without advanceReadiness.`](assert) {\n if (!_views.jQueryDisabled) {\n window.visit('/').then(() => {\n let rows = window.find('.name').length;\n assert.equal(rows, 0, 'stubbed an empty array of people without calling advanceReadiness.');\n });\n } else {\n assert.expect(0);\n }\n }\n });\n});","enifed('ember-testing/tests/reexports_test', ['ember', 'internal-test-helpers'], function (_ember, _internalTestHelpers) {\n 'use strict';\n\n class ReexportsTestCase extends _internalTestHelpers.AbstractTestCase {}\n\n [\n // ember-testing\n ['Test', 'ember-testing'], ['Test.Adapter', 'ember-testing', 'Adapter'], ['Test.QUnitAdapter', 'ember-testing', 'QUnitAdapter'], ['setupForTesting', 'ember-testing']].forEach(reexport => {\n let [path, moduleId, exportName] = reexport;\n\n // default path === exportName if none present\n if (!exportName) {\n exportName = path;\n }\n\n ReexportsTestCase.prototype[`@test Ember.${path} exports correctly`] = function (assert) {\n (0, _internalTestHelpers.confirmExport)(_ember.default, assert, path, moduleId, exportName);\n };\n });\n\n (0, _internalTestHelpers.moduleFor)('ember-testing reexports', ReexportsTestCase);\n});","enifed('ember-testing/tests/test/waiters-test', ['ember-testing/lib/test/waiters', 'internal-test-helpers'], function (_waiters, _internalTestHelpers) {\n 'use strict';\n\n class Waiters {\n constructor() {\n this._waiters = [];\n }\n\n add() {\n this._waiters.push([...arguments]);\n }\n\n register() {\n this.forEach((...args) => {\n (0, _waiters.registerWaiter)(...args);\n });\n }\n\n unregister() {\n this.forEach((...args) => {\n (0, _waiters.unregisterWaiter)(...args);\n });\n }\n\n forEach(callback) {\n for (let i = 0; i < this._waiters.length; i++) {\n let args = this._waiters[i];\n\n callback(...args);\n }\n }\n\n check() {\n this.register();\n let result = (0, _waiters.checkWaiters)();\n this.unregister();\n\n return result;\n }\n }\n\n (0, _internalTestHelpers.moduleFor)('ember-testing: waiters', class extends _internalTestHelpers.AbstractTestCase {\n constructor() {\n super();\n this.waiters = new Waiters();\n }\n\n teardown() {\n this.waiters.unregister();\n }\n\n ['@test registering a waiter'](assert) {\n assert.expect(2);\n\n let obj = { foo: true };\n\n this.waiters.add(obj, function () {\n assert.ok(this.foo, 'has proper `this` context');\n return true;\n });\n\n this.waiters.add(function () {\n assert.ok(true, 'is called');\n return true;\n });\n\n this.waiters.check();\n }\n\n ['@test unregistering a waiter'](assert) {\n assert.expect(2);\n\n let obj = { foo: true };\n\n this.waiters.add(obj, function () {\n assert.ok(true, 'precond - waiter with context is registered');\n return true;\n });\n\n this.waiters.add(function () {\n assert.ok(true, 'precond - waiter without context is registered');\n return true;\n });\n\n this.waiters.check();\n this.waiters.unregister();\n\n (0, _waiters.checkWaiters)();\n }\n\n ['@test checkWaiters returns false if all waiters return true'](assert) {\n assert.expect(3);\n\n this.waiters.add(function () {\n assert.ok(true, 'precond - waiter is registered');\n\n return true;\n });\n\n this.waiters.add(function () {\n assert.ok(true, 'precond - waiter is registered');\n\n return true;\n });\n\n assert.notOk(this.waiters.check(), 'checkWaiters returns true if all waiters return true');\n }\n\n ['@test checkWaiters returns true if any waiters return false'](assert) {\n assert.expect(3);\n\n this.waiters.add(function () {\n assert.ok(true, 'precond - waiter is registered');\n\n return true;\n });\n\n this.waiters.add(function () {\n assert.ok(true, 'precond - waiter is registered');\n\n return false;\n });\n\n assert.ok(this.waiters.check(), 'checkWaiters returns false if any waiters return false');\n }\n\n ['@test checkWaiters short circuits after first falsey waiter'](assert) {\n assert.expect(2);\n\n this.waiters.add(function () {\n assert.ok(true, 'precond - waiter is registered');\n\n return false;\n });\n\n this.waiters.add(function () {\n assert.notOk(true, 'waiter should not be called');\n });\n\n assert.ok(this.waiters.check(), 'checkWaiters returns false if any waiters return false');\n }\n });\n});","enifed('ember/tests/application_lifecycle_test', ['internal-test-helpers', '@ember/application', '@ember/-internals/routing', '@ember/-internals/glimmer', '@ember/debug'], function (_internalTestHelpers, _application, _routing, _glimmer, _debug) {\n 'use strict';\n\n const originalDebug = (0, _debug.getDebugFunction)('debug');\n const noop = function () {};\n\n (0, _internalTestHelpers.moduleFor)('Application Lifecycle - route hooks', class extends _internalTestHelpers.AutobootApplicationTestCase {\n createApplication() {\n let application = super.createApplication(...arguments);\n this.add('router:main', _routing.Router.extend({\n location: 'none'\n }));\n return application;\n }\n\n constructor() {\n (0, _debug.setDebugFunction)('debug', noop);\n super();\n let menuItem = this.menuItem = {};\n\n this.runTask(() => {\n this.createApplication();\n\n let SettingRoute = _routing.Route.extend({\n setupController() {\n this.controller.set('selectedMenuItem', menuItem);\n },\n deactivate() {\n this.controller.set('selectedMenuItem', null);\n }\n });\n this.add('route:index', SettingRoute);\n this.add('route:application', SettingRoute);\n });\n }\n\n teardown() {\n (0, _debug.setDebugFunction)('debug', originalDebug);\n }\n\n get indexController() {\n return this.applicationInstance.lookup('controller:index');\n }\n\n get applicationController() {\n return this.applicationInstance.lookup('controller:application');\n }\n\n [`@test Resetting the application allows controller properties to be set when a route deactivates`](assert) {\n let { indexController, applicationController } = this;\n assert.equal(indexController.get('selectedMenuItem'), this.menuItem);\n assert.equal(applicationController.get('selectedMenuItem'), this.menuItem);\n\n this.application.reset();\n\n assert.equal(indexController.get('selectedMenuItem'), null);\n assert.equal(applicationController.get('selectedMenuItem'), null);\n }\n\n [`@test Destroying the application resets the router before the appInstance is destroyed`](assert) {\n let { indexController, applicationController } = this;\n assert.equal(indexController.get('selectedMenuItem'), this.menuItem);\n assert.equal(applicationController.get('selectedMenuItem'), this.menuItem);\n\n this.runTask(() => {\n this.application.destroy();\n });\n\n assert.equal(indexController.get('selectedMenuItem'), null);\n assert.equal(applicationController.get('selectedMenuItem'), null);\n }\n });\n\n (0, _internalTestHelpers.moduleFor)('Application Lifecycle', class extends _internalTestHelpers.AutobootApplicationTestCase {\n createApplication() {\n let application = super.createApplication(...arguments);\n this.add('router:main', _routing.Router.extend({\n location: 'none'\n }));\n return application;\n }\n\n [`@test Destroying a route after the router does create an undestroyed 'toplevelView'`](assert) {\n this.runTask(() => {\n this.createApplication();\n this.addTemplate('index', `Index!`);\n this.addTemplate('application', `Application! {{outlet}}`);\n });\n\n let router = this.applicationInstance.lookup('router:main');\n let route = this.applicationInstance.lookup('route:index');\n\n this.runTask(() => router.destroy());\n assert.equal(router._toplevelView, null, 'the toplevelView was cleared');\n\n this.runTask(() => route.destroy());\n assert.equal(router._toplevelView, null, 'the toplevelView was not reinitialized');\n\n this.runTask(() => this.application.destroy());\n assert.equal(router._toplevelView, null, 'the toplevelView was not reinitialized');\n }\n\n [`@test initializers can augment an applications customEvents hash`](assert) {\n assert.expect(1);\n\n let MyApplication = _application.default.extend();\n\n MyApplication.initializer({\n name: 'customize-things',\n initialize(application) {\n application.customEvents = {\n wowza: 'wowza'\n };\n }\n });\n\n this.runTask(() => {\n this.createApplication({}, MyApplication);\n\n this.add('component:foo-bar', _glimmer.Component.extend({\n wowza() {\n assert.ok(true, 'fired the event!');\n }\n }));\n\n this.addTemplate('application', `{{foo-bar}}`);\n this.addTemplate('components/foo-bar', ``);\n });\n\n this.$('#wowza-thingy').trigger('wowza');\n }\n\n [`@test instanceInitializers can augment an the customEvents hash`](assert) {\n assert.expect(1);\n\n let MyApplication = _application.default.extend();\n\n MyApplication.instanceInitializer({\n name: 'customize-things',\n initialize(application) {\n application.customEvents = {\n herky: 'jerky'\n };\n }\n });\n this.runTask(() => {\n this.createApplication({}, MyApplication);\n\n this.add('component:foo-bar', _glimmer.Component.extend({\n jerky() {\n assert.ok(true, 'fired the event!');\n }\n }));\n\n this.addTemplate('application', `{{foo-bar}}`);\n this.addTemplate('components/foo-bar', ``);\n });\n\n this.$('#herky-thingy').trigger('herky');\n }\n });\n});","enifed('ember/tests/component_context_test', ['@ember/controller', '@ember/-internals/glimmer', 'internal-test-helpers'], function (_controller, _glimmer, _internalTestHelpers) {\n 'use strict';\n\n (0, _internalTestHelpers.moduleFor)('Application Lifecycle - Component Context', class extends _internalTestHelpers.ApplicationTestCase {\n ['@test Components with a block should have the proper content when a template is provided'](assert) {\n this.addTemplate('application', `\n
\n {{#my-component}}{{text}}{{/my-component}}\n
\n `);\n\n this.add('controller:application', _controller.default.extend({\n text: 'outer'\n }));\n this.addComponent('my-component', {\n ComponentClass: _glimmer.Component.extend({\n text: 'inner'\n }),\n template: `{{text}}-{{yield}}`\n });\n\n return this.visit('/').then(() => {\n let text = (0, _internalTestHelpers.getTextOf)(this.element.querySelector('#wrapper'));\n assert.equal(text, 'inner-outer', 'The component is composed correctly');\n });\n }\n\n ['@test Components with a block should yield the proper content without a template provided'](assert) {\n this.addTemplate('application', `\n
\n {{#my-component}}{{text}}{{/my-component}}\n
\n `);\n\n this.add('controller:application', _controller.default.extend({\n text: 'outer'\n }));\n this.addComponent('my-component', {\n ComponentClass: _glimmer.Component.extend({\n text: 'inner'\n })\n });\n\n return this.visit('/').then(() => {\n let text = (0, _internalTestHelpers.getTextOf)(this.element.querySelector('#wrapper'));\n assert.equal(text, 'outer', 'The component is composed correctly');\n });\n }\n ['@test Components without a block should have the proper content when a template is provided'](assert) {\n this.addTemplate('application', `\n
{{my-component}}
\n `);\n\n this.add('controller:application', _controller.default.extend({\n text: 'outer'\n }));\n this.addComponent('my-component', {\n ComponentClass: _glimmer.Component.extend({\n text: 'inner'\n }),\n template: '{{text}}'\n });\n\n return this.visit('/').then(() => {\n let text = (0, _internalTestHelpers.getTextOf)(this.element.querySelector('#wrapper'));\n assert.equal(text, 'inner', 'The component is composed correctly');\n });\n }\n\n ['@test Components without a block should have the proper content'](assert) {\n this.addTemplate('application', `\n
{{my-component}}
\n `);\n\n this.add('controller:application', _controller.default.extend({\n text: 'outer'\n }));\n this.addComponent('my-component', {\n ComponentClass: _glimmer.Component.extend({\n didInsertElement() {\n this.element.innerHTML = 'Some text inserted';\n }\n })\n });\n\n return this.visit('/').then(() => {\n let text = (0, _internalTestHelpers.getTextOf)(this.element.querySelector('#wrapper'));\n assert.equal(text, 'Some text inserted', 'The component is composed correctly');\n });\n }\n\n ['@test properties of a component without a template should not collide with internal structures [DEPRECATED]'](assert) {\n this.addTemplate('application', `\n
{{my-component data=foo}}
`);\n\n this.add('controller:application', _controller.default.extend({\n text: 'outer',\n foo: 'Some text inserted'\n }));\n this.addComponent('my-component', {\n ComponentClass: _glimmer.Component.extend({\n didInsertElement() {\n this.element.innerHTML = this.get('data');\n }\n })\n });\n\n return this.visit('/').then(() => {\n let text = (0, _internalTestHelpers.getTextOf)(this.element.querySelector('#wrapper'));\n assert.equal(text, 'Some text inserted', 'The component is composed correctly');\n });\n }\n\n ['@test attrs property of a component without a template should not collide with internal structures'](assert) {\n this.addTemplate('application', `\n
{{my-component attrs=foo}}
\n `);\n\n this.add('controller:application', _controller.default.extend({\n text: 'outer',\n foo: 'Some text inserted'\n }));\n this.addComponent('my-component', {\n ComponentClass: _glimmer.Component.extend({\n didInsertElement() {\n this.element.innerHTML = this.get('attrs.attrs.value');\n }\n })\n });\n\n return this.visit('/').then(() => {\n let text = (0, _internalTestHelpers.getTextOf)(this.element.querySelector('#wrapper'));\n assert.equal(text, 'Some text inserted', 'The component is composed correctly');\n });\n }\n\n ['@test Components trigger actions in the parents context when called from within a block'](assert) {\n this.addTemplate('application', `\n
\n `);\n\n this.add('controller:application', _controller.default.extend({\n actions: {\n fizzbuzz() {\n assert.ok(true, 'action triggered on parent');\n }\n }\n }));\n this.addComponent('my-component', {\n ComponentClass: _glimmer.Component.extend({})\n });\n\n return this.visit('/').then(() => {\n this.$('#fizzbuzz', '#wrapper').click();\n });\n }\n\n ['@test Components trigger actions in the components context when called from within its template'](assert) {\n this.addTemplate('application', `\n
{{#my-component}}{{text}}{{/my-component}}
\n `);\n\n this.add('controller:application', _controller.default.extend({\n actions: {\n fizzbuzz() {\n assert.ok(false, 'action on the wrong context');\n }\n }\n }));\n this.addComponent('my-component', {\n ComponentClass: _glimmer.Component.extend({\n actions: {\n fizzbuzz() {\n assert.ok(true, 'action triggered on component');\n }\n }\n }),\n template: `Fizzbuzz`\n });\n\n return this.visit('/').then(() => {\n this.$('#fizzbuzz', '#wrapper').click();\n });\n }\n });\n});","enifed('ember/tests/component_registration_test', ['@ember/application', '@ember/controller', '@ember/-internals/glimmer', 'ember-template-compiler', 'internal-test-helpers', '@ember/-internals/environment'], function (_application, _controller, _glimmer, _emberTemplateCompiler, _internalTestHelpers, _environment) {\n 'use strict';\n\n (0, _internalTestHelpers.moduleFor)('Application Lifecycle - Component Registration', class extends _internalTestHelpers.ApplicationTestCase {\n // This is necessary for this.application.instanceInitializer to not leak between tests\n createApplication(options) {\n return super.createApplication(options, _application.default.extend());\n }\n\n ['@test The helper becomes the body of the component']() {\n this.addTemplate('components/expand-it', '
hello {{yield}}
');\n this.addTemplate('application', 'Hello world {{#expand-it}}world{{/expand-it}}');\n\n return this.visit('/').then(() => {\n this.assertText('Hello world hello world');\n this.assertComponentElement(this.element.firstElementChild, {\n tagName: 'div',\n content: '
hello world
'\n });\n });\n }\n\n ['@test The helper becomes the body of the component (ENV._TEMPLATE_ONLY_GLIMMER_COMPONENTS = true;)']() {\n _environment.ENV._TEMPLATE_ONLY_GLIMMER_COMPONENTS = true;\n this.addTemplate('components/expand-it', '
hello {{yield}}
');\n this.addTemplate('application', 'Hello world {{#expand-it}}world{{/expand-it}}');\n\n return this.visit('/').then(() => {\n this.assertInnerHTML('Hello world
hello world
');\n _environment.ENV._TEMPLATE_ONLY_GLIMMER_COMPONENTS = false;\n });\n }\n\n ['@test If a component is registered, it is used'](assert) {\n this.addTemplate('components/expand-it', '
hello {{yield}}
');\n this.addTemplate('application', `Hello world {{#expand-it}}world{{/expand-it}}`);\n\n this.application.instanceInitializer({\n name: 'expand-it-component',\n initialize(applicationInstance) {\n applicationInstance.register('component:expand-it', _glimmer.Component.extend({\n classNames: 'testing123'\n }));\n }\n });\n\n return this.visit('/').then(() => {\n let text = this.$('div.testing123').text().trim();\n assert.equal(text, 'hello world', 'The component is composed correctly');\n });\n }\n\n ['@test Late-registered components can be rendered with custom `layout` property'](assert) {\n this.addTemplate('application', `
there goes {{my-hero}}
`);\n\n this.application.instanceInitializer({\n name: 'my-hero-component',\n initialize(applicationInstance) {\n applicationInstance.register('component:my-hero', _glimmer.Component.extend({\n classNames: 'testing123',\n layout: (0, _emberTemplateCompiler.compile)('watch him as he GOES')\n }));\n }\n });\n\n return this.visit('/').then(() => {\n let text = this.$('#wrapper').text().trim();\n assert.equal(text, 'there goes watch him as he GOES', 'The component is composed correctly');\n });\n }\n\n ['@test Late-registered components can be rendered with template registered on the container'](assert) {\n this.addTemplate('application', `
hello world {{sally-rutherford}}-{{#sally-rutherford}}!!!{{/sally-rutherford}}
`);\n\n this.application.instanceInitializer({\n name: 'sally-rutherford-component-template',\n initialize(applicationInstance) {\n applicationInstance.register('template:components/sally-rutherford', (0, _emberTemplateCompiler.compile)('funkytowny{{yield}}'));\n }\n });\n this.application.instanceInitializer({\n name: 'sally-rutherford-component',\n initialize(applicationInstance) {\n applicationInstance.register('component:sally-rutherford', _glimmer.Component);\n }\n });\n\n return this.visit('/').then(() => {\n let text = this.$('#wrapper').text().trim();\n assert.equal(text, 'hello world funkytowny-funkytowny!!!', 'The component is composed correctly');\n });\n }\n\n ['@test Late-registered components can be rendered with ONLY the template registered on the container'](assert) {\n this.addTemplate('application', `
hello world {{borf-snorlax}}-{{#borf-snorlax}}!!!{{/borf-snorlax}}
`);\n\n this.application.instanceInitializer({\n name: 'borf-snorlax-component-template',\n initialize(applicationInstance) {\n applicationInstance.register('template:components/borf-snorlax', (0, _emberTemplateCompiler.compile)('goodfreakingTIMES{{yield}}'));\n }\n });\n\n return this.visit('/').then(() => {\n let text = this.$('#wrapper').text().trim();\n assert.equal(text, 'hello world goodfreakingTIMES-goodfreakingTIMES!!!', 'The component is composed correctly');\n });\n }\n\n ['@test Assigning layoutName to a component should setup the template as a layout'](assert) {\n assert.expect(1);\n\n this.addTemplate('application', `
{{#my-component}}{{text}}{{/my-component}}
`);\n this.addTemplate('foo-bar-baz', '{{text}}-{{yield}}');\n\n this.application.instanceInitializer({\n name: 'application-controller',\n initialize(applicationInstance) {\n applicationInstance.register('controller:application', _controller.default.extend({\n text: 'outer'\n }));\n }\n });\n this.application.instanceInitializer({\n name: 'my-component-component',\n initialize(applicationInstance) {\n applicationInstance.register('component:my-component', _glimmer.Component.extend({\n text: 'inner',\n layoutName: 'foo-bar-baz'\n }));\n }\n });\n\n return this.visit('/').then(() => {\n let text = this.$('#wrapper').text().trim();\n assert.equal(text, 'inner-outer', 'The component is composed correctly');\n });\n }\n\n ['@test Assigning layoutName and layout to a component should use the `layout` value'](assert) {\n assert.expect(1);\n\n this.addTemplate('application', `
{{#my-component}}{{text}}{{/my-component}}
`);\n this.addTemplate('foo-bar-baz', 'No way!');\n\n this.application.instanceInitializer({\n name: 'application-controller-layout',\n initialize(applicationInstance) {\n applicationInstance.register('controller:application', _controller.default.extend({\n text: 'outer'\n }));\n }\n });\n this.application.instanceInitializer({\n name: 'my-component-component-layout',\n initialize(applicationInstance) {\n applicationInstance.register('component:my-component', _glimmer.Component.extend({\n text: 'inner',\n layoutName: 'foo-bar-baz',\n layout: (0, _emberTemplateCompiler.compile)('{{text}}-{{yield}}')\n }));\n }\n });\n\n return this.visit('/').then(() => {\n let text = this.$('#wrapper').text().trim();\n assert.equal(text, 'inner-outer', 'The component is composed correctly');\n });\n }\n\n ['@test Using name of component that does not exist']() {\n this.addTemplate('application', `
{{#no-good}} {{/no-good}}
`);\n\n // TODO: Use the async form of expectAssertion here when it is available\n expectAssertion(() => {\n this.visit('/');\n }, /.* named \"no-good\" .*/);\n\n return this.runLoopSettled();\n }\n });\n});","enifed('ember/tests/controller_test', ['@ember/controller', 'internal-test-helpers', '@ember/-internals/glimmer'], function (_controller, _internalTestHelpers, _glimmer) {\n 'use strict';\n\n /*\n In Ember 1.x, controllers subtly affect things like template scope\n and action targets in exciting and often inscrutable ways. This test\n file contains integration tests that verify the correct behavior of\n the many parts of the system that change and rely upon controller scope,\n from the runtime up to the templating layer.\n */\n\n (0, _internalTestHelpers.moduleFor)('Template scoping examples', class extends _internalTestHelpers.ApplicationTestCase {\n ['@test Actions inside an outlet go to the associated controller'](assert) {\n this.add('controller:index', _controller.default.extend({\n actions: {\n componentAction() {\n assert.ok(true, 'controller received the action');\n }\n }\n }));\n\n this.addComponent('component-with-action', {\n ComponentClass: _glimmer.Component.extend({\n classNames: ['component-with-action'],\n click() {\n this.action();\n }\n })\n });\n\n this.addTemplate('index', '{{component-with-action action=(action \"componentAction\")}}');\n\n return this.visit('/').then(() => {\n this.runTask(() => this.$('.component-with-action').click());\n });\n }\n });\n});","enifed('ember/tests/error_handler_test', ['@ember/debug', '@ember/runloop', '@ember/-internals/error-handling', 'rsvp', 'internal-test-helpers'], function (_debug, _runloop, _errorHandling, _rsvp, _internalTestHelpers) {\n 'use strict';\n\n let WINDOW_ONERROR;\n\n function runThatThrowsSync(message = 'Error for testing error handling') {\n return (0, _runloop.run)(() => {\n throw new Error(message);\n });\n }\n\n (0, _internalTestHelpers.moduleFor)('error_handler', class extends _internalTestHelpers.AbstractTestCase {\n beforeEach() {\n // capturing this outside of module scope to ensure we grab\n // the test frameworks own window.onerror to reset it\n WINDOW_ONERROR = window.onerror;\n }\n\n afterEach() {\n (0, _debug.setTesting)(_debug.isTesting);\n window.onerror = WINDOW_ONERROR;\n\n (0, _errorHandling.setOnerror)(undefined);\n }\n\n ['@test by default there is no onerror - sync run'](assert) {\n assert.strictEqual((0, _errorHandling.getOnerror)(), undefined, 'precond - there should be no Ember.onerror set by default');\n assert.throws(runThatThrowsSync, Error, 'errors thrown sync are catchable');\n }\n\n ['@test when Ember.onerror (which rethrows) is registered - sync run'](assert) {\n assert.expect(2);\n (0, _errorHandling.setOnerror)(function (error) {\n assert.ok(true, 'onerror called');\n throw error;\n });\n assert.throws(runThatThrowsSync, Error, 'error is thrown');\n }\n\n ['@test when Ember.onerror (which does not rethrow) is registered - sync run'](assert) {\n assert.expect(2);\n (0, _errorHandling.setOnerror)(function () {\n assert.ok(true, 'onerror called');\n });\n runThatThrowsSync();\n assert.ok(true, 'no error was thrown, Ember.onerror can intercept errors');\n }\n\n ['@test does not swallow exceptions by default (Ember.testing = true, no Ember.onerror) - sync run'](assert) {\n (0, _debug.setTesting)(true);\n\n let error = new Error('the error');\n assert.throws(() => {\n (0, _runloop.run)(() => {\n throw error;\n });\n }, error);\n }\n\n ['@test does not swallow exceptions by default (Ember.testing = false, no Ember.onerror) - sync run'](assert) {\n (0, _debug.setTesting)(false);\n let error = new Error('the error');\n assert.throws(() => {\n (0, _runloop.run)(() => {\n throw error;\n });\n }, error);\n }\n\n ['@test does not swallow exceptions (Ember.testing = false, Ember.onerror which rethrows) - sync run'](assert) {\n assert.expect(2);\n (0, _debug.setTesting)(false);\n\n (0, _errorHandling.setOnerror)(function (error) {\n assert.ok(true, 'Ember.onerror was called');\n throw error;\n });\n\n let error = new Error('the error');\n assert.throws(() => {\n (0, _runloop.run)(() => {\n throw error;\n });\n }, error);\n }\n\n ['@test Ember.onerror can intercept errors (aka swallow) by not rethrowing (Ember.testing = false) - sync run'](assert) {\n assert.expect(1);\n (0, _debug.setTesting)(false);\n\n (0, _errorHandling.setOnerror)(function () {\n assert.ok(true, 'Ember.onerror was called');\n });\n\n let error = new Error('the error');\n try {\n (0, _runloop.run)(() => {\n throw error;\n });\n } catch (e) {\n assert.notOk(true, 'Ember.onerror that does not rethrow is intentionally swallowing errors, try / catch wrapping does not see error');\n }\n }\n\n ['@test does not swallow exceptions by default (Ember.testing = true, no Ember.onerror) - async run'](assert) {\n let done = assert.async();\n let caughtByWindowOnerror;\n\n (0, _debug.setTesting)(true);\n\n window.onerror = function (message) {\n caughtByWindowOnerror = message;\n // prevent \"bubbling\" and therefore failing the test\n return true;\n };\n\n (0, _runloop.later)(() => {\n throw new Error('the error');\n }, 10);\n\n setTimeout(() => {\n assert.pushResult({\n result: /the error/.test(caughtByWindowOnerror),\n actual: caughtByWindowOnerror,\n expected: 'to include `the error`',\n message: 'error should bubble out to window.onerror, and therefore fail tests (due to QUnit implementing window.onerror)'\n });\n\n done();\n }, 20);\n }\n\n ['@test does not swallow exceptions by default (Ember.testing = false, no Ember.onerror) - async run'](assert) {\n let done = assert.async();\n let caughtByWindowOnerror;\n\n (0, _debug.setTesting)(false);\n\n window.onerror = function (message) {\n caughtByWindowOnerror = message;\n // prevent \"bubbling\" and therefore failing the test\n return true;\n };\n\n (0, _runloop.later)(() => {\n throw new Error('the error');\n }, 10);\n\n setTimeout(() => {\n assert.pushResult({\n result: /the error/.test(caughtByWindowOnerror),\n actual: caughtByWindowOnerror,\n expected: 'to include `the error`',\n message: 'error should bubble out to window.onerror, and therefore fail tests (due to QUnit implementing window.onerror)'\n });\n\n done();\n }, 20);\n }\n\n ['@test Ember.onerror can intercept errors (aka swallow) by not rethrowing (Ember.testing = false) - async run'](assert) {\n let done = assert.async();\n\n (0, _debug.setTesting)(false);\n\n window.onerror = function () {\n assert.notOk(true, 'window.onerror is never invoked when Ember.onerror intentionally swallows errors');\n // prevent \"bubbling\" and therefore failing the test\n return true;\n };\n\n let thrown = new Error('the error');\n (0, _errorHandling.setOnerror)(function (error) {\n assert.strictEqual(error, thrown, 'Ember.onerror is called with the error');\n });\n\n (0, _runloop.later)(() => {\n throw thrown;\n }, 10);\n\n setTimeout(done, 20);\n }\n\n [`@test errors in promise constructor when Ember.onerror which does not rethrow is present - rsvp`](assert) {\n assert.expect(1);\n\n let thrown = new Error('the error');\n (0, _errorHandling.setOnerror)(function (error) {\n assert.strictEqual(error, thrown, 'Ember.onerror is called for errors thrown in RSVP promises');\n });\n\n new _rsvp.default.Promise(() => {\n throw thrown;\n });\n\n // RSVP.Promise's are configured to settle within the run loop, this\n // ensures that run loop has completed\n return new _rsvp.default.Promise(resolve => setTimeout(resolve, 10));\n }\n\n [`@test errors in promise constructor when Ember.onerror which does rethrow is present - rsvp`](assert) {\n assert.expect(2);\n\n let thrown = new Error('the error');\n (0, _errorHandling.setOnerror)(function (error) {\n assert.strictEqual(error, thrown, 'Ember.onerror is called for errors thrown in RSVP promises');\n throw error;\n });\n\n window.onerror = function (message) {\n assert.pushResult({\n result: /the error/.test(message),\n actual: message,\n expected: 'to include `the error`',\n message: 'error should bubble out to window.onerror, and therefore fail tests (due to QUnit implementing window.onerror)'\n });\n\n // prevent \"bubbling\" and therefore failing the test\n return true;\n };\n\n new _rsvp.default.Promise(() => {\n throw thrown;\n });\n\n // RSVP.Promise's are configured to settle within the run loop, this\n // ensures that run loop has completed\n return new _rsvp.default.Promise(resolve => setTimeout(resolve, 10));\n }\n\n [`@test errors in promise constructor when Ember.onerror which does not rethrow is present (Ember.testing = false) - rsvp`](assert) {\n assert.expect(1);\n\n (0, _debug.setTesting)(false);\n let thrown = new Error('the error');\n (0, _errorHandling.setOnerror)(function (error) {\n assert.strictEqual(error, thrown, 'Ember.onerror is called for errors thrown in RSVP promises');\n });\n\n new _rsvp.default.Promise(() => {\n throw thrown;\n });\n\n // RSVP.Promise's are configured to settle within the run loop, this\n // ensures that run loop has completed\n return new _rsvp.default.Promise(resolve => setTimeout(resolve, 10));\n }\n\n [`@test errors in promise constructor when Ember.onerror which does rethrow is present (Ember.testing = false) - rsvp`](assert) {\n assert.expect(2);\n\n (0, _debug.setTesting)(false);\n let thrown = new Error('the error');\n (0, _errorHandling.setOnerror)(function (error) {\n assert.strictEqual(error, thrown, 'Ember.onerror is called for errors thrown in RSVP promises');\n throw error;\n });\n\n window.onerror = function (message) {\n assert.pushResult({\n result: /the error/.test(message),\n actual: message,\n expected: 'to include `the error`',\n message: 'error should bubble out to window.onerror, and therefore fail tests (due to QUnit implementing window.onerror)'\n });\n\n // prevent \"bubbling\" and therefore failing the test\n return true;\n };\n\n new _rsvp.default.Promise(() => {\n throw thrown;\n });\n\n // RSVP.Promise's are configured to settle within the run loop, this\n // ensures that run loop has completed\n return new _rsvp.default.Promise(resolve => setTimeout(resolve, 10));\n }\n\n [`@test errors in promise .then callback when Ember.onerror which does not rethrow is present - rsvp`](assert) {\n assert.expect(1);\n\n let thrown = new Error('the error');\n (0, _errorHandling.setOnerror)(function (error) {\n assert.strictEqual(error, thrown, 'Ember.onerror is called for errors thrown in RSVP promises');\n });\n\n _rsvp.default.resolve().then(() => {\n throw thrown;\n });\n\n // RSVP.Promise's are configured to settle within the run loop, this\n // ensures that run loop has completed\n return new _rsvp.default.Promise(resolve => setTimeout(resolve, 10));\n }\n\n [`@test errors in promise .then callback when Ember.onerror which does rethrow is present - rsvp`](assert) {\n assert.expect(2);\n\n let thrown = new Error('the error');\n (0, _errorHandling.setOnerror)(function (error) {\n assert.strictEqual(error, thrown, 'Ember.onerror is called for errors thrown in RSVP promises');\n throw error;\n });\n\n window.onerror = function (message) {\n assert.pushResult({\n result: /the error/.test(message),\n actual: message,\n expected: 'to include `the error`',\n message: 'error should bubble out to window.onerror, and therefore fail tests (due to QUnit implementing window.onerror)'\n });\n\n // prevent \"bubbling\" and therefore failing the test\n return true;\n };\n\n _rsvp.default.resolve().then(() => {\n throw thrown;\n });\n\n // RSVP.Promise's are configured to settle within the run loop, this\n // ensures that run loop has completed\n return new _rsvp.default.Promise(resolve => setTimeout(resolve, 10));\n }\n\n [`@test errors in promise .then callback when Ember.onerror which does not rethrow is present (Ember.testing = false) - rsvp`](assert) {\n assert.expect(1);\n\n (0, _debug.setTesting)(false);\n let thrown = new Error('the error');\n (0, _errorHandling.setOnerror)(function (error) {\n assert.strictEqual(error, thrown, 'Ember.onerror is called for errors thrown in RSVP promises');\n });\n\n _rsvp.default.resolve().then(() => {\n throw thrown;\n });\n\n // RSVP.Promise's are configured to settle within the run loop, this\n // ensures that run loop has completed\n return new _rsvp.default.Promise(resolve => setTimeout(resolve, 10));\n }\n\n [`@test errors in promise .then callback when Ember.onerror which does rethrow is present (Ember.testing = false) - rsvp`](assert) {\n assert.expect(2);\n\n (0, _debug.setTesting)(false);\n let thrown = new Error('the error');\n (0, _errorHandling.setOnerror)(function (error) {\n assert.strictEqual(error, thrown, 'Ember.onerror is called for errors thrown in RSVP promises');\n throw error;\n });\n\n window.onerror = function (message) {\n assert.pushResult({\n result: /the error/.test(message),\n actual: message,\n expected: 'to include `the error`',\n message: 'error should bubble out to window.onerror, and therefore fail tests (due to QUnit implementing window.onerror)'\n });\n\n // prevent \"bubbling\" and therefore failing the test\n return true;\n };\n\n _rsvp.default.resolve().then(() => {\n throw thrown;\n });\n\n // RSVP.Promise's are configured to settle within the run loop, this\n // ensures that run loop has completed\n return new _rsvp.default.Promise(resolve => setTimeout(resolve, 10));\n }\n\n [`@test errors in async promise .then callback when Ember.onerror which does not rethrow is present - rsvp`](assert) {\n assert.expect(1);\n\n let thrown = new Error('the error');\n (0, _errorHandling.setOnerror)(function (error) {\n assert.strictEqual(error, thrown, 'Ember.onerror is called for errors thrown in RSVP promises');\n });\n\n new _rsvp.default.Promise(resolve => setTimeout(resolve, 10)).then(() => {\n throw thrown;\n });\n\n // RSVP.Promise's are configured to settle within the run loop, this\n // ensures that run loop has completed\n return new _rsvp.default.Promise(resolve => setTimeout(resolve, 20));\n }\n\n [`@test errors in async promise .then callback when Ember.onerror which does rethrow is present - rsvp`](assert) {\n assert.expect(2);\n\n let thrown = new Error('the error');\n (0, _errorHandling.setOnerror)(function (error) {\n assert.strictEqual(error, thrown, 'Ember.onerror is called for errors thrown in RSVP promises');\n throw error;\n });\n\n window.onerror = function (message) {\n assert.pushResult({\n result: /the error/.test(message),\n actual: message,\n expected: 'to include `the error`',\n message: 'error should bubble out to window.onerror, and therefore fail tests (due to QUnit implementing window.onerror)'\n });\n\n // prevent \"bubbling\" and therefore failing the test\n return true;\n };\n\n new _rsvp.default.Promise(resolve => setTimeout(resolve, 10)).then(() => {\n throw thrown;\n });\n\n // RSVP.Promise's are configured to settle within the run loop, this\n // ensures that run loop has completed\n return new _rsvp.default.Promise(resolve => setTimeout(resolve, 20));\n }\n\n [`@test errors in async promise .then callback when Ember.onerror which does not rethrow is present (Ember.testing = false) - rsvp`](assert) {\n assert.expect(1);\n\n (0, _debug.setTesting)(false);\n let thrown = new Error('the error');\n (0, _errorHandling.setOnerror)(function (error) {\n assert.strictEqual(error, thrown, 'Ember.onerror is called for errors thrown in RSVP promises');\n });\n\n new _rsvp.default.Promise(resolve => setTimeout(resolve, 10)).then(() => {\n throw thrown;\n });\n\n // RSVP.Promise's are configured to settle within the run loop, this\n // ensures that run loop has completed\n return new _rsvp.default.Promise(resolve => setTimeout(resolve, 20));\n }\n\n [`@test errors in async promise .then callback when Ember.onerror which does rethrow is present (Ember.testing = false) - rsvp`](assert) {\n assert.expect(2);\n\n (0, _debug.setTesting)(false);\n let thrown = new Error('the error');\n (0, _errorHandling.setOnerror)(function (error) {\n assert.strictEqual(error, thrown, 'Ember.onerror is called for errors thrown in RSVP promises');\n throw error;\n });\n\n window.onerror = function (message) {\n assert.pushResult({\n result: /the error/.test(message),\n actual: message,\n expected: 'to include `the error`',\n message: 'error should bubble out to window.onerror, and therefore fail tests (due to QUnit implementing window.onerror)'\n });\n\n // prevent \"bubbling\" and therefore failing the test\n return true;\n };\n\n new _rsvp.default.Promise(resolve => setTimeout(resolve, 10)).then(() => {\n throw thrown;\n });\n\n // RSVP.Promise's are configured to settle within the run loop, this\n // ensures that run loop has completed\n return new _rsvp.default.Promise(resolve => setTimeout(resolve, 20));\n }\n });\n});","enifed('ember/tests/helpers/helper_registration_test', ['internal-test-helpers', '@ember/controller', '@ember/service', '@ember/-internals/glimmer'], function (_internalTestHelpers, _controller, _service, _glimmer) {\n 'use strict';\n\n (0, _internalTestHelpers.moduleFor)('Application Lifecycle - Helper Registration', class extends _internalTestHelpers.ApplicationTestCase {\n ['@test Unbound dashed helpers registered on the container can be late-invoked'](assert) {\n this.addTemplate('application', `
{{x-borf}} {{x-borf 'YES'}}
`);\n\n let myHelper = (0, _glimmer.helper)(params => params[0] || 'BORF');\n this.application.register('helper:x-borf', myHelper);\n\n return this.visit('/').then(() => {\n assert.equal(this.$('#wrapper').text(), 'BORF YES', 'The helper was invoked from the container');\n });\n }\n\n ['@test Bound helpers registered on the container can be late-invoked'](assert) {\n this.addTemplate('application', `
{{x-reverse}} {{x-reverse foo}}
`);\n\n this.add('controller:application', _controller.default.extend({\n foo: 'alex'\n }));\n\n this.application.register('helper:x-reverse', (0, _glimmer.helper)(function ([value]) {\n return value ? value.split('').reverse().join('') : '--';\n }));\n\n return this.visit('/').then(() => {\n assert.equal(this.$('#wrapper').text(), '-- xela', 'The bound helper was invoked from the container');\n });\n }\n\n ['@test Undashed helpers registered on the container can be invoked'](assert) {\n this.addTemplate('application', `
{{omg}}|{{yorp 'boo'}}|{{yorp 'ya'}}
`);\n\n this.application.register('helper:omg', (0, _glimmer.helper)(() => 'OMG'));\n\n this.application.register('helper:yorp', (0, _glimmer.helper)(([value]) => value));\n\n return this.visit('/').then(() => {\n assert.equal(this.$('#wrapper').text(), 'OMG|boo|ya', 'The helper was invoked from the container');\n });\n }\n\n ['@test Helpers can receive injections'](assert) {\n this.addTemplate('application', `
{{full-name}}
`);\n\n let serviceCalled = false;\n\n this.add('service:name-builder', _service.default.extend({\n build() {\n serviceCalled = true;\n }\n }));\n\n this.add('helper:full-name', _glimmer.Helper.extend({\n nameBuilder: (0, _service.inject)('name-builder'),\n compute() {\n this.get('nameBuilder').build();\n }\n }));\n\n return this.visit('/').then(() => {\n assert.ok(serviceCalled, 'service was injected, method called');\n });\n }\n });\n});","enifed('ember/tests/helpers/link_to_test', ['internal-test-helpers', '@ember/controller', '@ember/-internals/runtime', '@ember/-internals/metal', '@ember/instrumentation', '@ember/-internals/routing'], function (_internalTestHelpers, _controller, _runtime, _metal, _instrumentation, _routing) {\n 'use strict';\n\n // IE includes the host name\n function normalizeUrl(url) {\n return url.replace(/https?:\\/\\/[^\\/]+/, '');\n }\n\n function shouldNotBeActive(assert, element) {\n checkActive(assert, element, false);\n }\n\n function shouldBeActive(assert, element) {\n checkActive(assert, element, true);\n }\n\n function checkActive(assert, element, active) {\n let classList = element.attr('class');\n assert.equal(classList.indexOf('active') > -1, active, `${element} active should be ${active}`);\n }\n\n (0, _internalTestHelpers.moduleFor)('The {{link-to}} helper - basic tests', class extends _internalTestHelpers.ApplicationTestCase {\n constructor() {\n super();\n\n this.router.map(function () {\n this.route('about');\n });\n\n this.addTemplate('index', `\n
\n {{#link-to 'index' id='home-link'}}Home{{/link-to}}\n {{#link-to 'about' id='self-link'}}Self{{/link-to}}\n `);\n }\n\n ['@test The {{link-to}} helper moves into the named route'](assert) {\n return this.visit('/').then(() => {\n assert.equal(this.$('h3.home').length, 1, 'The home template was rendered');\n assert.equal(this.$('#self-link.active').length, 1, 'The self-link was rendered with active class');\n assert.equal(this.$('#about-link:not(.active)').length, 1, 'The other link was rendered without active class');\n\n return this.click('#about-link');\n }).then(() => {\n assert.equal(this.$('h3.about').length, 1, 'The about template was rendered');\n assert.equal(this.$('#self-link.active').length, 1, 'The self-link was rendered with active class');\n assert.equal(this.$('#home-link:not(.active)').length, 1, 'The other link was rendered without active class');\n });\n }\n\n [`@test the {{link-to}} helper doesn't add an href when the tagName isn't 'a'`](assert) {\n this.addTemplate('index', `\n {{#link-to 'about' id='about-link' tagName='div'}}About{{/link-to}}\n `);\n\n return this.visit('/').then(() => {\n assert.equal(this.$('#about-link').attr('href'), undefined, 'there is no href attribute');\n });\n }\n\n [`@test the {{link-to}} applies a 'disabled' class when disabled`](assert) {\n this.addTemplate('index', `\n {{#link-to \"about\" id=\"about-link-static\" disabledWhen=\"shouldDisable\"}}About{{/link-to}}\n {{#link-to \"about\" id=\"about-link-dynamic\" disabledWhen=dynamicDisabledWhen}}About{{/link-to}}\n `);\n\n this.add('controller:index', _controller.default.extend({\n shouldDisable: true,\n dynamicDisabledWhen: 'shouldDisable'\n }));\n\n return this.visit('/').then(() => {\n assert.equal(this.$('#about-link-static.disabled').length, 1, 'The static link is disabled when its disabledWhen is true');\n assert.equal(this.$('#about-link-dynamic.disabled').length, 1, 'The dynamic link is disabled when its disabledWhen is true');\n\n let controller = this.applicationInstance.lookup('controller:index');\n this.runTask(() => controller.set('dynamicDisabledWhen', false));\n\n assert.equal(this.$('#about-link-dynamic.disabled').length, 0, 'The dynamic link is re-enabled when its disabledWhen becomes false');\n });\n }\n\n [`@test the {{link-to}} doesn't apply a 'disabled' class if disabledWhen is not provided`](assert) {\n this.addTemplate('index', `{{#link-to \"about\" id=\"about-link\"}}About{{/link-to}}`);\n\n return this.visit('/').then(() => {\n assert.ok(!this.$('#about-link').hasClass('disabled'), 'The link is not disabled if disabledWhen not provided');\n });\n }\n\n [`@test the {{link-to}} helper supports a custom disabledClass`](assert) {\n this.addTemplate('index', `\n {{#link-to \"about\" id=\"about-link\" disabledWhen=true disabledClass=\"do-not-want\"}}About{{/link-to}}\n `);\n\n return this.visit('/').then(() => {\n assert.equal(this.$('#about-link.do-not-want').length, 1, 'The link can apply a custom disabled class');\n });\n }\n\n [`@test the {{link-to}} helper supports a custom disabledClass set via bound param`](assert) {\n this.addTemplate('index', `\n {{#link-to \"about\" id=\"about-link\" disabledWhen=true disabledClass=disabledClass}}About{{/link-to}}\n `);\n\n this.add('controller:index', _controller.default.extend({\n disabledClass: 'do-not-want'\n }));\n\n return this.visit('/').then(() => {\n assert.equal(this.$('#about-link.do-not-want').length, 1, 'The link can apply a custom disabled class via bound param');\n });\n }\n\n [`@test the {{link-to}} helper does not respond to clicks when disabledWhen`](assert) {\n this.addTemplate('index', `\n {{#link-to \"about\" id=\"about-link\" disabledWhen=true}}About{{/link-to}}\n `);\n\n return this.visit('/').then(() => {\n return this.click('#about-link');\n }).then(() => {\n assert.equal(this.$('h3.about').length, 0, 'Transitioning did not occur');\n });\n }\n\n [`@test the {{link-to}} helper does not respond to clicks when disabled`](assert) {\n this.addTemplate('index', `\n {{#link-to \"about\" id=\"about-link\" disabled=true}}About{{/link-to}}\n `);\n\n return this.visit('/').then(() => {\n return this.click('#about-link');\n }).then(() => {\n assert.equal(this.$('h3.about').length, 0, 'Transitioning did not occur');\n });\n }\n\n [`@test the {{link-to}} helper responds to clicks according to its disabledWhen bound param`](assert) {\n this.addTemplate('index', `\n {{#link-to \"about\" id=\"about-link\" disabledWhen=disabledWhen}}About{{/link-to}}\n `);\n\n this.add('controller:index', _controller.default.extend({\n disabledWhen: true\n }));\n\n return this.visit('/').then(() => {\n return this.click('#about-link');\n }).then(() => {\n assert.equal(this.$('h3.about').length, 0, 'Transitioning did not occur');\n\n let controller = this.applicationInstance.lookup('controller:index');\n controller.set('disabledWhen', false);\n\n return this.runLoopSettled();\n }).then(() => {\n return this.click('#about-link');\n }).then(() => {\n assert.equal(this.$('h3.about').length, 1, 'Transitioning did occur when disabledWhen became false');\n });\n }\n\n [`@test The {{link-to}} helper supports a custom activeClass`](assert) {\n this.addTemplate('index', `\n
Home
\n {{#link-to 'about' id='about-link'}}About{{/link-to}}\n {{#link-to 'index' id='self-link' activeClass='zomg-active'}}Self{{/link-to}}\n `);\n\n return this.visit('/').then(() => {\n assert.equal(this.$('h3.home').length, 1, 'The home template was rendered');\n assert.equal(this.$('#self-link.zomg-active').length, 1, 'The self-link was rendered with active class');\n assert.equal(this.$('#about-link:not(.active)').length, 1, 'The other link was rendered without active class');\n });\n }\n\n [`@test The {{link-to}} helper supports a custom activeClass from a bound param`](assert) {\n this.addTemplate('index', `\n
Home
\n {{#link-to 'about' id='about-link'}}About{{/link-to}}\n {{#link-to 'index' id='self-link' activeClass=activeClass}}Self{{/link-to}}\n `);\n\n this.add('controller:index', _controller.default.extend({\n activeClass: 'zomg-active'\n }));\n\n return this.visit('/').then(() => {\n assert.equal(this.$('h3.home').length, 1, 'The home template was rendered');\n assert.equal(this.$('#self-link.zomg-active').length, 1, 'The self-link was rendered with active class');\n assert.equal(this.$('#about-link:not(.active)').length, 1, 'The other link was rendered without active class');\n });\n }\n\n [`@test The {{link-to}} helper supports 'classNameBindings' with custom values [GH #11699]`](assert) {\n this.addTemplate('index', `\n
Home
\n {{#link-to 'about' id='about-link' classNameBindings='foo:foo-is-true:foo-is-false'}}About{{/link-to}}\n `);\n\n this.add('controller:index', _controller.default.extend({\n foo: false\n }));\n\n return this.visit('/').then(() => {\n assert.equal(this.$('#about-link.foo-is-false').length, 1, 'The about-link was rendered with the falsy class');\n\n let controller = this.applicationInstance.lookup('controller:index');\n this.runTask(() => controller.set('foo', true));\n\n assert.equal(this.$('#about-link.foo-is-true').length, 1, 'The about-link was rendered with the truthy class after toggling the property');\n });\n }\n });\n\n (0, _internalTestHelpers.moduleFor)('The {{link-to}} helper - location hooks', class extends _internalTestHelpers.ApplicationTestCase {\n constructor() {\n super();\n\n this.updateCount = 0;\n this.replaceCount = 0;\n\n let testContext = this;\n this.add('location:none', _routing.NoneLocation.extend({\n setURL() {\n testContext.updateCount++;\n return this._super(...arguments);\n },\n replaceURL() {\n testContext.replaceCount++;\n return this._super(...arguments);\n }\n }));\n\n this.router.map(function () {\n this.route('about');\n });\n\n this.addTemplate('index', `\n
{{outlet}}`);\n this.addTemplate('index.about', `\n {{#link-to 'item' id='other-link' current-when='index'}}ITEM{{/link-to}}\n `);\n\n return this.visit('/about').then(() => {\n assert.equal(this.$('#other-link.active').length, 1, 'The link is active since current-when is a parent route');\n });\n }\n\n [`@test The {{link-to}} helper does not disregard current-when when it is given explicitly for a route`](assert) {\n this.router.map(function () {\n this.route('index', { path: '/' }, function () {\n this.route('about');\n });\n\n this.route('items', function () {\n this.route('item');\n });\n });\n\n this.addTemplate('index', `
Home
{{outlet}}`);\n this.addTemplate('index.about', `\n {{#link-to 'items' id='other-link' current-when='index'}}ITEM{{/link-to}}\n `);\n\n return this.visit('/about').then(() => {\n assert.equal(this.$('#other-link.active').length, 1, 'The link is active when current-when is given for explicitly for a route');\n });\n }\n\n ['@test The {{link-to}} helper does not disregard current-when when it is set via a bound param'](assert) {\n this.router.map(function () {\n this.route('index', { path: '/' }, function () {\n this.route('about');\n });\n\n this.route('items', function () {\n this.route('item');\n });\n });\n\n this.add('controller:index.about', _controller.default.extend({\n currentWhen: 'index'\n }));\n\n this.addTemplate('index', `
Home
{{outlet}}`);\n this.addTemplate('index.about', `{{#link-to 'items' id='other-link' current-when=currentWhen}}ITEM{{/link-to}}`);\n\n return this.visit('/about').then(() => {\n assert.equal(this.$('#other-link.active').length, 1, 'The link is active when current-when is given for explicitly for a route');\n });\n }\n\n ['@test The {{link-to}} helper supports multiple current-when routes'](assert) {\n this.router.map(function () {\n this.route('index', { path: '/' }, function () {\n this.route('about');\n });\n this.route('item');\n this.route('foo');\n });\n\n this.addTemplate('index', `
Home
{{outlet}}`);\n this.addTemplate('index.about', `{{#link-to 'item' id='link1' current-when='item index'}}ITEM{{/link-to}}`);\n this.addTemplate('item', `{{#link-to 'item' id='link2' current-when='item index'}}ITEM{{/link-to}}`);\n this.addTemplate('foo', `{{#link-to 'item' id='link3' current-when='item index'}}ITEM{{/link-to}}`);\n\n return this.visit('/about').then(() => {\n assert.equal(this.$('#link1.active').length, 1, 'The link is active since current-when contains the parent route');\n\n return this.visit('/item');\n }).then(() => {\n assert.equal(this.$('#link2.active').length, 1, 'The link is active since you are on the active route');\n\n return this.visit('/foo');\n }).then(() => {\n assert.equal(this.$('#link3.active').length, 0, 'The link is not active since current-when does not contain the active route');\n });\n }\n\n ['@test The {{link-to}} helper supports boolean values for current-when'](assert) {\n this.router.map(function () {\n this.route('index', { path: '/' }, function () {\n this.route('about');\n });\n this.route('item');\n });\n\n this.addTemplate('index.about', `\n {{#link-to 'index' id='index-link' current-when=isCurrent}}index{{/link-to}}\n {{#link-to 'item' id='about-link' current-when=true}}ITEM{{/link-to}}\n `);\n\n this.add('controller:index.about', _controller.default.extend({ isCurrent: false }));\n\n return this.visit('/about').then(() => {\n assert.ok(this.$('#about-link').hasClass('active'), 'The link is active since current-when is true');\n assert.notOk(this.$('#index-link').hasClass('active'), 'The link is not active since current-when is false');\n\n let controller = this.applicationInstance.lookup('controller:index.about');\n this.runTask(() => controller.set('isCurrent', true));\n\n assert.ok(this.$('#index-link').hasClass('active'), 'The link is active since current-when is true');\n });\n }\n\n ['@test The {{link-to}} helper defaults to bubbling'](assert) {\n this.addTemplate('about', `\n
\n {{link-to 'Home' 'index' id='home-link'}}\n {{link-to 'Self' 'contact' id='self-link'}}\n `);\n\n return this.visit('/').then(() => {\n return this.click('#contact-link');\n }).then(() => {\n assert.equal(this.$('h3.contact').length, 1, 'The contact template was rendered');\n assert.equal(this.$('#self-link.active').length, 1, 'The self-link was rendered with active class');\n assert.equal(this.$('#home-link:not(.active)').length, 1, 'The other link was rendered without active class');\n });\n }\n\n [`@test The non-block form {{link-to}} helper updates the link text when it is a binding`](assert) {\n assert.expect(8);\n this.router.map(function () {\n this.route('contact');\n });\n\n this.add('controller:index', _controller.default.extend({\n contactName: 'Jane'\n }));\n\n this.addTemplate('index', `\n
\n {{link-to 'Home' 'index' id='home-link'}}\n {{link-to 'Self' 'contact' id='self-link'}}\n `);\n\n return this.visit('/').then(() => {\n assert.equal(this.$('#contact-link').text(), 'Jane', 'The link title is correctly resolved');\n\n let controller = this.applicationInstance.lookup('controller:index');\n this.runTask(() => controller.set('contactName', 'Joe'));\n\n assert.equal(this.$('#contact-link').text(), 'Joe', 'The link title is correctly updated when the bound property changes');\n\n this.runTask(() => controller.set('contactName', 'Robert'));\n\n assert.equal(this.$('#contact-link').text(), 'Robert', 'The link title is correctly updated when the bound property changes a second time');\n\n return this.click('#contact-link');\n }).then(() => {\n assert.equal(this.$('h3.contact').length, 1, 'The contact template was rendered');\n assert.equal(this.$('#self-link.active').length, 1, 'The self-link was rendered with active class');\n assert.equal(this.$('#home-link:not(.active)').length, 1, 'The other link was rendered without active class');\n\n return this.click('#home-link');\n }).then(() => {\n assert.equal(this.$('h3.home').length, 1, 'The index template was rendered');\n assert.equal(this.$('#contact-link').text(), 'Robert', 'The link title is correctly updated when the route changes');\n });\n }\n\n [`@test The non-block form {{link-to}} helper moves into the named route with context`](assert) {\n assert.expect(5);\n\n this.router.map(function () {\n this.route('item', { path: '/item/:id' });\n });\n\n this.add('route:index', _routing.Route.extend({\n model() {\n return [{ id: 'yehuda', name: 'Yehuda Katz' }, { id: 'tom', name: 'Tom Dale' }, { id: 'erik', name: 'Erik Brynroflsson' }];\n }\n }));\n\n this.addTemplate('index', `\n
Home
\n
\n {{#each model as |person|}}\n
\n {{link-to person.name 'item' person id=person.id}}\n
\n {{/each}}\n
\n `);\n this.addTemplate('item', `\n
Item
\n
{{model.name}}
\n {{#link-to 'index' id='home-link'}}Home{{/link-to}}\n `);\n\n return this.visit('/').then(() => {\n return this.click('#yehuda');\n }).then(() => {\n assert.equal(this.$('h3.item').length, 1, 'The item template was rendered');\n assert.equal(this.$('p').text(), 'Yehuda Katz', 'The name is correct');\n\n return this.click('#home-link');\n }).then(() => {\n assert.equal(normalizeUrl(this.$('li a#yehuda').attr('href')), '/item/yehuda');\n assert.equal(normalizeUrl(this.$('li a#tom').attr('href')), '/item/tom');\n assert.equal(normalizeUrl(this.$('li a#erik').attr('href')), '/item/erik');\n });\n }\n\n [`@test The non-block form {{link-to}} performs property lookup`](assert) {\n this.router.map(function () {\n this.route('about');\n });\n\n this.addTemplate('index', `\n {{link-to 'string' 'index' id='string-link'}}\n {{link-to path foo id='path-link'}}\n `);\n\n this.add('controller:index', _controller.default.extend({\n foo: 'index'\n }));\n\n return this.visit('/').then(() => {\n let assertEquality = href => {\n assert.equal(normalizeUrl(this.$('#string-link').attr('href')), '/');\n assert.equal(normalizeUrl(this.$('#path-link').attr('href')), href);\n };\n\n assertEquality('/');\n\n let controller = this.applicationInstance.lookup('controller:index');\n this.runTask(() => controller.set('foo', 'about'));\n\n assertEquality('/about');\n });\n }\n\n [`@test The non-block form {{link-to}} protects against XSS`](assert) {\n this.addTemplate('application', `{{link-to display 'index' id='link'}}`);\n\n this.add('controller:application', _controller.default.extend({\n display: 'blahzorz'\n }));\n\n return this.visit('/').then(() => {\n assert.equal(this.$('#link').text(), 'blahzorz');\n\n let controller = this.applicationInstance.lookup('controller:application');\n this.runTask(() => controller.set('display', 'BLAMMO'));\n\n assert.equal(this.$('#link').text(), 'BLAMMO');\n assert.equal(this.$('b').length, 0);\n });\n }\n\n [`@test the {{link-to}} helper throws a useful error if you invoke it wrong`](assert) {\n assert.expect(1);\n\n this.router.map(function () {\n this.route('post', { path: 'post/:post_id' });\n });\n\n this.addTemplate('application', `{{#link-to 'post'}}Post{{/link-to}}`);\n\n assert.throws(() => {\n this.visit('/');\n }, /(You attempted to define a `\\{\\{link-to \"post\"\\}\\}` but did not pass the parameters required for generating its dynamic segments.|You must provide param `post_id` to `generate`)/);\n\n return this.runLoopSettled();\n }\n\n [`@test the {{link-to}} helper does not throw an error if its route has exited`](assert) {\n assert.expect(0);\n\n this.router.map(function () {\n this.route('post', { path: 'post/:post_id' });\n });\n\n this.addTemplate('application', `\n {{#link-to 'index' id='home-link'}}Home{{/link-to}}\n {{#link-to 'post' defaultPost id='default-post-link'}}Default Post{{/link-to}}\n {{#if currentPost}}\n {{#link-to 'post' currentPost id='current-post-link'}}Current Post{{/link-to}}\n {{/if}}\n `);\n\n this.add('controller:application', _controller.default.extend({\n defaultPost: { id: 1 },\n postController: (0, _controller.inject)('post'),\n currentPost: (0, _metal.alias)('postController.model')\n }));\n\n this.add('controller:post', _controller.default.extend());\n\n this.add('route:post', _routing.Route.extend({\n model() {\n return { id: 2 };\n },\n serialize(model) {\n return { post_id: model.id };\n }\n }));\n\n return this.visit('/').then(() => this.click('#default-post-link')).then(() => this.click('#home-link')).then(() => this.click('#current-post-link')).then(() => this.click('#home-link'));\n }\n\n [`@test {{link-to}} active property respects changing parent route context`](assert) {\n this.router.map(function () {\n this.route('things', { path: '/things/:name' }, function () {\n this.route('other');\n });\n });\n\n this.addTemplate('application', `\n {{link-to 'OMG' 'things' 'omg' id='omg-link'}}\n {{link-to 'LOL' 'things' 'lol' id='lol-link'}}\n `);\n\n return this.visit('/things/omg').then(() => {\n shouldBeActive(assert, this.$('#omg-link'));\n shouldNotBeActive(assert, this.$('#lol-link'));\n\n return this.visit('/things/omg/other');\n }).then(() => {\n shouldBeActive(assert, this.$('#omg-link'));\n shouldNotBeActive(assert, this.$('#lol-link'));\n });\n }\n\n [`@test {{link-to}} populates href with default query param values even without query-params object`](assert) {\n this.add('controller:index', _controller.default.extend({\n queryParams: ['foo'],\n foo: '123'\n }));\n\n this.addTemplate('index', `{{#link-to 'index' id='the-link'}}Index{{/link-to}}`);\n\n return this.visit('/').then(() => {\n assert.equal(this.$('#the-link').attr('href'), '/', 'link has right href');\n });\n }\n\n [`@test {{link-to}} populates href with default query param values with empty query-params object`](assert) {\n this.add('controller:index', _controller.default.extend({\n queryParams: ['foo'],\n foo: '123'\n }));\n\n this.addTemplate('index', `\n {{#link-to 'index' (query-params) id='the-link'}}Index{{/link-to}}\n `);\n\n return this.visit('/').then(() => {\n assert.equal(this.$('#the-link').attr('href'), '/', 'link has right href');\n });\n }\n\n [`@test {{link-to}} with only query-params and a block updates when route changes`](assert) {\n this.router.map(function () {\n this.route('about');\n });\n\n this.add('controller:application', _controller.default.extend({\n queryParams: ['foo', 'bar'],\n foo: '123',\n bar: 'yes'\n }));\n\n this.addTemplate('application', `\n {{#link-to (query-params foo='456' bar='NAW') id='the-link'}}Index{{/link-to}}\n `);\n\n return this.visit('/').then(() => {\n assert.equal(this.$('#the-link').attr('href'), '/?bar=NAW&foo=456', 'link has right href');\n\n return this.visit('/about');\n }).then(() => {\n assert.equal(this.$('#the-link').attr('href'), '/about?bar=NAW&foo=456', 'link has right href');\n });\n }\n\n [`@test Block-less {{link-to}} with only query-params updates when route changes`](assert) {\n this.router.map(function () {\n this.route('about');\n });\n\n this.add('controller:application', _controller.default.extend({\n queryParams: ['foo', 'bar'],\n foo: '123',\n bar: 'yes'\n }));\n\n this.addTemplate('application', `\n {{link-to \"Index\" (query-params foo='456' bar='NAW') id='the-link'}}\n `);\n\n return this.visit('/').then(() => {\n assert.equal(this.$('#the-link').attr('href'), '/?bar=NAW&foo=456', 'link has right href');\n\n return this.visit('/about');\n }).then(() => {\n assert.equal(this.$('#the-link').attr('href'), '/about?bar=NAW&foo=456', 'link has right href');\n });\n }\n\n [`@test The {{link-to}} helper can use dynamic params`](assert) {\n this.router.map(function () {\n this.route('foo', { path: 'foo/:some/:thing' });\n this.route('bar', { path: 'bar/:some/:thing/:else' });\n });\n\n this.add('controller:index', _controller.default.extend({\n init() {\n this._super(...arguments);\n this.dynamicLinkParams = ['foo', 'one', 'two'];\n }\n }));\n\n this.addTemplate('index', `\n
Home
\n {{#link-to params=dynamicLinkParams id=\"dynamic-link\"}}Dynamic{{/link-to}}\n `);\n\n return this.visit('/').then(() => {\n let link = this.$('#dynamic-link');\n\n assert.equal(link.attr('href'), '/foo/one/two');\n\n let controller = this.applicationInstance.lookup('controller:index');\n this.runTask(() => {\n controller.set('dynamicLinkParams', ['bar', 'one', 'two', 'three']);\n });\n\n assert.equal(link.attr('href'), '/bar/one/two/three');\n });\n }\n\n [`@test GJ: {{link-to}} to a parent root model hook which performs a 'transitionTo' has correct active class #13256`](assert) {\n assert.expect(1);\n\n this.router.map(function () {\n this.route('parent', function () {\n this.route('child');\n });\n });\n\n this.add('route:parent', _routing.Route.extend({\n afterModel() {\n this.transitionTo('parent.child');\n }\n }));\n\n this.addTemplate('application', `\n {{link-to 'Parent' 'parent' id='parent-link'}}\n `);\n\n return this.visit('/').then(() => {\n return this.click('#parent-link');\n }).then(() => {\n shouldBeActive(assert, this.$('#parent-link'));\n });\n }\n });\n\n (0, _internalTestHelpers.moduleFor)('The {{link-to}} helper - loading states and warnings', class extends _internalTestHelpers.ApplicationTestCase {\n [`@test link-to with null/undefined dynamic parameters are put in a loading state`](assert) {\n assert.expect(19);\n let warningMessage = 'This link-to is in an inactive loading state because at least one of its parameters presently has a null/undefined value, or the provided route name is invalid.';\n\n this.router.map(function () {\n this.route('thing', { path: '/thing/:thing_id' });\n this.route('about');\n });\n\n this.addTemplate('index', `\n {{#link-to destinationRoute routeContext loadingClass='i-am-loading' id='context-link'}}\n string\n {{/link-to}}\n {{#link-to secondRoute loadingClass=loadingClass id='static-link'}}\n string\n {{/link-to}}\n `);\n\n this.add('controller:index', _controller.default.extend({\n destinationRoute: null,\n routeContext: null,\n loadingClass: 'i-am-loading'\n }));\n\n this.add('route:about', _routing.Route.extend({\n activate() {\n assert.ok(true, 'About was entered');\n }\n }));\n\n function assertLinkStatus(link, url) {\n if (url) {\n assert.equal(normalizeUrl(link.attr('href')), url, 'loaded link-to has expected href');\n assert.ok(!link.hasClass('i-am-loading'), 'loaded linkComponent has no loadingClass');\n } else {\n assert.equal(normalizeUrl(link.attr('href')), '#', \"unloaded link-to has href='#'\");\n assert.ok(link.hasClass('i-am-loading'), 'loading linkComponent has loadingClass');\n }\n }\n\n let contextLink, staticLink, controller;\n\n return this.visit('/').then(() => {\n contextLink = this.$('#context-link');\n staticLink = this.$('#static-link');\n controller = this.applicationInstance.lookup('controller:index');\n\n assertLinkStatus(contextLink);\n assertLinkStatus(staticLink);\n\n return expectWarning(() => {\n return this.click(contextLink[0]);\n }, warningMessage);\n }).then(() => {\n // Set the destinationRoute (context is still null).\n this.runTask(() => controller.set('destinationRoute', 'thing'));\n assertLinkStatus(contextLink);\n\n // Set the routeContext to an id\n this.runTask(() => controller.set('routeContext', '456'));\n assertLinkStatus(contextLink, '/thing/456');\n\n // Test that 0 isn't interpreted as falsy.\n this.runTask(() => controller.set('routeContext', 0));\n assertLinkStatus(contextLink, '/thing/0');\n\n // Set the routeContext to an object\n this.runTask(() => {\n controller.set('routeContext', { id: 123 });\n });\n assertLinkStatus(contextLink, '/thing/123');\n\n // Set the destinationRoute back to null.\n this.runTask(() => controller.set('destinationRoute', null));\n assertLinkStatus(contextLink);\n\n return expectWarning(() => {\n return this.click(staticLink[0]);\n }, warningMessage);\n }).then(() => {\n this.runTask(() => controller.set('secondRoute', 'about'));\n assertLinkStatus(staticLink, '/about');\n\n // Click the now-active link\n return this.click(staticLink[0]);\n });\n }\n });\n\n function assertNav(options, callback, assert) {\n let nav = false;\n\n function check(event) {\n assert.equal(event.defaultPrevented, options.prevented, `expected defaultPrevented=${options.prevented}`);\n nav = true;\n event.preventDefault();\n }\n\n try {\n document.addEventListener('click', check);\n callback();\n } finally {\n document.removeEventListener('click', check);\n assert.ok(nav, 'Expected a link to be clicked');\n }\n }\n});","enifed('ember/tests/helpers/link_to_test/link_to_transitioning_classes_test', ['@ember/-internals/runtime', '@ember/-internals/routing', 'internal-test-helpers'], function (_runtime, _routing, _internalTestHelpers) {\n 'use strict';\n\n function assertHasClass(assert, selector, label) {\n let testLabel = `${selector.attr('id')} should have class ${label}`;\n\n assert.equal(selector.hasClass(label), true, testLabel);\n }\n\n function assertHasNoClass(assert, selector, label) {\n let testLabel = `${selector.attr('id')} should not have class ${label}`;\n\n assert.equal(selector.hasClass(label), false, testLabel);\n }\n\n (0, _internalTestHelpers.moduleFor)('The {{link-to}} helper: .transitioning-in .transitioning-out CSS classes', class extends _internalTestHelpers.ApplicationTestCase {\n constructor() {\n super();\n\n this.aboutDefer = _runtime.RSVP.defer();\n this.otherDefer = _runtime.RSVP.defer();\n this.newsDefer = _runtime.RSVP.defer();\n let _this = this;\n\n this.router.map(function () {\n this.route('about');\n this.route('other');\n this.route('news');\n });\n\n this.add('route:about', _routing.Route.extend({\n model() {\n return _this.aboutDefer.promise;\n }\n }));\n\n this.add('route:other', _routing.Route.extend({\n model() {\n return _this.otherDefer.promise;\n }\n }));\n\n this.add('route:news', _routing.Route.extend({\n model() {\n return _this.newsDefer.promise;\n }\n }));\n\n this.addTemplate('application', `\n {{outlet}}\n {{link-to 'Index' 'index' id='index-link'}}\n {{link-to 'About' 'about' id='about-link'}}\n {{link-to 'Other' 'other' id='other-link'}}\n {{link-to 'News' 'news' activeClass=false id='news-link'}}\n `);\n }\n\n beforeEach() {\n return this.visit('/');\n }\n\n afterEach() {\n super.afterEach();\n this.aboutDefer = null;\n this.otherDefer = null;\n this.newsDefer = null;\n }\n\n ['@test while a transition is underway'](assert) {\n let $index = this.$('#index-link');\n let $about = this.$('#about-link');\n let $other = this.$('#other-link');\n\n $about.click();\n\n assertHasClass(assert, $index, 'active');\n assertHasNoClass(assert, $about, 'active');\n assertHasNoClass(assert, $other, 'active');\n\n assertHasNoClass(assert, $index, 'ember-transitioning-in');\n assertHasClass(assert, $about, 'ember-transitioning-in');\n assertHasNoClass(assert, $other, 'ember-transitioning-in');\n\n assertHasClass(assert, $index, 'ember-transitioning-out');\n assertHasNoClass(assert, $about, 'ember-transitioning-out');\n assertHasNoClass(assert, $other, 'ember-transitioning-out');\n\n this.runTask(() => this.aboutDefer.resolve());\n\n assertHasNoClass(assert, $index, 'active');\n assertHasClass(assert, $about, 'active');\n assertHasNoClass(assert, $other, 'active');\n\n assertHasNoClass(assert, $index, 'ember-transitioning-in');\n assertHasNoClass(assert, $about, 'ember-transitioning-in');\n assertHasNoClass(assert, $other, 'ember-transitioning-in');\n\n assertHasNoClass(assert, $index, 'ember-transitioning-out');\n assertHasNoClass(assert, $about, 'ember-transitioning-out');\n assertHasNoClass(assert, $other, 'ember-transitioning-out');\n }\n\n ['@test while a transition is underway with activeClass is false'](assert) {\n let $index = this.$('#index-link');\n let $news = this.$('#news-link');\n let $other = this.$('#other-link');\n\n $news.click();\n\n assertHasClass(assert, $index, 'active');\n assertHasNoClass(assert, $news, 'active');\n assertHasNoClass(assert, $other, 'active');\n\n assertHasNoClass(assert, $index, 'ember-transitioning-in');\n assertHasClass(assert, $news, 'ember-transitioning-in');\n assertHasNoClass(assert, $other, 'ember-transitioning-in');\n\n assertHasClass(assert, $index, 'ember-transitioning-out');\n assertHasNoClass(assert, $news, 'ember-transitioning-out');\n assertHasNoClass(assert, $other, 'ember-transitioning-out');\n\n this.runTask(() => this.newsDefer.resolve());\n\n assertHasNoClass(assert, $index, 'active');\n assertHasNoClass(assert, $news, 'active');\n assertHasNoClass(assert, $other, 'active');\n\n assertHasNoClass(assert, $index, 'ember-transitioning-in');\n assertHasNoClass(assert, $news, 'ember-transitioning-in');\n assertHasNoClass(assert, $other, 'ember-transitioning-in');\n\n assertHasNoClass(assert, $index, 'ember-transitioning-out');\n assertHasNoClass(assert, $news, 'ember-transitioning-out');\n assertHasNoClass(assert, $other, 'ember-transitioning-out');\n }\n });\n\n (0, _internalTestHelpers.moduleFor)(`The {{link-to}} helper: .transitioning-in .transitioning-out CSS classes - nested link-to's`, class extends _internalTestHelpers.ApplicationTestCase {\n constructor() {\n super();\n this.aboutDefer = _runtime.RSVP.defer();\n this.otherDefer = _runtime.RSVP.defer();\n let _this = this;\n\n this.router.map(function () {\n this.route('parent-route', function () {\n this.route('about');\n this.route('other');\n });\n });\n this.add('route:parent-route.about', _routing.Route.extend({\n model() {\n return _this.aboutDefer.promise;\n }\n }));\n\n this.add('route:parent-route.other', _routing.Route.extend({\n model() {\n return _this.otherDefer.promise;\n }\n }));\n\n this.addTemplate('application', `\n {{outlet}}\n {{#link-to 'index' tagName='li'}}\n {{link-to 'Index' 'index' id='index-link'}}\n {{/link-to}}\n {{#link-to 'parent-route.about' tagName='li'}}\n {{link-to 'About' 'parent-route.about' id='about-link'}}\n {{/link-to}}\n {{#link-to 'parent-route.other' tagName='li'}}\n {{link-to 'Other' 'parent-route.other' id='other-link'}}\n {{/link-to}}\n `);\n }\n\n beforeEach() {\n return this.visit('/');\n }\n\n resolveAbout() {\n return this.runTask(() => {\n this.aboutDefer.resolve();\n this.aboutDefer = _runtime.RSVP.defer();\n });\n }\n\n resolveOther() {\n return this.runTask(() => {\n this.otherDefer.resolve();\n this.otherDefer = _runtime.RSVP.defer();\n });\n }\n\n teardown() {\n super.teardown();\n this.aboutDefer = null;\n this.otherDefer = null;\n }\n\n [`@test while a transition is underway with nested link-to's`](assert) {\n // TODO undo changes to this test but currently this test navigates away if navigation\n // outlet is not stable and the second $about.click() is triggered.\n let $about = this.$('#about-link');\n\n $about.click();\n\n let $index = this.$('#index-link');\n $about = this.$('#about-link');\n let $other = this.$('#other-link');\n\n assertHasClass(assert, $index, 'active');\n assertHasNoClass(assert, $about, 'active');\n assertHasNoClass(assert, $about, 'active');\n\n assertHasNoClass(assert, $index, 'ember-transitioning-in');\n assertHasClass(assert, $about, 'ember-transitioning-in');\n assertHasNoClass(assert, $other, 'ember-transitioning-in');\n\n assertHasClass(assert, $index, 'ember-transitioning-out');\n assertHasNoClass(assert, $about, 'ember-transitioning-out');\n assertHasNoClass(assert, $other, 'ember-transitioning-out');\n\n this.resolveAbout();\n\n $index = this.$('#index-link');\n $about = this.$('#about-link');\n $other = this.$('#other-link');\n\n assertHasNoClass(assert, $index, 'active');\n assertHasClass(assert, $about, 'active');\n assertHasNoClass(assert, $other, 'active');\n\n assertHasNoClass(assert, $index, 'ember-transitioning-in');\n assertHasNoClass(assert, $about, 'ember-transitioning-in');\n assertHasNoClass(assert, $other, 'ember-transitioning-in');\n\n assertHasNoClass(assert, $index, 'ember-transitioning-out');\n assertHasNoClass(assert, $about, 'ember-transitioning-out');\n assertHasNoClass(assert, $other, 'ember-transitioning-out');\n\n $other.click();\n\n $index = this.$('#index-link');\n $about = this.$('#about-link');\n $other = this.$('#other-link');\n\n assertHasNoClass(assert, $index, 'active');\n assertHasClass(assert, $about, 'active');\n assertHasNoClass(assert, $other, 'active');\n\n assertHasNoClass(assert, $index, 'ember-transitioning-in');\n assertHasNoClass(assert, $about, 'ember-transitioning-in');\n assertHasClass(assert, $other, 'ember-transitioning-in');\n\n assertHasNoClass(assert, $index, 'ember-transitioning-out');\n assertHasClass(assert, $about, 'ember-transitioning-out');\n assertHasNoClass(assert, $other, 'ember-transitioning-out');\n\n this.resolveOther();\n\n $index = this.$('#index-link');\n $about = this.$('#about-link');\n $other = this.$('#other-link');\n\n assertHasNoClass(assert, $index, 'active');\n assertHasNoClass(assert, $about, 'active');\n assertHasClass(assert, $other, 'active');\n\n assertHasNoClass(assert, $index, 'ember-transitioning-in');\n assertHasNoClass(assert, $about, 'ember-transitioning-in');\n assertHasNoClass(assert, $other, 'ember-transitioning-in');\n\n assertHasNoClass(assert, $index, 'ember-transitioning-out');\n assertHasNoClass(assert, $about, 'ember-transitioning-out');\n assertHasNoClass(assert, $other, 'ember-transitioning-out');\n\n $about.click();\n\n $index = this.$('#index-link');\n $about = this.$('#about-link');\n $other = this.$('#other-link');\n\n assertHasNoClass(assert, $index, 'active');\n assertHasNoClass(assert, $about, 'active');\n assertHasClass(assert, $other, 'active');\n\n assertHasNoClass(assert, $index, 'ember-transitioning-in');\n assertHasClass(assert, $about, 'ember-transitioning-in');\n assertHasNoClass(assert, $other, 'ember-transitioning-in');\n\n assertHasNoClass(assert, $index, 'ember-transitioning-out');\n assertHasNoClass(assert, $about, 'ember-transitioning-out');\n assertHasClass(assert, $other, 'ember-transitioning-out');\n\n this.resolveAbout();\n\n $index = this.$('#index-link');\n $about = this.$('#about-link');\n $other = this.$('#other-link');\n\n assertHasNoClass(assert, $index, 'active');\n assertHasClass(assert, $about, 'active');\n assertHasNoClass(assert, $other, 'active');\n\n assertHasNoClass(assert, $index, 'ember-transitioning-in');\n assertHasNoClass(assert, $about, 'ember-transitioning-in');\n assertHasNoClass(assert, $other, 'ember-transitioning-in');\n\n assertHasNoClass(assert, $index, 'ember-transitioning-out');\n assertHasNoClass(assert, $about, 'ember-transitioning-out');\n assertHasNoClass(assert, $other, 'ember-transitioning-out');\n }\n });\n});","enifed('ember/tests/helpers/link_to_test/link_to_with_query_params_test', ['@ember/controller', '@ember/-internals/runtime', '@ember/-internals/routing', 'internal-test-helpers'], function (_controller, _runtime, _routing, _internalTestHelpers) {\n 'use strict';\n\n (0, _internalTestHelpers.moduleFor)('The {{link-to}} helper: invoking with query params', class extends _internalTestHelpers.ApplicationTestCase {\n constructor() {\n super();\n let indexProperties = {\n foo: '123',\n bar: 'abc'\n };\n this.add('controller:index', _controller.default.extend({\n queryParams: ['foo', 'bar', 'abool'],\n foo: indexProperties.foo,\n bar: indexProperties.bar,\n boundThing: 'OMG',\n abool: true\n }));\n this.add('controller:about', _controller.default.extend({\n queryParams: ['baz', 'bat'],\n baz: 'alex',\n bat: 'borf'\n }));\n this.indexProperties = indexProperties;\n }\n\n shouldNotBeActive(assert, selector) {\n this.checkActive(assert, selector, false);\n }\n\n shouldBeActive(assert, selector) {\n this.checkActive(assert, selector, true);\n }\n\n getController(name) {\n return this.applicationInstance.lookup(`controller:${name}`);\n }\n\n checkActive(assert, selector, active) {\n let classList = this.$(selector)[0].className;\n assert.equal(classList.indexOf('active') > -1, active, selector + ' active should be ' + active.toString());\n }\n\n [`@test doesn't update controller QP properties on current route when invoked`](assert) {\n this.addTemplate('index', `\n {{#link-to 'index' id='the-link'}}Index{{/link-to}}\n `);\n\n return this.visit('/').then(() => {\n this.click('#the-link');\n let indexController = this.getController('index');\n\n assert.deepEqual(indexController.getProperties('foo', 'bar'), this.indexProperties, 'controller QP properties do not update');\n });\n }\n\n [`@test doesn't update controller QP properties on current route when invoked (empty query-params obj)`](assert) {\n this.addTemplate('index', `\n {{#link-to 'index' (query-params) id='the-link'}}Index{{/link-to}}\n `);\n\n return this.visit('/').then(() => {\n this.click('#the-link');\n let indexController = this.getController('index');\n\n assert.deepEqual(indexController.getProperties('foo', 'bar'), this.indexProperties, 'controller QP properties do not update');\n });\n }\n\n [`@test doesn't update controller QP properties on current route when invoked (empty query-params obj, inferred route)`](assert) {\n this.addTemplate('index', `\n {{#link-to (query-params) id='the-link'}}Index{{/link-to}}\n `);\n\n return this.visit('/').then(() => {\n this.click('#the-link');\n let indexController = this.getController('index');\n\n assert.deepEqual(indexController.getProperties('foo', 'bar'), this.indexProperties, 'controller QP properties do not update');\n });\n }\n\n ['@test updates controller QP properties on current route when invoked'](assert) {\n this.addTemplate('index', `\n {{#link-to 'index' (query-params foo='456') id=\"the-link\"}}\n Index\n {{/link-to}}\n `);\n\n return this.visit('/').then(() => {\n this.click('#the-link');\n let indexController = this.getController('index');\n\n assert.deepEqual(indexController.getProperties('foo', 'bar'), { foo: '456', bar: 'abc' }, 'controller QP properties updated');\n });\n }\n\n ['@test updates controller QP properties on current route when invoked (inferred route)'](assert) {\n this.addTemplate('index', `\n {{#link-to (query-params foo='456') id=\"the-link\"}}\n Index\n {{/link-to}}\n `);\n\n return this.visit('/').then(() => {\n this.click('#the-link');\n let indexController = this.getController('index');\n\n assert.deepEqual(indexController.getProperties('foo', 'bar'), { foo: '456', bar: 'abc' }, 'controller QP properties updated');\n });\n }\n\n ['@test updates controller QP properties on other route after transitioning to that route'](assert) {\n this.router.map(function () {\n this.route('about');\n });\n\n this.addTemplate('index', `\n {{#link-to 'about' (query-params baz='lol') id='the-link'}}\n About\n {{/link-to}}\n `);\n\n return this.visit('/').then(() => {\n let theLink = this.$('#the-link');\n assert.equal(theLink.attr('href'), '/about?baz=lol');\n\n this.runTask(() => this.click('#the-link'));\n\n let aboutController = this.getController('about');\n\n assert.deepEqual(aboutController.getProperties('baz', 'bat'), { baz: 'lol', bat: 'borf' }, 'about controller QP properties updated');\n });\n }\n\n ['@test supplied QP properties can be bound'](assert) {\n this.addTemplate('index', `\n {{#link-to (query-params foo=boundThing) id='the-link'}}Index{{/link-to}}\n `);\n\n return this.visit('/').then(() => {\n let indexController = this.getController('index');\n let theLink = this.$('#the-link');\n\n assert.equal(theLink.attr('href'), '/?foo=OMG');\n\n this.runTask(() => indexController.set('boundThing', 'ASL'));\n\n assert.equal(theLink.attr('href'), '/?foo=ASL');\n });\n }\n\n ['@test supplied QP properties can be bound (booleans)'](assert) {\n this.addTemplate('index', `\n {{#link-to (query-params abool=boundThing) id='the-link'}}\n Index\n {{/link-to}}\n `);\n\n return this.visit('/').then(() => {\n let indexController = this.getController('index');\n let theLink = this.$('#the-link');\n\n assert.equal(theLink.attr('href'), '/?abool=OMG');\n\n this.runTask(() => indexController.set('boundThing', false));\n\n assert.equal(theLink.attr('href'), '/?abool=false');\n\n this.click('#the-link');\n\n assert.deepEqual(indexController.getProperties('foo', 'bar', 'abool'), { foo: '123', bar: 'abc', abool: false }, 'bound bool QP properties update');\n });\n }\n ['@test href updates when unsupplied controller QP props change'](assert) {\n this.addTemplate('index', `\n {{#link-to (query-params foo='lol') id='the-link'}}Index{{/link-to}}\n `);\n\n return this.visit('/').then(() => {\n let indexController = this.getController('index');\n let theLink = this.$('#the-link');\n\n assert.equal(theLink.attr('href'), '/?foo=lol');\n\n this.runTask(() => indexController.set('bar', 'BORF'));\n\n assert.equal(theLink.attr('href'), '/?bar=BORF&foo=lol');\n\n this.runTask(() => indexController.set('foo', 'YEAH'));\n\n assert.equal(theLink.attr('href'), '/?bar=BORF&foo=lol');\n });\n }\n\n ['@test The {{link-to}} with only query params always transitions to the current route with the query params applied'](assert) {\n // Test harness for bug #12033\n this.addTemplate('cars', `\n {{#link-to 'cars.create' id='create-link'}}Create new car{{/link-to}}\n {{#link-to (query-params page='2') id='page2-link'}}Page 2{{/link-to}}\n {{outlet}}\n `);\n this.addTemplate('cars.create', `{{#link-to 'cars' id='close-link'}}Close create form{{/link-to}}`);\n\n this.router.map(function () {\n this.route('cars', function () {\n this.route('create');\n });\n });\n\n this.add('controller:cars', _controller.default.extend({\n queryParams: ['page'],\n page: 1\n }));\n\n return this.visit('/cars/create').then(() => {\n let router = this.appRouter;\n let carsController = this.getController('cars');\n\n assert.equal(router.currentRouteName, 'cars.create');\n\n this.runTask(() => this.click('#close-link'));\n\n assert.equal(router.currentRouteName, 'cars.index');\n assert.equal(router.get('url'), '/cars');\n assert.equal(carsController.get('page'), 1, 'The page query-param is 1');\n\n this.runTask(() => this.click('#page2-link'));\n\n assert.equal(router.currentRouteName, 'cars.index', 'The active route is still cars');\n assert.equal(router.get('url'), '/cars?page=2', 'The url has been updated');\n assert.equal(carsController.get('page'), 2, 'The query params have been updated');\n });\n }\n\n ['@test the {{link-to}} applies activeClass when query params are not changed'](assert) {\n this.addTemplate('index', `\n {{#link-to (query-params foo='cat') id='cat-link'}}Index{{/link-to}}\n {{#link-to (query-params foo='dog') id='dog-link'}}Index{{/link-to}}\n {{#link-to 'index' id='change-nothing'}}Index{{/link-to}}\n `);\n this.addTemplate('search', `\n {{#link-to (query-params search='same') id='same-search'}}Index{{/link-to}}\n {{#link-to (query-params search='change') id='change-search'}}Index{{/link-to}}\n {{#link-to (query-params search='same' archive=true) id='same-search-add-archive'}}Index{{/link-to}}\n {{#link-to (query-params archive=true) id='only-add-archive'}}Index{{/link-to}}\n {{#link-to (query-params search='same' archive=true) id='both-same'}}Index{{/link-to}}\n {{#link-to (query-params search='different' archive=true) id='change-one'}}Index{{/link-to}}\n {{#link-to (query-params search='different' archive=false) id='remove-one'}}Index{{/link-to}}\n {{outlet}}\n `);\n this.addTemplate('search.results', `\n {{#link-to (query-params sort='title') id='same-sort-child-only'}}Index{{/link-to}}\n {{#link-to (query-params search='same') id='same-search-parent-only'}}Index{{/link-to}}\n {{#link-to (query-params search='change') id='change-search-parent-only'}}Index{{/link-to}}\n {{#link-to (query-params search='same' sort='title') id='same-search-same-sort-child-and-parent'}}Index{{/link-to}}\n {{#link-to (query-params search='same' sort='author') id='same-search-different-sort-child-and-parent'}}Index{{/link-to}}\n {{#link-to (query-params search='change' sort='title') id='change-search-same-sort-child-and-parent'}}Index{{/link-to}}\n {{#link-to (query-params foo='dog') id='dog-link'}}Index{{/link-to}}\n `);\n\n this.router.map(function () {\n this.route('search', function () {\n this.route('results');\n });\n });\n\n this.add('controller:search', _controller.default.extend({\n queryParams: ['search', 'archive'],\n search: '',\n archive: false\n }));\n\n this.add('controller:search.results', _controller.default.extend({\n queryParams: ['sort', 'showDetails'],\n sort: 'title',\n showDetails: true\n }));\n\n return this.visit('/').then(() => {\n this.shouldNotBeActive(assert, '#cat-link');\n this.shouldNotBeActive(assert, '#dog-link');\n\n return this.visit('/?foo=cat');\n }).then(() => {\n this.shouldBeActive(assert, '#cat-link');\n this.shouldNotBeActive(assert, '#dog-link');\n\n return this.visit('/?foo=dog');\n }).then(() => {\n this.shouldBeActive(assert, '#dog-link');\n this.shouldNotBeActive(assert, '#cat-link');\n this.shouldBeActive(assert, '#change-nothing');\n\n return this.visit('/search?search=same');\n }).then(() => {\n this.shouldBeActive(assert, '#same-search');\n this.shouldNotBeActive(assert, '#change-search');\n this.shouldNotBeActive(assert, '#same-search-add-archive');\n this.shouldNotBeActive(assert, '#only-add-archive');\n this.shouldNotBeActive(assert, '#remove-one');\n\n return this.visit('/search?search=same&archive=true');\n }).then(() => {\n this.shouldBeActive(assert, '#both-same');\n this.shouldNotBeActive(assert, '#change-one');\n\n return this.visit('/search/results?search=same&sort=title&showDetails=true');\n }).then(() => {\n this.shouldBeActive(assert, '#same-sort-child-only');\n this.shouldBeActive(assert, '#same-search-parent-only');\n this.shouldNotBeActive(assert, '#change-search-parent-only');\n this.shouldBeActive(assert, '#same-search-same-sort-child-and-parent');\n this.shouldNotBeActive(assert, '#same-search-different-sort-child-and-parent');\n this.shouldNotBeActive(assert, '#change-search-same-sort-child-and-parent');\n });\n }\n\n ['@test the {{link-to}} applies active class when query-param is a number'](assert) {\n this.addTemplate('index', `\n {{#link-to (query-params page=pageNumber) id='page-link'}}\n Index\n {{/link-to}}\n `);\n this.add('controller:index', _controller.default.extend({\n queryParams: ['page'],\n page: 1,\n pageNumber: 5\n }));\n\n return this.visit('/').then(() => {\n this.shouldNotBeActive(assert, '#page-link');\n return this.visit('/?page=5');\n }).then(() => {\n this.shouldBeActive(assert, '#page-link');\n });\n }\n\n ['@test the {{link-to}} applies active class when query-param is an array'](assert) {\n this.addTemplate('index', `\n {{#link-to (query-params pages=pagesArray) id='array-link'}}Index{{/link-to}}\n {{#link-to (query-params pages=biggerArray) id='bigger-link'}}Index{{/link-to}}\n {{#link-to (query-params pages=emptyArray) id='empty-link'}}Index{{/link-to}}\n `);\n\n this.add('controller:index', _controller.default.extend({\n queryParams: ['pages'],\n pages: [],\n pagesArray: [1, 2],\n biggerArray: [1, 2, 3],\n emptyArray: []\n }));\n\n return this.visit('/').then(() => {\n this.shouldNotBeActive(assert, '#array-link');\n\n return this.visit('/?pages=%5B1%2C2%5D');\n }).then(() => {\n this.shouldBeActive(assert, '#array-link');\n this.shouldNotBeActive(assert, '#bigger-link');\n this.shouldNotBeActive(assert, '#empty-link');\n\n return this.visit('/?pages=%5B2%2C1%5D');\n }).then(() => {\n this.shouldNotBeActive(assert, '#array-link');\n this.shouldNotBeActive(assert, '#bigger-link');\n this.shouldNotBeActive(assert, '#empty-link');\n\n return this.visit('/?pages=%5B1%2C2%2C3%5D');\n }).then(() => {\n this.shouldBeActive(assert, '#bigger-link');\n this.shouldNotBeActive(assert, '#array-link');\n this.shouldNotBeActive(assert, '#empty-link');\n });\n }\n ['@test the {{link-to}} helper applies active class to the parent route'](assert) {\n this.router.map(function () {\n this.route('parent', function () {\n this.route('child');\n });\n });\n\n this.addTemplate('application', `\n {{#link-to 'parent' id='parent-link'}}Parent{{/link-to}}\n {{#link-to 'parent.child' id='parent-child-link'}}Child{{/link-to}}\n {{#link-to 'parent' (query-params foo=cat) id='parent-link-qp'}}Parent{{/link-to}}\n {{outlet}}\n `);\n\n this.add('controller:parent.child', _controller.default.extend({\n queryParams: ['foo'],\n foo: 'bar'\n }));\n\n return this.visit('/').then(() => {\n this.shouldNotBeActive(assert, '#parent-link');\n this.shouldNotBeActive(assert, '#parent-child-link');\n this.shouldNotBeActive(assert, '#parent-link-qp');\n return this.visit('/parent/child?foo=dog');\n }).then(() => {\n this.shouldBeActive(assert, '#parent-link');\n this.shouldNotBeActive(assert, '#parent-link-qp');\n });\n }\n\n ['@test The {{link-to}} helper disregards query-params in activeness computation when current-when is specified'](assert) {\n let appLink;\n\n this.router.map(function () {\n this.route('parent');\n });\n this.addTemplate('application', `\n {{#link-to 'parent' (query-params page=1) current-when='parent' id='app-link'}}\n Parent\n {{/link-to}}\n {{outlet}}\n `);\n this.addTemplate('parent', `\n {{#link-to 'parent' (query-params page=1) current-when='parent' id='parent-link'}}\n Parent\n {{/link-to}}\n {{outlet}}\n `);\n this.add('controller:parent', _controller.default.extend({\n queryParams: ['page'],\n page: 1\n }));\n\n return this.visit('/').then(() => {\n appLink = this.$('#app-link');\n\n assert.equal(appLink.attr('href'), '/parent');\n this.shouldNotBeActive(assert, '#app-link');\n\n return this.visit('/parent?page=2');\n }).then(() => {\n appLink = this.$('#app-link');\n let router = this.appRouter;\n\n assert.equal(appLink.attr('href'), '/parent');\n this.shouldBeActive(assert, '#app-link');\n assert.equal(this.$('#parent-link').attr('href'), '/parent');\n this.shouldBeActive(assert, '#parent-link');\n\n let parentController = this.getController('parent');\n\n assert.equal(parentController.get('page'), 2);\n\n this.runTask(() => parentController.set('page', 3));\n\n assert.equal(router.get('location.path'), '/parent?page=3');\n this.shouldBeActive(assert, '#app-link');\n this.shouldBeActive(assert, '#parent-link');\n\n this.runTask(() => this.click('#app-link'));\n\n assert.equal(router.get('location.path'), '/parent');\n });\n }\n\n ['@test link-to default query params while in active transition regression test'](assert) {\n this.router.map(function () {\n this.route('foos');\n this.route('bars');\n });\n let foos = _runtime.RSVP.defer();\n let bars = _runtime.RSVP.defer();\n\n this.addTemplate('application', `\n {{link-to 'Foos' 'foos' id='foos-link'}}\n {{link-to 'Baz Foos' 'foos' (query-params baz=true) id='baz-foos-link'}}\n {{link-to 'Quux Bars' 'bars' (query-params quux=true) id='bars-link'}}\n `);\n this.add('controller:foos', _controller.default.extend({\n queryParams: ['status'],\n baz: false\n }));\n this.add('route:foos', _routing.Route.extend({\n model() {\n return foos.promise;\n }\n }));\n this.add('controller:bars', _controller.default.extend({\n queryParams: ['status'],\n quux: false\n }));\n this.add('route:bars', _routing.Route.extend({\n model() {\n return bars.promise;\n }\n }));\n\n return this.visit('/').then(() => {\n let router = this.appRouter;\n let foosLink = this.$('#foos-link');\n let barsLink = this.$('#bars-link');\n let bazLink = this.$('#baz-foos-link');\n\n assert.equal(foosLink.attr('href'), '/foos');\n assert.equal(bazLink.attr('href'), '/foos?baz=true');\n assert.equal(barsLink.attr('href'), '/bars?quux=true');\n assert.equal(router.get('location.path'), '/');\n this.shouldNotBeActive(assert, '#foos-link');\n this.shouldNotBeActive(assert, '#baz-foos-link');\n this.shouldNotBeActive(assert, '#bars-link');\n\n this.runTask(() => barsLink.click());\n this.shouldNotBeActive(assert, '#bars-link');\n\n this.runTask(() => foosLink.click());\n this.shouldNotBeActive(assert, '#foos-link');\n\n this.runTask(() => foos.resolve());\n\n assert.equal(router.get('location.path'), '/foos');\n this.shouldBeActive(assert, '#foos-link');\n });\n }\n\n [`@test the {{link-to}} helper throws a useful error if you invoke it wrong`](assert) {\n assert.expect(1);\n\n this.addTemplate('application', `{{#link-to id='the-link'}}Index{{/link-to}}`);\n\n expectAssertion(() => {\n this.visit('/');\n }, /You must provide one or more parameters to the link-to component/);\n\n return this.runLoopSettled();\n }\n });\n});","enifed('ember/tests/homepage_example_test', ['@ember/-internals/routing', '@ember/-internals/metal', '@ember/-internals/runtime', 'internal-test-helpers'], function (_routing, _metal, _runtime, _internalTestHelpers) {\n 'use strict';\n\n (0, _internalTestHelpers.moduleFor)('The example renders correctly', class extends _internalTestHelpers.ApplicationTestCase {\n ['@test Render index template into application outlet'](assert) {\n this.addTemplate('application', '{{outlet}}');\n this.addTemplate('index', '
');\n\n this.router.map(function () {\n this.route('home', { path: '/' });\n });\n\n originalConsoleError = console.error;\n }\n\n teardown() {\n super.teardown();\n console.error = originalConsoleError;\n }\n\n getController(name) {\n return this.applicationInstance.lookup(`controller:${name}`);\n }\n\n handleURLAborts(assert, path) {\n (0, _runloop.run)(() => {\n let router = this.applicationInstance.lookup('router:main');\n router.handleURL(path).then(function () {\n assert.ok(false, 'url: `' + path + '` was NOT to be handled');\n }, function (reason) {\n assert.ok(reason && reason.message === 'TransitionAborted', 'url: `' + path + '` was to be aborted');\n });\n });\n }\n\n get currentPath() {\n return this.getController('application').get('currentPath');\n }\n\n get currentURL() {\n return this.appRouter.get('currentURL');\n }\n\n handleURLRejectsWith(context, assert, path, expectedReason) {\n return context.visit(path).then(() => {\n assert.ok(false, 'expected handleURLing: `' + path + '` to fail');\n }).catch(reason => {\n assert.equal(reason.message, expectedReason);\n });\n }\n\n ['@test warn on URLs not included in the route set']() {\n return this.visit('/').then(() => {\n expectAssertion(() => {\n this.visit('/what-is-this-i-dont-even');\n }, /'\\/what-is-this-i-dont-even' did not match any routes/);\n });\n }\n\n ['@test The Homepage'](assert) {\n return this.visit('/').then(() => {\n assert.equal(this.currentPath, 'home', 'currently on the home route');\n\n let text = this.$('.hours').text();\n assert.equal(text, 'Hours', 'the home template was rendered');\n });\n }\n\n [`@test The Homepage and the Camelot page with multiple Router.map calls`](assert) {\n this.router.map(function () {\n this.route('camelot', { path: '/camelot' });\n });\n\n return this.visit('/camelot').then(() => {\n assert.equal(this.currentPath, 'camelot');\n\n let text = this.$('#camelot').text();\n assert.equal(text, 'Is a silly place', 'the camelot template was rendered');\n\n return this.visit('/');\n }).then(() => {\n assert.equal(this.currentPath, 'home');\n\n let text = this.$('.hours').text();\n assert.equal(text, 'Hours', 'the home template was rendered');\n });\n }\n\n [`@test The Homepage with explicit template name in renderTemplate`](assert) {\n this.add('route:home', _routing.Route.extend({\n renderTemplate() {\n this.render('homepage');\n }\n }));\n\n return this.visit('/').then(() => {\n let text = this.$('#troll').text();\n assert.equal(text, 'Megatroll', 'the homepage template was rendered');\n });\n }\n\n [`@test an alternate template will pull in an alternate controller`](assert) {\n this.add('route:home', _routing.Route.extend({\n renderTemplate() {\n this.render('homepage');\n }\n }));\n this.add('controller:homepage', _controller.default.extend({\n model: {\n home: 'Comes from homepage'\n }\n }));\n\n return this.visit('/').then(() => {\n let text = this.$('p').text();\n\n assert.equal(text, 'Comes from homepage', 'the homepage template was rendered');\n });\n }\n\n [`@test An alternate template will pull in an alternate controller instead of controllerName`](assert) {\n this.add('route:home', _routing.Route.extend({\n controllerName: 'foo',\n renderTemplate() {\n this.render('homepage');\n }\n }));\n this.add('controller:foo', _controller.default.extend({\n model: {\n home: 'Comes from foo'\n }\n }));\n this.add('controller:homepage', _controller.default.extend({\n model: {\n home: 'Comes from homepage'\n }\n }));\n\n return this.visit('/').then(() => {\n let text = this.$('p').text();\n\n assert.equal(text, 'Comes from homepage', 'the homepage template was rendered');\n });\n }\n\n [`@test The template will pull in an alternate controller via key/value`](assert) {\n this.router.map(function () {\n this.route('homepage', { path: '/' });\n });\n\n this.add('route:homepage', _routing.Route.extend({\n renderTemplate() {\n this.render({ controller: 'home' });\n }\n }));\n this.add('controller:home', _controller.default.extend({\n model: {\n home: 'Comes from home.'\n }\n }));\n\n return this.visit('/').then(() => {\n let text = this.$('p').text();\n\n assert.equal(text, 'Comes from home.', 'the homepage template was rendered from data from the HomeController');\n });\n }\n\n [`@test The Homepage with explicit template name in renderTemplate and controller`](assert) {\n this.add('controller:home', _controller.default.extend({\n model: {\n home: 'YES I AM HOME'\n }\n }));\n this.add('route:home', _routing.Route.extend({\n renderTemplate() {\n this.render('homepage');\n }\n }));\n\n return this.visit('/').then(() => {\n let text = this.$('p').text();\n\n assert.equal(text, 'YES I AM HOME', 'The homepage template was rendered');\n });\n }\n\n [`@test Model passed via renderTemplate model is set as controller's model`](assert) {\n this.addTemplate('bio', '
{{model.name}}
');\n this.add('route:home', _routing.Route.extend({\n renderTemplate() {\n this.render('bio', {\n model: { name: 'emberjs' }\n });\n }\n }));\n\n return this.visit('/').then(() => {\n let text = this.$('p').text();\n\n assert.equal(text, 'emberjs', `Passed model was set as controller's model`);\n });\n }\n\n ['@test render uses templateName from route'](assert) {\n this.addTemplate('the_real_home_template', '
THIS IS THE REAL HOME
');\n this.add('route:home', _routing.Route.extend({\n templateName: 'the_real_home_template'\n }));\n\n return this.visit('/').then(() => {\n let text = this.$('p').text();\n\n assert.equal(text, 'THIS IS THE REAL HOME', 'the homepage template was rendered');\n });\n }\n\n ['@test defining templateName allows other templates to be rendered'](assert) {\n this.addTemplate('alert', `
{{outlet 'alert'}}`);\n this.add('route:home', _routing.Route.extend({\n templateName: 'the_real_home_template',\n actions: {\n showAlert() {\n this.render('alert', {\n into: 'home',\n outlet: 'alert'\n });\n }\n }\n }));\n\n return this.visit('/').then(() => {\n let text = this.$('p').text();\n assert.equal(text, 'THIS IS THE REAL HOME', 'the homepage template was rendered');\n\n return this.runTask(() => this.appRouter.send('showAlert'));\n }).then(() => {\n let text = this.$('.alert-box').text();\n\n assert.equal(text, 'Invader!', 'Template for alert was rendered into the outlet');\n });\n }\n\n ['@test templateName is still used when calling render with no name and options'](assert) {\n this.addTemplate('alert', `
Invader!
`);\n this.addTemplate('home', `
THIS IS THE REAL HOME
{{outlet 'alert'}}`);\n\n this.add('route:home', _routing.Route.extend({\n templateName: 'alert',\n renderTemplate() {\n this.render({});\n }\n }));\n\n return this.visit('/').then(() => {\n let text = this.$('.alert-box').text();\n\n assert.equal(text, 'Invader!', 'default templateName was rendered into outlet');\n });\n }\n\n ['@test The Homepage with a `setupController` hook'](assert) {\n this.addTemplate('home', `
{{#each hours as |entry|}}\n
{{entry}}
\n {{/each}}\n
\n `);\n\n this.add('route:home', _routing.Route.extend({\n setupController(controller) {\n controller.set('hours', ['Monday through Friday: 9am to 5pm', 'Saturday: Noon to Midnight', 'Sunday: Noon to 6pm']);\n }\n }));\n return this.visit('/').then(() => {\n let text = this.$('ul li:nth-child(3)').text();\n\n assert.equal(text, 'Sunday: Noon to 6pm', 'The template was rendered with the hours context');\n });\n }\n\n [`@test The route controller is still set when overriding the setupController hook`](assert) {\n this.add('route:home', _routing.Route.extend({\n setupController() {\n // no-op\n // importantly, we are not calling this._super\n }\n }));\n\n this.add('controller:home', _controller.default.extend());\n\n return this.visit('/').then(() => {\n let homeRoute = this.applicationInstance.lookup('route:home');\n let homeController = this.applicationInstance.lookup('controller:home');\n\n assert.equal(homeRoute.controller, homeController, 'route controller is the home controller');\n });\n }\n\n ['@test the route controller can be specified via controllerName'](assert) {\n this.addTemplate('home', '
{{myValue}}
');\n this.add('route:home', _routing.Route.extend({\n controllerName: 'myController'\n }));\n this.add('controller:myController', _controller.default.extend({\n myValue: 'foo'\n }));\n\n return this.visit('/').then(() => {\n let homeRoute = this.applicationInstance.lookup('route:home');\n let myController = this.applicationInstance.lookup('controller:myController');\n let text = this.$('p').text();\n\n assert.equal(homeRoute.controller, myController, 'route controller is set by controllerName');\n assert.equal(text, 'foo', 'The homepage template was rendered with data from the custom controller');\n });\n }\n\n [`@test The route controller specified via controllerName is used in render`](assert) {\n this.router.map(function () {\n this.route('home', { path: '/' });\n });\n\n this.add('route:home', _routing.Route.extend({\n controllerName: 'myController',\n renderTemplate() {\n this.render('alternative_home');\n }\n }));\n\n this.add('controller:myController', _controller.default.extend({\n myValue: 'foo'\n }));\n\n this.addTemplate('alternative_home', '
alternative home: {{myValue}}
');\n\n return this.visit('/').then(() => {\n let homeRoute = this.applicationInstance.lookup('route:home');\n let myController = this.applicationInstance.lookup('controller:myController');\n let text = this.$('p').text();\n\n assert.equal(homeRoute.controller, myController, 'route controller is set by controllerName');\n\n assert.equal(text, 'alternative home: foo', 'The homepage template was rendered with data from the custom controller');\n });\n }\n\n [`@test The route controller specified via controllerName is used in render even when a controller with the routeName is available`](assert) {\n this.router.map(function () {\n this.route('home', { path: '/' });\n });\n\n this.addTemplate('home', '
home: {{myValue}}
');\n\n this.add('route:home', _routing.Route.extend({\n controllerName: 'myController'\n }));\n\n this.add('controller:home', _controller.default.extend({\n myValue: 'home'\n }));\n\n this.add('controller:myController', _controller.default.extend({\n myValue: 'myController'\n }));\n\n return this.visit('/').then(() => {\n let homeRoute = this.applicationInstance.lookup('route:home');\n let myController = this.applicationInstance.lookup('controller:myController');\n let text = this.$('p').text();\n\n assert.equal(homeRoute.controller, myController, 'route controller is set by controllerName');\n\n assert.equal(text, 'home: myController', 'The homepage template was rendered with data from the custom controller');\n });\n }\n\n [`@test The Homepage with a 'setupController' hook modifying other controllers`](assert) {\n this.router.map(function () {\n this.route('home', { path: '/' });\n });\n\n this.add('route:home', _routing.Route.extend({\n setupController() /* controller */{\n this.controllerFor('home').set('hours', ['Monday through Friday: 9am to 5pm', 'Saturday: Noon to Midnight', 'Sunday: Noon to 6pm']);\n }\n }));\n\n this.addTemplate('home', '
{{#each hours as |entry|}}
{{entry}}
{{/each}}
');\n\n return this.visit('/').then(() => {\n let text = this.$('ul li:nth-child(3)').text();\n\n assert.equal(text, 'Sunday: Noon to 6pm', 'The template was rendered with the hours context');\n });\n }\n\n [`@test The Homepage with a computed model that does not get overridden`](assert) {\n this.router.map(function () {\n this.route('home', { path: '/' });\n });\n\n this.add('controller:home', _controller.default.extend({\n model: (0, _metal.computed)(function () {\n return ['Monday through Friday: 9am to 5pm', 'Saturday: Noon to Midnight', 'Sunday: Noon to 6pm'];\n })\n }));\n\n this.addTemplate('home', '
{{#each model as |passage|}}
{{passage}}
{{/each}}
');\n\n return this.visit('/').then(() => {\n let text = this.$('ul li:nth-child(3)').text();\n\n assert.equal(text, 'Sunday: Noon to 6pm', 'The template was rendered with the context intact');\n });\n }\n\n [`@test The Homepage getting its controller context via model`](assert) {\n this.router.map(function () {\n this.route('home', { path: '/' });\n });\n\n this.add('route:home', _routing.Route.extend({\n model() {\n return ['Monday through Friday: 9am to 5pm', 'Saturday: Noon to Midnight', 'Sunday: Noon to 6pm'];\n },\n\n setupController(controller, model) {\n assert.equal(this.controllerFor('home'), controller);\n\n this.controllerFor('home').set('hours', model);\n }\n }));\n\n this.addTemplate('home', '
{{#each hours as |entry|}}
{{entry}}
{{/each}}
');\n\n return this.visit('/').then(() => {\n let text = this.$('ul li:nth-child(3)').text();\n\n assert.equal(text, 'Sunday: Noon to 6pm', 'The template was rendered with the hours context');\n });\n }\n\n [`@test The Specials Page getting its controller context by deserializing the params hash`](assert) {\n this.router.map(function () {\n this.route('home', { path: '/' });\n this.route('special', { path: '/specials/:menu_item_id' });\n });\n\n this.add('route:special', _routing.Route.extend({\n model(params) {\n return _runtime.Object.create({\n menuItemId: params.menu_item_id\n });\n }\n }));\n\n this.addTemplate('special', '
{{model.menuItemId}}
');\n\n return this.visit('/specials/1').then(() => {\n let text = this.$('p').text();\n\n assert.equal(text, '1', 'The model was used to render the template');\n });\n }\n\n ['@test The Specials Page defaults to looking models up via `find`']() {\n let MenuItem = _runtime.Object.extend();\n MenuItem.reopenClass({\n find(id) {\n return MenuItem.create({ id });\n }\n });\n this.add('model:menu_item', MenuItem);\n\n this.router.map(function () {\n this.route('home', { path: '/' });\n this.route('special', { path: '/specials/:menu_item_id' });\n });\n\n this.addTemplate('special', '{{model.id}}');\n\n return this.visit('/specials/1').then(() => {\n this.assertText('1', 'The model was used to render the template');\n });\n }\n\n ['@test The Special Page returning a promise puts the app into a loading state until the promise is resolved']() {\n this.router.map(function () {\n this.route('home', { path: '/' });\n this.route('special', { path: '/specials/:menu_item_id' });\n });\n\n let menuItem, resolve;\n\n let MenuItem = _runtime.Object.extend();\n MenuItem.reopenClass({\n find(id) {\n menuItem = MenuItem.create({ id: id });\n\n return new _rsvp.default.Promise(function (res) {\n resolve = res;\n });\n }\n });\n\n this.add('model:menu_item', MenuItem);\n\n this.addTemplate('special', '
{{model.id}}
');\n this.addTemplate('loading', '
LOADING!
');\n\n let visited = this.visit('/specials/1');\n this.assertText('LOADING!', 'The app is in the loading state');\n\n resolve(menuItem);\n\n return visited.then(() => {\n this.assertText('1', 'The app is now in the specials state');\n });\n }\n\n [`@test The loading state doesn't get entered for promises that resolve on the same run loop`](assert) {\n this.router.map(function () {\n this.route('home', { path: '/' });\n this.route('special', { path: '/specials/:menu_item_id' });\n });\n\n let MenuItem = _runtime.Object.extend();\n MenuItem.reopenClass({\n find(id) {\n return { id: id };\n }\n });\n\n this.add('model:menu_item', MenuItem);\n\n this.add('route:loading', _routing.Route.extend({\n enter() {\n assert.ok(false, \"LoadingRoute shouldn't have been entered.\");\n }\n }));\n\n this.addTemplate('special', '
{{model.id}}
');\n this.addTemplate('loading', '
LOADING!
');\n\n return this.visit('/specials/1').then(() => {\n let text = this.$('p').text();\n\n assert.equal(text, '1', 'The app is now in the specials state');\n });\n }\n\n [\"@test The Special page returning an error invokes SpecialRoute's error handler\"](assert) {\n this.router.map(function () {\n this.route('home', { path: '/' });\n this.route('special', { path: '/specials/:menu_item_id' });\n });\n\n let menuItem, promise, resolve;\n\n let MenuItem = _runtime.Object.extend();\n MenuItem.reopenClass({\n find(id) {\n menuItem = MenuItem.create({ id: id });\n promise = new _rsvp.default.Promise(res => resolve = res);\n\n return promise;\n }\n });\n\n this.add('model:menu_item', MenuItem);\n\n this.add('route:special', _routing.Route.extend({\n setup() {\n throw new Error('Setup error');\n },\n actions: {\n error(reason) {\n assert.equal(reason.message, 'Setup error', 'SpecialRoute#error received the error thrown from setup');\n return true;\n }\n }\n }));\n\n this.handleURLRejectsWith(this, assert, 'specials/1', 'Setup error');\n\n (0, _runloop.run)(() => resolve(menuItem));\n }\n\n [\"@test ApplicationRoute's default error handler can be overridden\"](assert) {\n assert.expect(2);\n\n this.router.map(function () {\n this.route('home', { path: '/' });\n this.route('special', { path: '/specials/:menu_item_id' });\n });\n\n let menuItem, resolve;\n\n let MenuItem = _runtime.Object.extend();\n\n MenuItem.reopenClass({\n find(id) {\n menuItem = MenuItem.create({ id: id });\n return new _rsvp.default.Promise(res => resolve = res);\n }\n });\n this.add('model:menu_item', MenuItem);\n\n this.add('route:application', _routing.Route.extend({\n actions: {\n error(reason) {\n assert.equal(reason.message, 'Setup error', 'error was correctly passed to custom ApplicationRoute handler');\n return true;\n }\n }\n }));\n\n this.add('route:special', _routing.Route.extend({\n setup() {\n throw new Error('Setup error');\n }\n }));\n\n this.handleURLRejectsWith(this, assert, '/specials/1', 'Setup error');\n\n (0, _runloop.run)(() => resolve(menuItem));\n }\n\n ['@test Moving from one page to another triggers the correct callbacks'](assert) {\n assert.expect(3);\n\n this.router.map(function () {\n this.route('home', { path: '/' });\n this.route('special', { path: '/specials/:menu_item_id' });\n });\n\n let MenuItem = _runtime.Object.extend();\n MenuItem.reopenClass({\n find(id) {\n return MenuItem.create({ id: id });\n }\n });\n this.add('model:menu_item', MenuItem);\n\n this.addTemplate('home', '
Home
');\n this.addTemplate('special', '
{{model.id}}
');\n\n return this.visit('/').then(() => {\n this.assertText('Home', 'The app is now in the initial state');\n\n let promiseContext = MenuItem.create({ id: 1 });\n\n return this.visit('/specials/1', promiseContext);\n }).then(() => {\n assert.equal(this.currentURL, '/specials/1');\n this.assertText('1', 'The app is now transitioned');\n });\n }\n\n ['@test Nested callbacks are not exited when moving to siblings'](assert) {\n let rootSetup = 0;\n let rootRender = 0;\n let rootModel = 0;\n let rootSerialize = 0;\n let menuItem;\n let rootElement;\n\n let MenuItem = _runtime.Object.extend();\n MenuItem.reopenClass({\n find(id) {\n menuItem = MenuItem.create({ id: id });\n return menuItem;\n }\n });\n\n this.router.map(function () {\n this.route('root', { path: '/' }, function () {\n this.route('special', {\n path: '/specials/:menu_item_id',\n resetNamespace: true\n });\n });\n });\n\n this.add('route:root', _routing.Route.extend({\n model() {\n rootModel++;\n return this._super(...arguments);\n },\n\n setupController() {\n rootSetup++;\n },\n\n renderTemplate() {\n rootRender++;\n },\n\n serialize() {\n rootSerialize++;\n return this._super(...arguments);\n }\n }));\n\n this.add('route:loading', _routing.Route.extend({}));\n this.add('route:home', _routing.Route.extend({}));\n this.add('route:special', _routing.Route.extend({\n model({ menu_item_id }) {\n return MenuItem.find(menu_item_id);\n },\n setupController(controller, model) {\n (0, _metal.set)(controller, 'model', model);\n }\n }));\n\n this.addTemplate('root.index', '
Home
');\n this.addTemplate('special', '
{{model.id}}
');\n this.addTemplate('loading', '
LOADING!
');\n\n return this.visit('/').then(() => {\n rootElement = document.getElementById('qunit-fixture');\n\n assert.equal((0, _internalTestHelpers.getTextOf)(rootElement.querySelector('h3')), 'Home', 'The app is now in the initial state');\n assert.equal(rootSetup, 1, 'The root setup was triggered');\n assert.equal(rootRender, 1, 'The root render was triggered');\n assert.equal(rootSerialize, 0, 'The root serialize was not called');\n assert.equal(rootModel, 1, 'The root model was called');\n\n let router = this.applicationInstance.lookup('router:main');\n let menuItem = MenuItem.create({ id: 1 });\n\n return router.transitionTo('special', menuItem).then(function () {\n assert.equal(rootSetup, 1, 'The root setup was not triggered again');\n assert.equal(rootRender, 1, 'The root render was not triggered again');\n assert.equal(rootSerialize, 0, 'The root serialize was not called');\n\n // TODO: Should this be changed?\n assert.equal(rootModel, 1, 'The root model was called again');\n\n assert.deepEqual(router.location.path, '/specials/1');\n assert.equal(router.currentPath, 'root.special');\n });\n });\n }\n\n ['@test Events are triggered on the controller if a matching action name is implemented'](assert) {\n let done = assert.async();\n\n this.router.map(function () {\n this.route('home', { path: '/' });\n });\n\n let model = { name: 'Tom Dale' };\n let stateIsNotCalled = true;\n\n this.add('route:home', _routing.Route.extend({\n model() {\n return model;\n },\n\n actions: {\n showStuff() {\n stateIsNotCalled = false;\n }\n }\n }));\n\n this.addTemplate('home', '{{name}}');\n this.add('controller:home', _controller.default.extend({\n actions: {\n showStuff(context) {\n assert.ok(stateIsNotCalled, 'an event on the state is not triggered');\n assert.deepEqual(context, { name: 'Tom Dale' }, 'an event with context is passed');\n done();\n }\n }\n }));\n\n this.visit('/').then(() => {\n document.getElementById('qunit-fixture').querySelector('a').click();\n });\n }\n\n ['@test Events are triggered on the current state when defined in `actions` object'](assert) {\n let done = assert.async();\n\n this.router.map(function () {\n this.route('home', { path: '/' });\n });\n\n let model = { name: 'Tom Dale' };\n let HomeRoute = _routing.Route.extend({\n model() {\n return model;\n },\n\n actions: {\n showStuff(obj) {\n assert.ok(this instanceof HomeRoute, 'the handler is an App.HomeRoute');\n assert.deepEqual(Object.assign({}, obj), { name: 'Tom Dale' }, 'the context is correct');\n done();\n }\n }\n });\n\n this.add('route:home', HomeRoute);\n this.addTemplate('home', '{{model.name}}');\n\n this.visit('/').then(() => {\n document.getElementById('qunit-fixture').querySelector('a').click();\n });\n }\n\n ['@test Events defined in `actions` object are triggered on the current state when routes are nested'](assert) {\n let done = assert.async();\n\n this.router.map(function () {\n this.route('root', { path: '/' }, function () {\n this.route('index', { path: '/' });\n });\n });\n\n let model = { name: 'Tom Dale' };\n\n let RootRoute = _routing.Route.extend({\n actions: {\n showStuff(obj) {\n assert.ok(this instanceof RootRoute, 'the handler is an App.HomeRoute');\n assert.deepEqual(Object.assign({}, obj), { name: 'Tom Dale' }, 'the context is correct');\n done();\n }\n }\n });\n this.add('route:root', RootRoute);\n this.add('route:root.index', _routing.Route.extend({\n model() {\n return model;\n }\n }));\n\n this.addTemplate('root.index', '{{model.name}}');\n\n this.visit('/').then(() => {\n document.getElementById('qunit-fixture').querySelector('a').click();\n });\n }\n\n ['@test Events can be handled by inherited event handlers'](assert) {\n assert.expect(4);\n\n let SuperRoute = _routing.Route.extend({\n actions: {\n foo() {\n assert.ok(true, 'foo');\n },\n bar(msg) {\n assert.equal(msg, 'HELLO', 'bar hander in super route');\n }\n }\n });\n\n let RouteMixin = _metal.Mixin.create({\n actions: {\n bar(msg) {\n assert.equal(msg, 'HELLO', 'bar handler in mixin');\n this._super(msg);\n }\n }\n });\n\n this.add('route:home', SuperRoute.extend(RouteMixin, {\n actions: {\n baz() {\n assert.ok(true, 'baz', 'baz hander in route');\n }\n }\n }));\n this.addTemplate('home', `\n Do foo\n Do bar with arg\n Do bar\n `);\n\n return this.visit('/').then(() => {\n let rootElement = document.getElementById('qunit-fixture');\n rootElement.querySelector('.do-foo').click();\n rootElement.querySelector('.do-bar-with-arg').click();\n rootElement.querySelector('.do-baz').click();\n });\n }\n\n ['@test Actions are not triggered on the controller if a matching action name is implemented as a method'](assert) {\n let done = assert.async();\n\n this.router.map(function () {\n this.route('home', { path: '/' });\n });\n\n let model = { name: 'Tom Dale' };\n let stateIsNotCalled = true;\n\n this.add('route:home', _routing.Route.extend({\n model() {\n return model;\n },\n\n actions: {\n showStuff(context) {\n assert.ok(stateIsNotCalled, 'an event on the state is not triggered');\n assert.deepEqual(context, { name: 'Tom Dale' }, 'an event with context is passed');\n done();\n }\n }\n }));\n\n this.addTemplate('home', '{{name}}');\n\n this.add('controller:home', _controller.default.extend({\n showStuff() {\n stateIsNotCalled = false;\n assert.ok(stateIsNotCalled, 'an event on the state is not triggered');\n }\n }));\n\n this.visit('/').then(() => {\n document.getElementById('qunit-fixture').querySelector('a').click();\n });\n }\n\n ['@test actions can be triggered with multiple arguments'](assert) {\n let done = assert.async();\n this.router.map(function () {\n this.route('root', { path: '/' }, function () {\n this.route('index', { path: '/' });\n });\n });\n\n let model1 = { name: 'Tilde' };\n let model2 = { name: 'Tom Dale' };\n\n let RootRoute = _routing.Route.extend({\n actions: {\n showStuff(obj1, obj2) {\n assert.ok(this instanceof RootRoute, 'the handler is an App.HomeRoute');\n assert.deepEqual(Object.assign({}, obj1), { name: 'Tilde' }, 'the first context is correct');\n assert.deepEqual(Object.assign({}, obj2), { name: 'Tom Dale' }, 'the second context is correct');\n done();\n }\n }\n });\n\n this.add('route:root', RootRoute);\n\n this.add('controller:root.index', _controller.default.extend({\n model1: model1,\n model2: model2\n }));\n\n this.addTemplate('root.index', '{{model1.name}}');\n\n this.visit('/').then(() => {\n document.getElementById('qunit-fixture').querySelector('a').click();\n });\n }\n\n ['@test transitioning multiple times in a single run loop only sets the URL once'](assert) {\n this.router.map(function () {\n this.route('root', { path: '/' });\n this.route('foo');\n this.route('bar');\n });\n\n return this.visit('/').then(() => {\n let urlSetCount = 0;\n let router = this.applicationInstance.lookup('router:main');\n\n router.get('location').setURL = function (path) {\n urlSetCount++;\n (0, _metal.set)(this, 'path', path);\n };\n\n assert.equal(urlSetCount, 0);\n\n (0, _runloop.run)(function () {\n router.transitionTo('foo');\n router.transitionTo('bar');\n });\n\n assert.equal(urlSetCount, 1);\n assert.equal(router.get('location').getURL(), '/bar');\n });\n }\n\n ['@test navigating away triggers a url property change'](assert) {\n assert.expect(3);\n\n this.router.map(function () {\n this.route('root', { path: '/' });\n this.route('foo', { path: '/foo' });\n this.route('bar', { path: '/bar' });\n });\n\n return this.visit('/').then(() => {\n let router = this.applicationInstance.lookup('router:main');\n\n (0, _metal.addObserver)(router, 'url', function () {\n assert.ok(true, 'url change event was fired');\n });\n ['foo', 'bar', '/foo'].forEach(destination => (0, _runloop.run)(router, 'transitionTo', destination));\n });\n }\n\n ['@test using replaceWith calls location.replaceURL if available'](assert) {\n let setCount = 0;\n let replaceCount = 0;\n this.router.reopen({\n location: _routing.NoneLocation.create({\n setURL(path) {\n setCount++;\n (0, _metal.set)(this, 'path', path);\n },\n\n replaceURL(path) {\n replaceCount++;\n (0, _metal.set)(this, 'path', path);\n }\n })\n });\n\n this.router.map(function () {\n this.route('root', { path: '/' });\n this.route('foo');\n });\n\n return this.visit('/').then(() => {\n let router = this.applicationInstance.lookup('router:main');\n assert.equal(setCount, 1);\n assert.equal(replaceCount, 0);\n\n (0, _runloop.run)(() => router.replaceWith('foo'));\n\n assert.equal(setCount, 1, 'should not call setURL');\n assert.equal(replaceCount, 1, 'should call replaceURL once');\n assert.equal(router.get('location').getURL(), '/foo');\n });\n }\n\n ['@test using replaceWith calls setURL if location.replaceURL is not defined'](assert) {\n let setCount = 0;\n\n this.router.reopen({\n location: _routing.NoneLocation.create({\n setURL(path) {\n setCount++;\n (0, _metal.set)(this, 'path', path);\n }\n })\n });\n\n this.router.map(function () {\n this.route('root', { path: '/' });\n this.route('foo');\n });\n\n return this.visit('/').then(() => {\n let router = this.applicationInstance.lookup('router:main');\n\n assert.equal(setCount, 1);\n (0, _runloop.run)(() => router.replaceWith('foo'));\n assert.equal(setCount, 2, 'should call setURL once');\n assert.equal(router.get('location').getURL(), '/foo');\n });\n }\n\n ['@test Route inherits model from parent route'](assert) {\n assert.expect(9);\n\n this.router.map(function () {\n this.route('the-post', { path: '/posts/:post_id' }, function () {\n this.route('comments');\n\n this.route('shares', { path: '/shares/:share_id', resetNamespace: true }, function () {\n this.route('share');\n });\n });\n });\n\n let post1 = {};\n let post2 = {};\n let post3 = {};\n let share1 = {};\n let share2 = {};\n let share3 = {};\n\n let posts = {\n 1: post1,\n 2: post2,\n 3: post3\n };\n let shares = {\n 1: share1,\n 2: share2,\n 3: share3\n };\n\n this.add('route:the-post', _routing.Route.extend({\n model(params) {\n return posts[params.post_id];\n }\n }));\n\n this.add('route:the-post.comments', _routing.Route.extend({\n afterModel(post /*, transition */) {\n let parent_model = this.modelFor('the-post');\n\n assert.equal(post, parent_model);\n }\n }));\n\n this.add('route:shares', _routing.Route.extend({\n model(params) {\n return shares[params.share_id];\n }\n }));\n\n this.add('route:shares.share', _routing.Route.extend({\n afterModel(share /*, transition */) {\n let parent_model = this.modelFor('shares');\n\n assert.equal(share, parent_model);\n }\n }));\n\n return this.visit('/posts/1/comments').then(() => {\n assert.ok(true, 'url: /posts/1/comments was handled');\n return this.visit('/posts/1/shares/1');\n }).then(() => {\n assert.ok(true, 'url: /posts/1/shares/1 was handled');\n return this.visit('/posts/2/comments');\n }).then(() => {\n assert.ok(true, 'url: /posts/2/comments was handled');\n return this.visit('/posts/2/shares/2');\n }).then(() => {\n assert.ok(true, 'url: /posts/2/shares/2 was handled');\n return this.visit('/posts/3/comments');\n }).then(() => {\n assert.ok(true, 'url: /posts/3/shares was handled');\n return this.visit('/posts/3/shares/3');\n }).then(() => {\n assert.ok(true, 'url: /posts/3/shares/3 was handled');\n });\n }\n\n ['@test Routes with { resetNamespace: true } inherits model from parent route'](assert) {\n assert.expect(6);\n\n this.router.map(function () {\n this.route('the-post', { path: '/posts/:post_id' }, function () {\n this.route('comments', { resetNamespace: true }, function () {});\n });\n });\n\n let post1 = {};\n let post2 = {};\n let post3 = {};\n\n let posts = {\n 1: post1,\n 2: post2,\n 3: post3\n };\n\n this.add('route:the-post', _routing.Route.extend({\n model(params) {\n return posts[params.post_id];\n }\n }));\n\n this.add('route:comments', _routing.Route.extend({\n afterModel(post /*, transition */) {\n let parent_model = this.modelFor('the-post');\n\n assert.equal(post, parent_model);\n }\n }));\n\n return this.visit('/posts/1/comments').then(() => {\n assert.ok(true, '/posts/1/comments');\n return this.visit('/posts/2/comments');\n }).then(() => {\n assert.ok(true, '/posts/2/comments');\n return this.visit('/posts/3/comments');\n }).then(() => {\n assert.ok(true, '/posts/3/comments');\n });\n }\n\n ['@test It is possible to get the model from a parent route'](assert) {\n assert.expect(6);\n\n this.router.map(function () {\n this.route('the-post', { path: '/posts/:post_id' }, function () {\n this.route('comments', { resetNamespace: true });\n });\n });\n\n let post1 = {};\n let post2 = {};\n let post3 = {};\n let currentPost;\n\n let posts = {\n 1: post1,\n 2: post2,\n 3: post3\n };\n\n this.add('route:the-post', _routing.Route.extend({\n model(params) {\n return posts[params.post_id];\n }\n }));\n\n this.add('route:comments', _routing.Route.extend({\n model() {\n assert.equal(this.modelFor('the-post'), currentPost);\n }\n }));\n\n currentPost = post1;\n return this.visit('/posts/1/comments').then(() => {\n assert.ok(true, '/posts/1/comments has been handled');\n currentPost = post2;\n return this.visit('/posts/2/comments');\n }).then(() => {\n assert.ok(true, '/posts/2/comments has been handled');\n currentPost = post3;\n return this.visit('/posts/3/comments');\n }).then(() => {\n assert.ok(true, '/posts/3/comments has been handled');\n });\n }\n\n ['@test A redirection hook is provided'](assert) {\n this.router.map(function () {\n this.route('choose', { path: '/' });\n this.route('home');\n });\n\n let chooseFollowed = 0;\n let destination = 'home';\n\n this.add('route:choose', _routing.Route.extend({\n redirect() {\n if (destination) {\n this.transitionTo(destination);\n }\n },\n\n setupController() {\n chooseFollowed++;\n }\n }));\n\n return this.visit('/').then(() => {\n let rootElement = document.getElementById('qunit-fixture');\n assert.equal(chooseFollowed, 0, \"The choose route wasn't entered since a transition occurred\");\n assert.equal(rootElement.querySelectorAll('h3.hours').length, 1, 'The home template was rendered');\n assert.equal(this.applicationInstance.lookup('controller:application').get('currentPath'), 'home');\n });\n }\n\n ['@test Redirecting from the middle of a route aborts the remainder of the routes'](assert) {\n assert.expect(3);\n\n this.router.map(function () {\n this.route('home');\n this.route('foo', function () {\n this.route('bar', { resetNamespace: true }, function () {\n this.route('baz');\n });\n });\n });\n\n this.add('route:bar', _routing.Route.extend({\n redirect() {\n this.transitionTo('home');\n },\n setupController() {\n assert.ok(false, 'Should transition before setupController');\n }\n }));\n\n this.add('route:bar-baz', _routing.Route.extend({\n enter() {\n assert.ok(false, 'Should abort transition getting to next route');\n }\n }));\n\n return this.visit('/').then(() => {\n let router = this.applicationInstance.lookup('router:main');\n this.handleURLAborts(assert, '/foo/bar/baz');\n assert.equal(this.applicationInstance.lookup('controller:application').get('currentPath'), 'home');\n assert.equal(router.get('location').getURL(), '/home');\n });\n }\n\n ['@test Redirecting to the current target in the middle of a route does not abort initial routing'](assert) {\n assert.expect(5);\n\n this.router.map(function () {\n this.route('home');\n this.route('foo', function () {\n this.route('bar', { resetNamespace: true }, function () {\n this.route('baz');\n });\n });\n });\n\n let successCount = 0;\n\n this.add('route:bar', _routing.Route.extend({\n redirect() {\n return this.transitionTo('bar.baz').then(function () {\n successCount++;\n });\n },\n\n setupController() {\n assert.ok(true, \"Should still invoke bar's setupController\");\n }\n }));\n\n this.add('route:bar.baz', _routing.Route.extend({\n setupController() {\n assert.ok(true, \"Should still invoke bar.baz's setupController\");\n }\n }));\n\n return this.visit('/foo/bar/baz').then(() => {\n assert.ok(true, '/foo/bar/baz has been handled');\n assert.equal(this.applicationInstance.lookup('controller:application').get('currentPath'), 'foo.bar.baz');\n assert.equal(successCount, 1, 'transitionTo success handler was called once');\n });\n }\n\n ['@test Redirecting to the current target with a different context aborts the remainder of the routes'](assert) {\n assert.expect(4);\n\n this.router.map(function () {\n this.route('home');\n this.route('foo', function () {\n this.route('bar', { path: 'bar/:id', resetNamespace: true }, function () {\n this.route('baz');\n });\n });\n });\n\n let model = { id: 2 };\n\n let count = 0;\n\n this.add('route:bar', _routing.Route.extend({\n afterModel() {\n if (count++ > 10) {\n assert.ok(false, 'infinite loop');\n } else {\n this.transitionTo('bar.baz', model);\n }\n }\n }));\n\n this.add('route:bar.baz', _routing.Route.extend({\n setupController() {\n assert.ok(true, 'Should still invoke setupController');\n }\n }));\n\n return this.visit('/').then(() => {\n this.handleURLAborts(assert, '/foo/bar/1/baz');\n assert.equal(this.applicationInstance.lookup('controller:application').get('currentPath'), 'foo.bar.baz');\n assert.equal(this.applicationInstance.lookup('router:main').get('location').getURL(), '/foo/bar/2/baz');\n });\n }\n\n ['@test Transitioning from a parent event does not prevent currentPath from being set'](assert) {\n this.router.map(function () {\n this.route('foo', function () {\n this.route('bar', { resetNamespace: true }, function () {\n this.route('baz');\n });\n this.route('qux');\n });\n });\n\n this.add('route:foo', _routing.Route.extend({\n actions: {\n goToQux() {\n this.transitionTo('foo.qux');\n }\n }\n }));\n\n return this.visit('/foo/bar/baz').then(() => {\n assert.ok(true, '/foo/bar/baz has been handled');\n let applicationController = this.applicationInstance.lookup('controller:application');\n let router = this.applicationInstance.lookup('router:main');\n assert.equal(applicationController.get('currentPath'), 'foo.bar.baz');\n (0, _runloop.run)(() => router.send('goToQux'));\n assert.equal(applicationController.get('currentPath'), 'foo.qux');\n assert.equal(router.get('location').getURL(), '/foo/qux');\n });\n }\n\n ['@test Generated names can be customized when providing routes with dot notation'](assert) {\n assert.expect(4);\n\n this.addTemplate('index', '
Index
');\n this.addTemplate('application', \"
Home
{{outlet}}
\");\n this.addTemplate('foo', \"
{{outlet}}
\");\n this.addTemplate('bar', \"
{{outlet}}
\");\n this.addTemplate('bar.baz', '
{{name}}Bottom!
');\n\n this.router.map(function () {\n this.route('foo', { path: '/top' }, function () {\n this.route('bar', { path: '/middle', resetNamespace: true }, function () {\n this.route('baz', { path: '/bottom' });\n });\n });\n });\n\n this.add('route:foo', _routing.Route.extend({\n renderTemplate() {\n assert.ok(true, 'FooBarRoute was called');\n return this._super(...arguments);\n }\n }));\n\n this.add('route:bar.baz', _routing.Route.extend({\n renderTemplate() {\n assert.ok(true, 'BarBazRoute was called');\n return this._super(...arguments);\n }\n }));\n\n this.add('controller:bar', _controller.default.extend({\n name: 'Bar'\n }));\n\n this.add('controller:bar.baz', _controller.default.extend({\n name: 'BarBaz'\n }));\n\n return this.visit('/top/middle/bottom').then(() => {\n assert.ok(true, '/top/middle/bottom has been handled');\n let rootElement = document.getElementById('qunit-fixture');\n assert.equal((0, _internalTestHelpers.getTextOf)(rootElement.querySelector('.main .middle .bottom p')), 'BarBazBottom!', 'The templates were rendered into their appropriate parents');\n });\n }\n\n [\"@test Child routes render into their parent route's template by default\"](assert) {\n this.addTemplate('index', '
Index
');\n this.addTemplate('application', \"
Home
{{outlet}}
\");\n this.addTemplate('top', \"
{{outlet}}
\");\n this.addTemplate('middle', \"
{{outlet}}
\");\n this.addTemplate('middle.bottom', '
Bottom!
');\n\n this.router.map(function () {\n this.route('top', function () {\n this.route('middle', { resetNamespace: true }, function () {\n this.route('bottom');\n });\n });\n });\n\n return this.visit('/top/middle/bottom').then(() => {\n assert.ok(true, '/top/middle/bottom has been handled');\n let rootElement = document.getElementById('qunit-fixture');\n assert.equal((0, _internalTestHelpers.getTextOf)(rootElement.querySelector('.main .middle .bottom p')), 'Bottom!', 'The templates were rendered into their appropriate parents');\n });\n }\n\n ['@test Child routes render into specified template'](assert) {\n this.addTemplate('index', '
Index
');\n this.addTemplate('application', \"
Home
{{outlet}}
\");\n this.addTemplate('top', \"
{{outlet}}
\");\n this.addTemplate('middle', \"
{{outlet}}
\");\n this.addTemplate('middle.bottom', '
Bottom!
');\n\n this.router.map(function () {\n this.route('top', function () {\n this.route('middle', { resetNamespace: true }, function () {\n this.route('bottom');\n });\n });\n });\n\n this.add('route:middle.bottom', _routing.Route.extend({\n renderTemplate() {\n this.render('middle/bottom', { into: 'top' });\n }\n }));\n\n return this.visit('/top/middle/bottom').then(() => {\n assert.ok(true, '/top/middle/bottom has been handled');\n let rootElement = document.getElementById('qunit-fixture');\n assert.equal(rootElement.querySelectorAll('.main .middle .bottom p').length, 0, 'should not render into the middle template');\n assert.equal((0, _internalTestHelpers.getTextOf)(rootElement.querySelector('.main .middle > p')), 'Bottom!', 'The template was rendered into the top template');\n });\n }\n\n ['@test Rendering into specified template with slash notation'](assert) {\n this.addTemplate('person.profile', 'profile {{outlet}}');\n this.addTemplate('person.details', 'details!');\n\n this.router.map(function () {\n this.route('home', { path: '/' });\n });\n\n this.add('route:home', _routing.Route.extend({\n renderTemplate() {\n this.render('person/profile');\n this.render('person/details', { into: 'person/profile' });\n }\n }));\n\n return this.visit('/').then(() => {\n let rootElement = document.getElementById('qunit-fixture');\n assert.equal(rootElement.textContent.trim(), 'profile details!', 'The templates were rendered');\n });\n }\n\n ['@test Parent route context change'](assert) {\n let editCount = 0;\n let editedPostIds = (0, _runtime.A)();\n\n this.addTemplate('application', '{{outlet}}');\n this.addTemplate('posts', '{{outlet}}');\n this.addTemplate('post', '{{outlet}}');\n this.addTemplate('post/index', 'showing');\n this.addTemplate('post/edit', 'editing');\n\n this.router.map(function () {\n this.route('posts', function () {\n this.route('post', { path: '/:postId', resetNamespace: true }, function () {\n this.route('edit');\n });\n });\n });\n\n this.add('route:posts', _routing.Route.extend({\n actions: {\n showPost(context) {\n this.transitionTo('post', context);\n }\n }\n }));\n\n this.add('route:post', _routing.Route.extend({\n model(params) {\n return { id: params.postId };\n },\n\n serialize(model) {\n return { postId: model.id };\n },\n\n actions: {\n editPost() {\n this.transitionTo('post.edit');\n }\n }\n }));\n\n this.add('route:post.edit', _routing.Route.extend({\n model() {\n let postId = this.modelFor('post').id;\n editedPostIds.push(postId);\n return null;\n },\n setup() {\n this._super(...arguments);\n editCount++;\n }\n }));\n\n return this.visit('/posts/1').then(() => {\n assert.ok(true, '/posts/1 has been handled');\n let router = this.applicationInstance.lookup('router:main');\n (0, _runloop.run)(() => router.send('editPost'));\n (0, _runloop.run)(() => router.send('showPost', { id: '2' }));\n (0, _runloop.run)(() => router.send('editPost'));\n assert.equal(editCount, 2, 'set up the edit route twice without failure');\n assert.deepEqual(editedPostIds, ['1', '2'], 'modelFor posts.post returns the right context');\n });\n }\n\n ['@test Router accounts for rootURL on page load when using history location'](assert) {\n let rootURL = window.location.pathname + '/app';\n let postsTemplateRendered = false;\n let setHistory;\n\n setHistory = function (obj, path) {\n obj.set('history', { state: { path: path } });\n };\n\n let location = _routing.HistoryLocation.create({\n initState() {\n let path = rootURL + '/posts';\n\n setHistory(this, path);\n this.set('location', {\n pathname: path,\n href: 'http://localhost/' + path\n });\n },\n\n replaceState(path) {\n setHistory(this, path);\n },\n\n pushState(path) {\n setHistory(this, path);\n }\n });\n\n this.router.reopen({\n // location: 'historyTest',\n location,\n rootURL: rootURL\n });\n\n this.router.map(function () {\n this.route('posts', { path: '/posts' });\n });\n\n this.add('route:posts', _routing.Route.extend({\n model() {},\n renderTemplate() {\n postsTemplateRendered = true;\n }\n }));\n\n return this.visit('/').then(() => {\n assert.ok(postsTemplateRendered, 'Posts route successfully stripped from rootURL');\n\n (0, _internalTestHelpers.runDestroy)(location);\n location = null;\n });\n }\n\n ['@test The rootURL is passed properly to the location implementation'](assert) {\n assert.expect(1);\n let rootURL = '/blahzorz';\n this.add('location:history-test', _routing.HistoryLocation.extend({\n rootURL: 'this is not the URL you are looking for',\n history: {\n pushState() {}\n },\n initState() {\n assert.equal(this.get('rootURL'), rootURL);\n }\n }));\n\n this.router.reopen({\n location: 'history-test',\n rootURL: rootURL,\n // if we transition in this test we will receive failures\n // if the tests are run from a static file\n _doURLTransition() {\n return _rsvp.default.resolve('');\n }\n });\n\n return this.visit('/');\n }\n\n ['@test Only use route rendered into main outlet for default into property on child'](assert) {\n this.addTemplate('application', \"{{outlet 'menu'}}{{outlet}}\");\n this.addTemplate('posts', '{{outlet}}');\n this.addTemplate('posts.index', '
postsIndex
');\n this.addTemplate('posts.menu', '
postsMenu
');\n\n this.router.map(function () {\n this.route('posts', function () {});\n });\n\n this.add('route:posts', _routing.Route.extend({\n renderTemplate() {\n this.render();\n this.render('posts/menu', {\n into: 'application',\n outlet: 'menu'\n });\n }\n }));\n\n return this.visit('/posts').then(() => {\n assert.ok(true, '/posts has been handled');\n let rootElement = document.getElementById('qunit-fixture');\n assert.equal((0, _internalTestHelpers.getTextOf)(rootElement.querySelector('div.posts-menu')), 'postsMenu', 'The posts/menu template was rendered');\n assert.equal((0, _internalTestHelpers.getTextOf)(rootElement.querySelector('p.posts-index')), 'postsIndex', 'The posts/index template was rendered');\n });\n }\n\n ['@test Generating a URL should not affect currentModel'](assert) {\n this.router.map(function () {\n this.route('post', { path: '/posts/:post_id' });\n });\n\n let posts = {\n 1: { id: 1 },\n 2: { id: 2 }\n };\n\n this.add('route:post', _routing.Route.extend({\n model(params) {\n return posts[params.post_id];\n }\n }));\n\n return this.visit('/posts/1').then(() => {\n assert.ok(true, '/posts/1 has been handled');\n\n let route = this.applicationInstance.lookup('route:post');\n assert.equal(route.modelFor('post'), posts[1]);\n\n let url = this.applicationInstance.lookup('router:main').generate('post', posts[2]);\n assert.equal(url, '/posts/2');\n assert.equal(route.modelFor('post'), posts[1]);\n });\n }\n\n [\"@test Nested index route is not overridden by parent's implicit index route\"](assert) {\n this.router.map(function () {\n this.route('posts', function () {\n this.route('index', { path: ':category' });\n });\n });\n\n return this.visit('/').then(() => {\n let router = this.applicationInstance.lookup('router:main');\n return router.transitionTo('posts', { category: 'emberjs' });\n }).then(() => {\n let router = this.applicationInstance.lookup('router:main');\n assert.deepEqual(router.location.path, '/posts/emberjs');\n });\n }\n\n ['@test Application template does not duplicate when re-rendered'](assert) {\n this.addTemplate('application', '
I render once
{{outlet}}');\n\n this.router.map(function () {\n this.route('posts');\n });\n\n this.add('route:application', _routing.Route.extend({\n model() {\n return (0, _runtime.A)();\n }\n }));\n\n return this.visit('/posts').then(() => {\n assert.ok(true, '/posts has been handled');\n let rootElement = document.getElementById('qunit-fixture');\n assert.equal((0, _internalTestHelpers.getTextOf)(rootElement.querySelector('h3.render-once')), 'I render once');\n });\n }\n\n ['@test Child routes should render inside the application template if the application template causes a redirect'](assert) {\n this.addTemplate('application', '
');\n\n let rootElement = document.getElementById('qunit-fixture');\n return this.visit('/page/first').then(() => {\n assert.ok(true, '/page/first has been handled');\n assert.equal((0, _internalTestHelpers.getTextOf)(rootElement.querySelector('p')), 'first');\n assert.equal(insertionCount, 1);\n return this.visit('/page/second');\n }).then(() => {\n assert.ok(true, '/page/second has been handled');\n assert.equal((0, _internalTestHelpers.getTextOf)(rootElement.querySelector('p')), 'second');\n assert.equal(insertionCount, 1, 'view should have inserted only once');\n let router = this.applicationInstance.lookup('router:main');\n return (0, _runloop.run)(() => router.transitionTo('page', _runtime.Object.create({ name: 'third' })));\n }).then(() => {\n assert.equal((0, _internalTestHelpers.getTextOf)(rootElement.querySelector('p')), 'third');\n assert.equal(insertionCount, 1, 'view should still have inserted only once');\n });\n }\n\n ['@test The template is not re-rendered when two routes present the exact same template & controller'](assert) {\n this.router.map(function () {\n this.route('first');\n this.route('second');\n this.route('third');\n this.route('fourth');\n });\n\n // Note add a component to test insertion\n\n let insertionCount = 0;\n this.add('component:x-input', _glimmer.Component.extend({\n didInsertElement() {\n insertionCount += 1;\n }\n }));\n\n let SharedRoute = _routing.Route.extend({\n setupController() {\n this.controllerFor('shared').set('message', 'This is the ' + this.routeName + ' message');\n },\n\n renderTemplate() {\n this.render('shared', { controller: 'shared' });\n }\n });\n\n this.add('route:shared', SharedRoute);\n this.add('route:first', SharedRoute.extend());\n this.add('route:second', SharedRoute.extend());\n this.add('route:third', SharedRoute.extend());\n this.add('route:fourth', SharedRoute.extend());\n\n this.add('controller:shared', _controller.default.extend());\n\n this.addTemplate('shared', '
{{message}}{{x-input}}
');\n\n let rootElement = document.getElementById('qunit-fixture');\n return this.visit('/first').then(() => {\n assert.ok(true, '/first has been handled');\n assert.equal((0, _internalTestHelpers.getTextOf)(rootElement.querySelector('p')), 'This is the first message');\n assert.equal(insertionCount, 1, 'expected one assertion');\n return this.visit('/second');\n }).then(() => {\n assert.ok(true, '/second has been handled');\n assert.equal((0, _internalTestHelpers.getTextOf)(rootElement.querySelector('p')), 'This is the second message');\n assert.equal(insertionCount, 1, 'expected one assertion');\n return (0, _runloop.run)(() => {\n this.applicationInstance.lookup('router:main').transitionTo('third').then(function () {\n assert.ok(true, 'expected transition');\n }, function (reason) {\n assert.ok(false, 'unexpected transition failure: ', QUnit.jsDump.parse(reason));\n });\n });\n }).then(() => {\n assert.equal((0, _internalTestHelpers.getTextOf)(rootElement.querySelector('p')), 'This is the third message');\n assert.equal(insertionCount, 1, 'expected one assertion');\n return this.visit('fourth');\n }).then(() => {\n assert.ok(true, '/fourth has been handled');\n assert.equal(insertionCount, 1, 'expected one assertion');\n assert.equal((0, _internalTestHelpers.getTextOf)(rootElement.querySelector('p')), 'This is the fourth message');\n });\n }\n\n ['@test ApplicationRoute with model does not proxy the currentPath'](assert) {\n let model = {};\n let currentPath;\n\n this.router.map(function () {\n this.route('index', { path: '/' });\n });\n\n this.add('route:application', _routing.Route.extend({\n model() {\n return model;\n }\n }));\n\n this.add('controller:application', _controller.default.extend({\n currentPathDidChange: (0, _metal.observer)('currentPath', function () {\n currentPath = this.currentPath;\n })\n }));\n\n return this.visit('/').then(() => {\n assert.equal(currentPath, 'index', 'currentPath is index');\n assert.equal('currentPath' in model, false, 'should have defined currentPath on controller');\n });\n }\n\n ['@test Promises encountered on app load put app into loading state until resolved'](assert) {\n assert.expect(2);\n\n let deferred = _rsvp.default.defer();\n this.router.map(function () {\n this.route('index', { path: '/' });\n });\n\n this.add('route:index', _routing.Route.extend({\n model() {\n return deferred.promise;\n }\n }));\n\n this.addTemplate('index', '
INDEX
');\n this.addTemplate('loading', '
LOADING
');\n\n (0, _runloop.run)(() => this.visit('/'));\n let rootElement = document.getElementById('qunit-fixture');\n assert.equal((0, _internalTestHelpers.getTextOf)(rootElement.querySelector('p')), 'LOADING', 'The loading state is displaying.');\n (0, _runloop.run)(deferred.resolve);\n assert.equal((0, _internalTestHelpers.getTextOf)(rootElement.querySelector('p')), 'INDEX', 'The index route is display.');\n }\n\n ['@test Route should tear down multiple outlets'](assert) {\n this.addTemplate('application', \"{{outlet 'menu'}}{{outlet}}{{outlet 'footer'}}\");\n this.addTemplate('posts', '{{outlet}}');\n this.addTemplate('users', 'users');\n this.addTemplate('posts.index', '
postsIndex
');\n this.addTemplate('posts.menu', '
postsMenu
');\n this.addTemplate('posts.footer', '');\n\n this.router.map(function () {\n this.route('posts', function () {});\n this.route('users', function () {});\n });\n\n this.add('route:posts', _routing.Route.extend({\n renderTemplate() {\n this.render('posts/menu', {\n into: 'application',\n outlet: 'menu'\n });\n\n this.render();\n\n this.render('posts/footer', {\n into: 'application',\n outlet: 'footer'\n });\n }\n }));\n\n let rootElement = document.getElementById('qunit-fixture');\n return this.visit('/posts').then(() => {\n assert.ok(true, '/posts has been handled');\n assert.equal((0, _internalTestHelpers.getTextOf)(rootElement.querySelector('div.posts-menu')), 'postsMenu', 'The posts/menu template was rendered');\n assert.equal((0, _internalTestHelpers.getTextOf)(rootElement.querySelector('p.posts-index')), 'postsIndex', 'The posts/index template was rendered');\n assert.equal((0, _internalTestHelpers.getTextOf)(rootElement.querySelector('div.posts-footer')), 'postsFooter', 'The posts/footer template was rendered');\n\n return this.visit('/users');\n }).then(() => {\n assert.ok(true, '/users has been handled');\n assert.equal(rootElement.querySelector('div.posts-menu'), null, 'The posts/menu template was removed');\n assert.equal(rootElement.querySelector('p.posts-index'), null, 'The posts/index template was removed');\n assert.equal(rootElement.querySelector('div.posts-footer'), null, 'The posts/footer template was removed');\n });\n }\n\n ['@test Route supports clearing outlet explicitly'](assert) {\n this.addTemplate('application', \"{{outlet}}{{outlet 'modal'}}\");\n this.addTemplate('posts', '{{outlet}}');\n this.addTemplate('users', 'users');\n this.addTemplate('posts.index', '
postsIndex {{outlet}}
');\n this.addTemplate('posts.modal', '
postsModal
');\n this.addTemplate('posts.extra', '
postsExtra
');\n\n this.router.map(function () {\n this.route('posts', function () {});\n this.route('users', function () {});\n });\n\n this.add('route:posts', _routing.Route.extend({\n actions: {\n showModal() {\n this.render('posts/modal', {\n into: 'application',\n outlet: 'modal'\n });\n },\n hideModal() {\n this.disconnectOutlet({\n outlet: 'modal',\n parentView: 'application'\n });\n }\n }\n }));\n\n this.add('route:posts.index', _routing.Route.extend({\n actions: {\n showExtra() {\n this.render('posts/extra', {\n into: 'posts/index'\n });\n },\n hideExtra() {\n this.disconnectOutlet({ parentView: 'posts/index' });\n }\n }\n }));\n\n let rootElement = document.getElementById('qunit-fixture');\n\n return this.visit('/posts').then(() => {\n let router = this.applicationInstance.lookup('router:main');\n\n assert.equal((0, _internalTestHelpers.getTextOf)(rootElement.querySelector('div.posts-index')), 'postsIndex', 'The posts/index template was rendered');\n (0, _runloop.run)(() => router.send('showModal'));\n assert.equal((0, _internalTestHelpers.getTextOf)(rootElement.querySelector('div.posts-modal')), 'postsModal', 'The posts/modal template was rendered');\n (0, _runloop.run)(() => router.send('showExtra'));\n\n assert.equal((0, _internalTestHelpers.getTextOf)(rootElement.querySelector('div.posts-extra')), 'postsExtra', 'The posts/extra template was rendered');\n (0, _runloop.run)(() => router.send('hideModal'));\n\n assert.equal(rootElement.querySelector('div.posts-modal'), null, 'The posts/modal template was removed');\n (0, _runloop.run)(() => router.send('hideExtra'));\n\n assert.equal(rootElement.querySelector('div.posts-extra'), null, 'The posts/extra template was removed');\n (0, _runloop.run)(function () {\n router.send('showModal');\n });\n assert.equal((0, _internalTestHelpers.getTextOf)(rootElement.querySelector('div.posts-modal')), 'postsModal', 'The posts/modal template was rendered');\n (0, _runloop.run)(function () {\n router.send('showExtra');\n });\n assert.equal((0, _internalTestHelpers.getTextOf)(rootElement.querySelector('div.posts-extra')), 'postsExtra', 'The posts/extra template was rendered');\n return this.visit('/users');\n }).then(() => {\n assert.equal(rootElement.querySelector('div.posts-index'), null, 'The posts/index template was removed');\n assert.equal(rootElement.querySelector('div.posts-modal'), null, 'The posts/modal template was removed');\n assert.equal(rootElement.querySelector('div.posts-extra'), null, 'The posts/extra template was removed');\n });\n }\n\n ['@test Route supports clearing outlet using string parameter'](assert) {\n this.addTemplate('application', \"{{outlet}}{{outlet 'modal'}}\");\n this.addTemplate('posts', '{{outlet}}');\n this.addTemplate('users', 'users');\n this.addTemplate('posts.index', '
postsIndex {{outlet}}
');\n this.addTemplate('posts.modal', '
postsModal
');\n\n this.router.map(function () {\n this.route('posts', function () {});\n this.route('users', function () {});\n });\n\n this.add('route:posts', _routing.Route.extend({\n actions: {\n showModal() {\n this.render('posts/modal', {\n into: 'application',\n outlet: 'modal'\n });\n },\n hideModal() {\n this.disconnectOutlet('modal');\n }\n }\n }));\n\n let rootElement = document.getElementById('qunit-fixture');\n return this.visit('/posts').then(() => {\n let router = this.applicationInstance.lookup('router:main');\n assert.equal((0, _internalTestHelpers.getTextOf)(rootElement.querySelector('div.posts-index')), 'postsIndex', 'The posts/index template was rendered');\n (0, _runloop.run)(() => router.send('showModal'));\n assert.equal((0, _internalTestHelpers.getTextOf)(rootElement.querySelector('div.posts-modal')), 'postsModal', 'The posts/modal template was rendered');\n (0, _runloop.run)(() => router.send('hideModal'));\n assert.equal(rootElement.querySelector('div.posts-modal'), null, 'The posts/modal template was removed');\n return this.visit('/users');\n }).then(() => {\n assert.equal(rootElement.querySelector('div.posts-index'), null, 'The posts/index template was removed');\n assert.equal(rootElement.querySelector('div.posts-modal'), null, 'The posts/modal template was removed');\n });\n }\n\n ['@test Route silently fails when cleaning an outlet from an inactive view'](assert) {\n assert.expect(1); // handleURL\n\n this.addTemplate('application', '{{outlet}}');\n this.addTemplate('posts', \"{{outlet 'modal'}}\");\n this.addTemplate('modal', 'A Yo.');\n\n this.router.map(function () {\n this.route('posts');\n });\n\n this.add('route:posts', _routing.Route.extend({\n actions: {\n hideSelf() {\n this.disconnectOutlet({\n outlet: 'main',\n parentView: 'application'\n });\n },\n showModal() {\n this.render('modal', { into: 'posts', outlet: 'modal' });\n },\n hideModal() {\n this.disconnectOutlet({ outlet: 'modal', parentView: 'posts' });\n }\n }\n }));\n\n return this.visit('/posts').then(() => {\n assert.ok(true, '/posts has been handled');\n let router = this.applicationInstance.lookup('router:main');\n (0, _runloop.run)(() => router.send('showModal'));\n (0, _runloop.run)(() => router.send('hideSelf'));\n (0, _runloop.run)(() => router.send('hideModal'));\n });\n }\n\n ['@test Router `willTransition` hook passes in cancellable transition'](assert) {\n // Should hit willTransition 3 times, once for the initial route, and then 2 more times\n // for the two handleURL calls below\n if (true /* EMBER_ROUTING_ROUTER_SERVICE */) {\n assert.expect(7);\n\n this.router.reopen({\n init() {\n this._super(...arguments);\n this.on('routeWillChange', transition => {\n assert.ok(true, 'routeWillChange was called');\n if (transition.intent && transition.intent.url !== '/') {\n transition.abort();\n }\n });\n }\n });\n } else {\n assert.expect(5);\n this.router.reopen({\n willTransition(_, _2, transition) {\n assert.ok(true, 'willTransition was called');\n if (transition.intent.url !== '/') {\n transition.abort();\n }\n }\n });\n }\n\n this.router.map(function () {\n this.route('nork');\n this.route('about');\n });\n\n this.add('route:loading', _routing.Route.extend({\n activate() {\n assert.ok(false, 'LoadingRoute was not entered');\n }\n }));\n\n this.add('route:nork', _routing.Route.extend({\n activate() {\n assert.ok(false, 'NorkRoute was not entered');\n }\n }));\n\n this.add('route:about', _routing.Route.extend({\n activate() {\n assert.ok(false, 'AboutRoute was not entered');\n }\n }));\n\n return this.visit('/').then(() => {\n this.handleURLAborts(assert, '/nork');\n this.handleURLAborts(assert, '/about');\n });\n }\n\n ['@test Aborting/redirecting the transition in `willTransition` prevents LoadingRoute from being entered'](assert) {\n assert.expect(5);\n\n this.router.map(function () {\n this.route('index');\n this.route('nork');\n this.route('about');\n });\n\n let redirect = false;\n\n this.add('route:index', _routing.Route.extend({\n actions: {\n willTransition(transition) {\n assert.ok(true, 'willTransition was called');\n if (redirect) {\n // router.js won't refire `willTransition` for this redirect\n this.transitionTo('about');\n } else {\n transition.abort();\n }\n }\n }\n }));\n\n let deferred = null;\n\n this.add('route:loading', _routing.Route.extend({\n activate() {\n assert.ok(deferred, 'LoadingRoute should be entered at this time');\n },\n deactivate() {\n assert.ok(true, 'LoadingRoute was exited');\n }\n }));\n\n this.add('route:nork', _routing.Route.extend({\n activate() {\n assert.ok(true, 'NorkRoute was entered');\n }\n }));\n\n this.add('route:about', _routing.Route.extend({\n activate() {\n assert.ok(true, 'AboutRoute was entered');\n },\n model() {\n if (deferred) {\n return deferred.promise;\n }\n }\n }));\n\n return this.visit('/').then(() => {\n let router = this.applicationInstance.lookup('router:main');\n // Attempted transitions out of index should abort.\n (0, _runloop.run)(router, 'transitionTo', 'nork');\n (0, _runloop.run)(router, 'handleURL', '/nork');\n\n // Attempted transitions out of index should redirect to about\n redirect = true;\n (0, _runloop.run)(router, 'transitionTo', 'nork');\n (0, _runloop.run)(router, 'transitionTo', 'index');\n\n // Redirected transitions out of index to a route with a\n // promise model should pause the transition and\n // activate LoadingRoute\n deferred = _rsvp.default.defer();\n (0, _runloop.run)(router, 'transitionTo', 'nork');\n (0, _runloop.run)(deferred.resolve);\n });\n }\n\n ['@test `didTransition` event fires on the router'](assert) {\n assert.expect(3);\n\n this.router.map(function () {\n this.route('nork');\n });\n\n return this.visit('/').then(() => {\n let router = this.applicationInstance.lookup('router:main');\n router.one('didTransition', function () {\n assert.ok(true, 'didTransition fired on initial routing');\n });\n this.visit('/');\n }).then(() => {\n let router = this.applicationInstance.lookup('router:main');\n router.one('didTransition', function () {\n assert.ok(true, 'didTransition fired on the router');\n assert.equal(router.get('url'), '/nork', 'The url property is updated by the time didTransition fires');\n });\n\n return this.visit('/nork');\n });\n }\n\n ['@test `didTransition` can be reopened'](assert) {\n assert.expect(1);\n\n this.router.map(function () {\n this.route('nork');\n });\n if (true /* EMBER_ROUTING_ROUTER_SERVICE */) {\n assert.ok(true, 'no longer a valid test');\n return;\n } else {\n this.router.reopen({\n didTransition() {\n this._super(...arguments);\n assert.ok(true, 'reopened didTransition was called');\n }\n });\n }\n\n return this.visit('/');\n }\n\n ['@test `activate` event fires on the route'](assert) {\n assert.expect(2);\n\n let eventFired = 0;\n\n this.router.map(function () {\n this.route('nork');\n });\n\n this.add('route:nork', _routing.Route.extend({\n init() {\n this._super(...arguments);\n\n this.on('activate', function () {\n assert.equal(++eventFired, 1, 'activate event is fired once');\n });\n },\n\n activate() {\n assert.ok(true, 'activate hook is called');\n }\n }));\n\n return this.visit('/nork');\n }\n\n ['@test `deactivate` event fires on the route'](assert) {\n assert.expect(2);\n\n let eventFired = 0;\n\n this.router.map(function () {\n this.route('nork');\n this.route('dork');\n });\n\n this.add('route:nork', _routing.Route.extend({\n init() {\n this._super(...arguments);\n\n this.on('deactivate', function () {\n assert.equal(++eventFired, 1, 'deactivate event is fired once');\n });\n },\n\n deactivate() {\n assert.ok(true, 'deactivate hook is called');\n }\n }));\n\n return this.visit('/nork').then(() => this.visit('/dork'));\n }\n\n ['@test Actions can be handled by inherited action handlers'](assert) {\n assert.expect(4);\n\n let SuperRoute = _routing.Route.extend({\n actions: {\n foo() {\n assert.ok(true, 'foo');\n },\n bar(msg) {\n assert.equal(msg, 'HELLO');\n }\n }\n });\n\n let RouteMixin = _metal.Mixin.create({\n actions: {\n bar(msg) {\n assert.equal(msg, 'HELLO');\n this._super(msg);\n }\n }\n });\n\n this.add('route:home', SuperRoute.extend(RouteMixin, {\n actions: {\n baz() {\n assert.ok(true, 'baz');\n }\n }\n }));\n\n this.addTemplate('home', `\n Do foo\n Do bar with arg\n Do bar\n `);\n\n return this.visit('/').then(() => {\n let rootElement = document.getElementById('qunit-fixture');\n rootElement.querySelector('.do-foo').click();\n rootElement.querySelector('.do-bar-with-arg').click();\n rootElement.querySelector('.do-baz').click();\n });\n }\n\n ['@test transitionTo returns Transition when passed a route name'](assert) {\n assert.expect(1);\n\n this.router.map(function () {\n this.route('root', { path: '/' });\n this.route('bar');\n });\n\n return this.visit('/').then(() => {\n let router = this.applicationInstance.lookup('router:main');\n let transition = (0, _runloop.run)(() => router.transitionTo('bar'));\n assert.equal(transition instanceof _router_js.InternalTransition, true);\n });\n }\n\n ['@test transitionTo returns Transition when passed a url'](assert) {\n assert.expect(1);\n\n this.router.map(function () {\n this.route('root', { path: '/' });\n this.route('bar', function () {\n this.route('baz');\n });\n });\n\n return this.visit('/').then(() => {\n let router = this.applicationInstance.lookup('router:main');\n let transition = (0, _runloop.run)(() => router.transitionTo('/bar/baz'));\n assert.equal(transition instanceof _router_js.InternalTransition, true);\n });\n }\n\n ['@test currentRouteName is a property installed on ApplicationController that can be used in transitionTo'](assert) {\n assert.expect(24);\n\n this.router.map(function () {\n this.route('index', { path: '/' });\n this.route('be', function () {\n this.route('excellent', { resetNamespace: true }, function () {\n this.route('to', { resetNamespace: true }, function () {\n this.route('each', { resetNamespace: true }, function () {\n this.route('other');\n });\n });\n });\n });\n });\n\n return this.visit('/').then(() => {\n let appController = this.applicationInstance.lookup('controller:application');\n let router = this.applicationInstance.lookup('router:main');\n\n function transitionAndCheck(path, expectedPath, expectedRouteName) {\n if (path) {\n (0, _runloop.run)(router, 'transitionTo', path);\n }\n assert.equal(appController.get('currentPath'), expectedPath);\n assert.equal(appController.get('currentRouteName'), expectedRouteName);\n }\n\n transitionAndCheck(null, 'index', 'index');\n transitionAndCheck('/be', 'be.index', 'be.index');\n transitionAndCheck('/be/excellent', 'be.excellent.index', 'excellent.index');\n transitionAndCheck('/be/excellent/to', 'be.excellent.to.index', 'to.index');\n transitionAndCheck('/be/excellent/to/each', 'be.excellent.to.each.index', 'each.index');\n transitionAndCheck('/be/excellent/to/each/other', 'be.excellent.to.each.other', 'each.other');\n\n transitionAndCheck('index', 'index', 'index');\n transitionAndCheck('be', 'be.index', 'be.index');\n transitionAndCheck('excellent', 'be.excellent.index', 'excellent.index');\n transitionAndCheck('to.index', 'be.excellent.to.index', 'to.index');\n transitionAndCheck('each', 'be.excellent.to.each.index', 'each.index');\n transitionAndCheck('each.other', 'be.excellent.to.each.other', 'each.other');\n });\n }\n\n ['@test Route model hook finds the same model as a manual find'](assert) {\n let post;\n let Post = _runtime.Object.extend();\n this.add('model:post', Post);\n Post.reopenClass({\n find() {\n post = this;\n return {};\n }\n });\n\n this.router.map(function () {\n this.route('post', { path: '/post/:post_id' });\n });\n\n return this.visit('/post/1').then(() => {\n assert.equal(Post, post);\n });\n }\n\n ['@test Routes can refresh themselves causing their model hooks to be re-run'](assert) {\n this.router.map(function () {\n this.route('parent', { path: '/parent/:parent_id' }, function () {\n this.route('child');\n });\n });\n\n let appcount = 0;\n this.add('route:application', _routing.Route.extend({\n model() {\n ++appcount;\n }\n }));\n\n let parentcount = 0;\n this.add('route:parent', _routing.Route.extend({\n model(params) {\n assert.equal(params.parent_id, '123');\n ++parentcount;\n },\n actions: {\n refreshParent() {\n this.refresh();\n }\n }\n }));\n\n let childcount = 0;\n this.add('route:parent.child', _routing.Route.extend({\n model() {\n ++childcount;\n }\n }));\n\n let router;\n return this.visit('/').then(() => {\n router = this.applicationInstance.lookup('router:main');\n assert.equal(appcount, 1);\n assert.equal(parentcount, 0);\n assert.equal(childcount, 0);\n return (0, _runloop.run)(router, 'transitionTo', 'parent.child', '123');\n }).then(() => {\n assert.equal(appcount, 1);\n assert.equal(parentcount, 1);\n assert.equal(childcount, 1);\n return (0, _runloop.run)(router, 'send', 'refreshParent');\n }).then(() => {\n assert.equal(appcount, 1);\n assert.equal(parentcount, 2);\n assert.equal(childcount, 2);\n });\n }\n\n ['@test Specifying non-existent controller name in route#render throws'](assert) {\n assert.expect(1);\n\n this.router.map(function () {\n this.route('home', { path: '/' });\n });\n\n this.add('route:home', _routing.Route.extend({\n renderTemplate() {\n expectAssertion(() => {\n this.render('homepage', {\n controller: 'stefanpenneristhemanforme'\n });\n }, \"You passed `controller: 'stefanpenneristhemanforme'` into the `render` method, but no such controller could be found.\");\n }\n }));\n\n return this.visit('/');\n }\n\n [\"@test Redirecting with null model doesn't error out\"](assert) {\n this.router.map(function () {\n this.route('home', { path: '/' });\n this.route('about', { path: '/about/:hurhurhur' });\n });\n\n this.add('route:about', _routing.Route.extend({\n serialize: function (model) {\n if (model === null) {\n return { hurhurhur: 'TreeklesMcGeekles' };\n }\n }\n }));\n\n this.add('route:home', _routing.Route.extend({\n beforeModel() {\n this.transitionTo('about', null);\n }\n }));\n\n return this.visit('/').then(() => {\n let router = this.applicationInstance.lookup('router:main');\n assert.equal(router.get('location.path'), '/about/TreeklesMcGeekles');\n });\n }\n\n ['@test rejecting the model hooks promise with a non-error prints the `message` property'](assert) {\n assert.expect(5);\n\n let rejectedMessage = 'OMG!! SOOOOOO BAD!!!!';\n let rejectedStack = 'Yeah, buddy: stack gets printed too.';\n\n this.router.map(function () {\n this.route('yippie', { path: '/' });\n });\n\n console.error = function (initialMessage, errorMessage, errorStack) {\n assert.equal(initialMessage, 'Error while processing route: yippie', 'a message with the current route name is printed');\n assert.equal(errorMessage, rejectedMessage, \"the rejected reason's message property is logged\");\n assert.equal(errorStack, rejectedStack, \"the rejected reason's stack property is logged\");\n };\n\n this.add('route:yippie', _routing.Route.extend({\n model() {\n return _rsvp.default.reject({\n message: rejectedMessage,\n stack: rejectedStack\n });\n }\n }));\n\n return assert.throws(() => {\n return this.visit('/');\n }, function (err) {\n assert.equal(err.message, rejectedMessage);\n return true;\n }, 'expected an exception');\n }\n\n ['@test rejecting the model hooks promise with an error with `errorThrown` property prints `errorThrown.message` property'](assert) {\n assert.expect(5);\n let rejectedMessage = 'OMG!! SOOOOOO BAD!!!!';\n let rejectedStack = 'Yeah, buddy: stack gets printed too.';\n\n this.router.map(function () {\n this.route('yippie', { path: '/' });\n });\n\n console.error = function (initialMessage, errorMessage, errorStack) {\n assert.equal(initialMessage, 'Error while processing route: yippie', 'a message with the current route name is printed');\n assert.equal(errorMessage, rejectedMessage, \"the rejected reason's message property is logged\");\n assert.equal(errorStack, rejectedStack, \"the rejected reason's stack property is logged\");\n };\n\n this.add('route:yippie', _routing.Route.extend({\n model() {\n return _rsvp.default.reject({\n errorThrown: { message: rejectedMessage, stack: rejectedStack }\n });\n }\n }));\n\n assert.throws(() => this.visit('/'), function (err) {\n assert.equal(err.message, rejectedMessage);\n return true;\n }, 'expected an exception');\n }\n\n ['@test rejecting the model hooks promise with no reason still logs error'](assert) {\n assert.expect(2);\n this.router.map(function () {\n this.route('wowzers', { path: '/' });\n });\n\n console.error = function (initialMessage) {\n assert.equal(initialMessage, 'Error while processing route: wowzers', 'a message with the current route name is printed');\n };\n\n this.add('route:wowzers', _routing.Route.extend({\n model() {\n return _rsvp.default.reject();\n }\n }));\n\n return assert.throws(() => this.visit('/'));\n }\n\n ['@test rejecting the model hooks promise with a string shows a good error'](assert) {\n assert.expect(3);\n let rejectedMessage = 'Supercalifragilisticexpialidocious';\n\n this.router.map(function () {\n this.route('yondo', { path: '/' });\n });\n\n console.error = function (initialMessage, errorMessage) {\n assert.equal(initialMessage, 'Error while processing route: yondo', 'a message with the current route name is printed');\n assert.equal(errorMessage, rejectedMessage, \"the rejected reason's message property is logged\");\n };\n\n this.add('route:yondo', _routing.Route.extend({\n model() {\n return _rsvp.default.reject(rejectedMessage);\n }\n }));\n\n assert.throws(() => this.visit('/'), new RegExp(rejectedMessage), 'expected an exception');\n }\n\n [\"@test willLeave, willChangeContext, willChangeModel actions don't fire unless feature flag enabled\"](assert) {\n assert.expect(1);\n\n this.router.map(function () {\n this.route('about');\n });\n\n function shouldNotFire() {\n assert.ok(false, \"this action shouldn't have been received\");\n }\n\n this.add('route:index', _routing.Route.extend({\n actions: {\n willChangeModel: shouldNotFire,\n willChangeContext: shouldNotFire,\n willLeave: shouldNotFire\n }\n }));\n\n this.add('route:about', _routing.Route.extend({\n setupController() {\n assert.ok(true, 'about route was entered');\n }\n }));\n\n return this.visit('/about');\n }\n\n ['@test Errors in transitionTo within redirect hook are logged'](assert) {\n assert.expect(4);\n let actual = [];\n\n this.router.map(function () {\n this.route('yondo', { path: '/' });\n this.route('stink-bomb');\n });\n\n this.add('route:yondo', _routing.Route.extend({\n redirect() {\n this.transitionTo('stink-bomb', { something: 'goes boom' });\n }\n }));\n\n console.error = function () {\n // push the arguments onto an array so we can detect if the error gets logged twice\n actual.push(arguments);\n };\n\n assert.throws(() => this.visit('/'), /More context objects were passed/);\n\n assert.equal(actual.length, 1, 'the error is only logged once');\n assert.equal(actual[0][0], 'Error while processing route: yondo', 'source route is printed');\n assert.ok(actual[0][1].match(/More context objects were passed than there are dynamic segments for the route: stink-bomb/), 'the error is printed');\n }\n\n ['@test Errors in transition show error template if available'](assert) {\n this.addTemplate('error', \"
Error!
\");\n\n this.router.map(function () {\n this.route('yondo', { path: '/' });\n this.route('stink-bomb');\n });\n\n this.add('route:yondo', _routing.Route.extend({\n redirect() {\n this.transitionTo('stink-bomb', { something: 'goes boom' });\n }\n }));\n console.error = () => {};\n\n return this.visit('/').then(() => {\n let rootElement = document.querySelector('#qunit-fixture');\n assert.equal(rootElement.querySelectorAll('#error').length, 1, 'Error template was rendered.');\n });\n }\n\n ['@test Route#resetController gets fired when changing models and exiting routes'](assert) {\n assert.expect(4);\n\n this.router.map(function () {\n this.route('a', function () {\n this.route('b', { path: '/b/:id', resetNamespace: true }, function () {});\n this.route('c', { path: '/c/:id', resetNamespace: true }, function () {});\n });\n this.route('out');\n });\n\n let calls = [];\n\n let SpyRoute = _routing.Route.extend({\n setupController() /* controller, model, transition */{\n calls.push(['setup', this.routeName]);\n },\n\n resetController() /* controller */{\n calls.push(['reset', this.routeName]);\n }\n });\n\n this.add('route:a', SpyRoute.extend());\n this.add('route:b', SpyRoute.extend());\n this.add('route:c', SpyRoute.extend());\n this.add('route:out', SpyRoute.extend());\n\n let router;\n return this.visit('/').then(() => {\n router = this.applicationInstance.lookup('router:main');\n assert.deepEqual(calls, []);\n return (0, _runloop.run)(router, 'transitionTo', 'b', 'b-1');\n }).then(() => {\n assert.deepEqual(calls, [['setup', 'a'], ['setup', 'b']]);\n calls.length = 0;\n return (0, _runloop.run)(router, 'transitionTo', 'c', 'c-1');\n }).then(() => {\n assert.deepEqual(calls, [['reset', 'b'], ['setup', 'c']]);\n calls.length = 0;\n return (0, _runloop.run)(router, 'transitionTo', 'out');\n }).then(() => {\n assert.deepEqual(calls, [['reset', 'c'], ['reset', 'a'], ['setup', 'out']]);\n });\n }\n\n ['@test Exception during initialization of non-initial route is not swallowed'](assert) {\n this.router.map(function () {\n this.route('boom');\n });\n this.add('route:boom', _routing.Route.extend({\n init() {\n throw new Error('boom!');\n }\n }));\n\n return assert.throws(() => this.visit('/boom'), /\\bboom\\b/);\n }\n\n ['@test Exception during initialization of initial route is not swallowed'](assert) {\n this.router.map(function () {\n this.route('boom', { path: '/' });\n });\n this.add('route:boom', _routing.Route.extend({\n init() {\n throw new Error('boom!');\n }\n }));\n return assert.throws(() => this.visit('/'), /\\bboom\\b/);\n }\n\n ['@test {{outlet}} works when created after initial render'](assert) {\n this.addTemplate('sample', 'Hi{{#if showTheThing}}{{outlet}}{{/if}}Bye');\n this.addTemplate('sample.inner', 'Yay');\n this.addTemplate('sample.inner2', 'Boo');\n this.router.map(function () {\n this.route('sample', { path: '/' }, function () {\n this.route('inner', { path: '/' });\n this.route('inner2', { path: '/2' });\n });\n });\n\n let rootElement;\n return this.visit('/').then(() => {\n rootElement = document.getElementById('qunit-fixture');\n assert.equal(rootElement.textContent.trim(), 'HiBye', 'initial render');\n\n (0, _runloop.run)(() => this.applicationInstance.lookup('controller:sample').set('showTheThing', true));\n\n assert.equal(rootElement.textContent.trim(), 'HiYayBye', 'second render');\n return this.visit('/2');\n }).then(() => {\n assert.equal(rootElement.textContent.trim(), 'HiBooBye', 'third render');\n });\n }\n\n ['@test Can render into a named outlet at the top level'](assert) {\n this.addTemplate('application', 'A-{{outlet}}-B-{{outlet \"other\"}}-C');\n this.addTemplate('modal', 'Hello world');\n this.addTemplate('index', 'The index');\n this.router.map(function () {\n this.route('index', { path: '/' });\n });\n this.add('route:application', _routing.Route.extend({\n renderTemplate() {\n this.render();\n this.render('modal', {\n into: 'application',\n outlet: 'other'\n });\n }\n }));\n\n return this.visit('/').then(() => {\n let rootElement = document.getElementById('qunit-fixture');\n assert.equal(rootElement.textContent.trim(), 'A-The index-B-Hello world-C', 'initial render');\n });\n }\n\n ['@test Can disconnect a named outlet at the top level'](assert) {\n this.addTemplate('application', 'A-{{outlet}}-B-{{outlet \"other\"}}-C');\n this.addTemplate('modal', 'Hello world');\n this.addTemplate('index', 'The index');\n this.router.map(function () {\n this.route('index', { path: '/' });\n });\n this.add('route:application', _routing.Route.extend({\n renderTemplate() {\n this.render();\n this.render('modal', {\n into: 'application',\n outlet: 'other'\n });\n },\n actions: {\n banish() {\n this.disconnectOutlet({\n parentView: 'application',\n outlet: 'other'\n });\n }\n }\n }));\n\n return this.visit('/').then(() => {\n let rootElement = document.getElementById('qunit-fixture');\n assert.equal(rootElement.textContent.trim(), 'A-The index-B-Hello world-C', 'initial render');\n\n (0, _runloop.run)(this.applicationInstance.lookup('router:main'), 'send', 'banish');\n\n assert.equal(rootElement.textContent.trim(), 'A-The index-B--C', 'second render');\n });\n }\n\n ['@test Can render into a named outlet at the top level, with empty main outlet'](assert) {\n this.addTemplate('application', 'A-{{outlet}}-B-{{outlet \"other\"}}-C');\n this.addTemplate('modal', 'Hello world');\n\n this.router.map(function () {\n this.route('hasNoTemplate', { path: '/' });\n });\n\n this.add('route:application', _routing.Route.extend({\n renderTemplate() {\n this.render();\n this.render('modal', {\n into: 'application',\n outlet: 'other'\n });\n }\n }));\n\n return this.visit('/').then(() => {\n let rootElement = document.getElementById('qunit-fixture');\n assert.equal(rootElement.textContent.trim(), 'A--B-Hello world-C', 'initial render');\n });\n }\n\n ['@test Can render into a named outlet at the top level, later'](assert) {\n this.addTemplate('application', 'A-{{outlet}}-B-{{outlet \"other\"}}-C');\n this.addTemplate('modal', 'Hello world');\n this.addTemplate('index', 'The index');\n this.router.map(function () {\n this.route('index', { path: '/' });\n });\n this.add('route:application', _routing.Route.extend({\n actions: {\n launch() {\n this.render('modal', {\n into: 'application',\n outlet: 'other'\n });\n }\n }\n }));\n\n return this.visit('/').then(() => {\n let rootElement = document.getElementById('qunit-fixture');\n assert.equal(rootElement.textContent.trim(), 'A-The index-B--C', 'initial render');\n (0, _runloop.run)(this.applicationInstance.lookup('router:main'), 'send', 'launch');\n assert.equal(rootElement.textContent.trim(), 'A-The index-B-Hello world-C', 'second render');\n });\n }\n\n [\"@test Can render routes with no 'main' outlet and their children\"](assert) {\n this.addTemplate('application', '