discourse-ember-source 3.5.1.1 → 3.5.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (741) hide show
  1. checksums.yaml +4 -4
  2. data/lib/ember/version.rb +1 -1
  3. metadata +2 -740
  4. data/.gitignore +0 -9
  5. data/.travis.yml +0 -5
  6. data/Gemfile +0 -6
  7. data/LICENSE.txt +0 -21
  8. data/README +0 -18
  9. data/README.md +0 -39
  10. data/Rakefile +0 -27
  11. data/bin/console +0 -14
  12. data/bin/setup +0 -8
  13. data/discourse-ember-source-3.5.1.0.gem +0 -0
  14. data/dist/ember-all.debug.map +0 -1
  15. data/dist/ember-template-compiler.map +0 -1
  16. data/dist/ember-testing.map +0 -1
  17. data/dist/ember-tests.map +0 -1
  18. data/dist/ember-tests.prod.map +0 -1
  19. data/dist/ember.debug.map +0 -1
  20. data/dist/ember.min.map +0 -1
  21. data/dist/ember.prod.map +0 -1
  22. data/dist/es/@ember/application/globals-resolver.js +0 -425
  23. data/dist/es/@ember/application/index.js +0 -3
  24. data/dist/es/@ember/application/instance.js +0 -513
  25. data/dist/es/@ember/application/lib/application.js +0 -1139
  26. data/dist/es/@ember/application/lib/lazy_load.js +0 -69
  27. data/dist/es/@ember/application/lib/validate-type.js +0 -24
  28. data/dist/es/@ember/application/tests/application_instance_test.js +0 -230
  29. data/dist/es/@ember/application/tests/application_test.js +0 -470
  30. data/dist/es/@ember/application/tests/bootstrap-test.js +0 -28
  31. data/dist/es/@ember/application/tests/dependency_injection/custom_resolver_test.js +0 -32
  32. data/dist/es/@ember/application/tests/dependency_injection/default_resolver_test.js +0 -363
  33. data/dist/es/@ember/application/tests/dependency_injection/normalization_test.js +0 -70
  34. data/dist/es/@ember/application/tests/dependency_injection/to_string_test.js +0 -71
  35. data/dist/es/@ember/application/tests/dependency_injection_test.js +0 -93
  36. data/dist/es/@ember/application/tests/initializers_test.js +0 -391
  37. data/dist/es/@ember/application/tests/instance_initializers_test.js +0 -395
  38. data/dist/es/@ember/application/tests/lazy_load_test.js +0 -79
  39. data/dist/es/@ember/application/tests/logging_test.js +0 -179
  40. data/dist/es/@ember/application/tests/readiness_test.js +0 -138
  41. data/dist/es/@ember/application/tests/reset_test.js +0 -185
  42. data/dist/es/@ember/application/tests/visit_test.js +0 -783
  43. data/dist/es/@ember/canary-features/index.js +0 -76
  44. data/dist/es/@ember/controller/index.js +0 -50
  45. data/dist/es/@ember/controller/lib/controller_mixin.js +0 -42
  46. data/dist/es/@ember/controller/tests/controller_test.js +0 -209
  47. data/dist/es/@ember/debug/index.js +0 -264
  48. data/dist/es/@ember/debug/lib/deprecate.js +0 -198
  49. data/dist/es/@ember/debug/lib/handlers.js +0 -22
  50. data/dist/es/@ember/debug/lib/testing.js +0 -7
  51. data/dist/es/@ember/debug/lib/warn.js +0 -107
  52. data/dist/es/@ember/debug/tests/handlers-test.js +0 -144
  53. data/dist/es/@ember/debug/tests/main_test.js +0 -444
  54. data/dist/es/@ember/deprecated-features/index.js +0 -21
  55. data/dist/es/@ember/engine/index.js +0 -532
  56. data/dist/es/@ember/engine/instance.js +0 -228
  57. data/dist/es/@ember/engine/lib/engine-parent.js +0 -32
  58. data/dist/es/@ember/engine/tests/engine_initializers_test.js +0 -366
  59. data/dist/es/@ember/engine/tests/engine_instance_initializers_test.js +0 -409
  60. data/dist/es/@ember/engine/tests/engine_instance_test.js +0 -115
  61. data/dist/es/@ember/engine/tests/engine_parent_test.js +0 -20
  62. data/dist/es/@ember/engine/tests/engine_test.js +0 -121
  63. data/dist/es/@ember/error/index.js +0 -36
  64. data/dist/es/@ember/error/tests/index_test.js +0 -19
  65. data/dist/es/@ember/instrumentation/index.js +0 -240
  66. data/dist/es/@ember/instrumentation/tests/index-test.js +0 -214
  67. data/dist/es/@ember/map/index.js +0 -218
  68. data/dist/es/@ember/map/lib/ordered-set.js +0 -186
  69. data/dist/es/@ember/map/lib/utils.js +0 -29
  70. data/dist/es/@ember/map/tests/map_test.js +0 -578
  71. data/dist/es/@ember/map/with-default.js +0 -87
  72. data/dist/es/@ember/object/computed.js +0 -35
  73. data/dist/es/@ember/object/lib/computed/computed_macros.js +0 -742
  74. data/dist/es/@ember/object/lib/computed/reduce_computed_macros.js +0 -894
  75. data/dist/es/@ember/object/tests/computed/computed_macros_test.js +0 -533
  76. data/dist/es/@ember/object/tests/computed/reduce_computed_macros_test.js +0 -2243
  77. data/dist/es/@ember/polyfills/index.js +0 -3
  78. data/dist/es/@ember/polyfills/lib/assign.js +0 -43
  79. data/dist/es/@ember/polyfills/lib/merge.js +0 -35
  80. data/dist/es/@ember/polyfills/tests/assign_test.js +0 -64
  81. data/dist/es/@ember/runloop/index.js +0 -749
  82. data/dist/es/@ember/runloop/tests/debounce_test.js +0 -87
  83. data/dist/es/@ember/runloop/tests/later_test.js +0 -264
  84. data/dist/es/@ember/runloop/tests/next_test.js +0 -56
  85. data/dist/es/@ember/runloop/tests/once_test.js +0 -62
  86. data/dist/es/@ember/runloop/tests/onerror_test.js +0 -59
  87. data/dist/es/@ember/runloop/tests/run_bind_test.js +0 -59
  88. data/dist/es/@ember/runloop/tests/run_test.js +0 -28
  89. data/dist/es/@ember/runloop/tests/schedule_test.js +0 -86
  90. data/dist/es/@ember/runloop/tests/sync_test.js +0 -32
  91. data/dist/es/@ember/runloop/tests/unwind_test.js +0 -54
  92. data/dist/es/@ember/service/index.js +0 -57
  93. data/dist/es/@ember/string/index.js +0 -362
  94. data/dist/es/@ember/string/lib/string_registry.js +0 -13
  95. data/dist/es/@ember/string/tests/camelize_test.js +0 -53
  96. data/dist/es/@ember/string/tests/capitalize_test.js +0 -58
  97. data/dist/es/@ember/string/tests/classify_test.js +0 -79
  98. data/dist/es/@ember/string/tests/dasherize_test.js +0 -57
  99. data/dist/es/@ember/string/tests/decamelize_test.js +0 -51
  100. data/dist/es/@ember/string/tests/loc_test.js +0 -76
  101. data/dist/es/@ember/string/tests/underscore_test.js +0 -51
  102. data/dist/es/@ember/string/tests/w_test.js +0 -39
  103. data/dist/es/@glimmer/compiler.js +0 -1226
  104. data/dist/es/@glimmer/encoder.js +0 -39
  105. data/dist/es/@glimmer/low-level.js +0 -82
  106. data/dist/es/@glimmer/node.js +0 -112
  107. data/dist/es/@glimmer/opcode-compiler.js +0 -1999
  108. data/dist/es/@glimmer/program.js +0 -405
  109. data/dist/es/@glimmer/reference.js +0 -478
  110. data/dist/es/@glimmer/runtime.js +0 -4086
  111. data/dist/es/@glimmer/syntax.js +0 -1424
  112. data/dist/es/@glimmer/util.js +0 -189
  113. data/dist/es/@glimmer/vm.js +0 -27
  114. data/dist/es/@glimmer/wire-format.js +0 -56
  115. data/dist/es/backburner.js +0 -936
  116. data/dist/es/container/index.js +0 -8
  117. data/dist/es/container/lib/container.js +0 -437
  118. data/dist/es/container/lib/registry.js +0 -646
  119. data/dist/es/container/tests/container_test.js +0 -872
  120. data/dist/es/container/tests/owner_test.js +0 -20
  121. data/dist/es/container/tests/registry_test.js +0 -943
  122. data/dist/es/dag-map.js +0 -209
  123. data/dist/es/ember-browser-environment/index.js +0 -8
  124. data/dist/es/ember-browser-environment/lib/has-dom.js +0 -19
  125. data/dist/es/ember-console/index.js +0 -177
  126. data/dist/es/ember-environment/index.js +0 -3
  127. data/dist/es/ember-environment/lib/context.js +0 -20
  128. data/dist/es/ember-environment/lib/env.js +0 -185
  129. data/dist/es/ember-environment/lib/global.js +0 -14
  130. data/dist/es/ember-error-handling/index.js +0 -22
  131. data/dist/es/ember-extension-support/index.js +0 -2
  132. data/dist/es/ember-extension-support/lib/container_debug_adapter.js +0 -99
  133. data/dist/es/ember-extension-support/lib/data_adapter.js +0 -493
  134. data/dist/es/ember-extension-support/tests/container_debug_adapter_test.js +0 -73
  135. data/dist/es/ember-extension-support/tests/data_adapter_test.js +0 -301
  136. data/dist/es/ember-glimmer/index.js +0 -286
  137. data/dist/es/ember-glimmer/lib/compile-time-lookup.js +0 -37
  138. data/dist/es/ember-glimmer/lib/component-managers/abstract.js +0 -49
  139. data/dist/es/ember-glimmer/lib/component-managers/curly.js +0 -395
  140. data/dist/es/ember-glimmer/lib/component-managers/custom.js +0 -145
  141. data/dist/es/ember-glimmer/lib/component-managers/definition-state.js +0 -1
  142. data/dist/es/ember-glimmer/lib/component-managers/mount.js +0 -103
  143. data/dist/es/ember-glimmer/lib/component-managers/outlet.js +0 -114
  144. data/dist/es/ember-glimmer/lib/component-managers/render.js +0 -112
  145. data/dist/es/ember-glimmer/lib/component-managers/root.js +0 -74
  146. data/dist/es/ember-glimmer/lib/component-managers/template-only.js +0 -46
  147. data/dist/es/ember-glimmer/lib/component.js +0 -633
  148. data/dist/es/ember-glimmer/lib/components/checkbox.js +0 -57
  149. data/dist/es/ember-glimmer/lib/components/link-to.js +0 -777
  150. data/dist/es/ember-glimmer/lib/components/text_area.js +0 -236
  151. data/dist/es/ember-glimmer/lib/components/text_field.js +0 -145
  152. data/dist/es/ember-glimmer/lib/dom.js +0 -3
  153. data/dist/es/ember-glimmer/lib/environment.js +0 -102
  154. data/dist/es/ember-glimmer/lib/helper.js +0 -128
  155. data/dist/es/ember-glimmer/lib/helpers/-class.js +0 -23
  156. data/dist/es/ember-glimmer/lib/helpers/-html-safe.js +0 -9
  157. data/dist/es/ember-glimmer/lib/helpers/-input-type.js +0 -11
  158. data/dist/es/ember-glimmer/lib/helpers/-normalize-class.js +0 -22
  159. data/dist/es/ember-glimmer/lib/helpers/action.js +0 -360
  160. data/dist/es/ember-glimmer/lib/helpers/component.js +0 -135
  161. data/dist/es/ember-glimmer/lib/helpers/concat.js +0 -38
  162. data/dist/es/ember-glimmer/lib/helpers/each-in.js +0 -126
  163. data/dist/es/ember-glimmer/lib/helpers/get.js +0 -100
  164. data/dist/es/ember-glimmer/lib/helpers/hash.js +0 -44
  165. data/dist/es/ember-glimmer/lib/helpers/if-unless.js +0 -142
  166. data/dist/es/ember-glimmer/lib/helpers/loc.js +0 -40
  167. data/dist/es/ember-glimmer/lib/helpers/log.js +0 -25
  168. data/dist/es/ember-glimmer/lib/helpers/mut.js +0 -107
  169. data/dist/es/ember-glimmer/lib/helpers/query-param.js +0 -31
  170. data/dist/es/ember-glimmer/lib/helpers/readonly.js +0 -104
  171. data/dist/es/ember-glimmer/lib/helpers/unbound.js +0 -36
  172. data/dist/es/ember-glimmer/lib/modifiers/action.js +0 -185
  173. data/dist/es/ember-glimmer/lib/protocol-for-url.js +0 -48
  174. data/dist/es/ember-glimmer/lib/renderer.js +0 -371
  175. data/dist/es/ember-glimmer/lib/resolver.js +0 -290
  176. data/dist/es/ember-glimmer/lib/setup-registry.js +0 -77
  177. data/dist/es/ember-glimmer/lib/syntax.js +0 -73
  178. data/dist/es/ember-glimmer/lib/syntax/-text-area.js +0 -8
  179. data/dist/es/ember-glimmer/lib/syntax/input.js +0 -173
  180. data/dist/es/ember-glimmer/lib/syntax/let.js +0 -50
  181. data/dist/es/ember-glimmer/lib/syntax/mount.js +0 -101
  182. data/dist/es/ember-glimmer/lib/syntax/outlet.js +0 -120
  183. data/dist/es/ember-glimmer/lib/syntax/render.js +0 -140
  184. data/dist/es/ember-glimmer/lib/syntax/utils.js +0 -6
  185. data/dist/es/ember-glimmer/lib/template-compiler.js +0 -7
  186. data/dist/es/ember-glimmer/lib/template.js +0 -16
  187. data/dist/es/ember-glimmer/lib/template_registry.js +0 -18
  188. data/dist/es/ember-glimmer/lib/templates/component.js +0 -2
  189. data/dist/es/ember-glimmer/lib/templates/empty.js +0 -2
  190. data/dist/es/ember-glimmer/lib/templates/link-to.js +0 -2
  191. data/dist/es/ember-glimmer/lib/templates/outlet.js +0 -2
  192. data/dist/es/ember-glimmer/lib/templates/root.js +0 -2
  193. data/dist/es/ember-glimmer/lib/utils/bindings.js +0 -180
  194. data/dist/es/ember-glimmer/lib/utils/curly-component-state-bucket.js +0 -36
  195. data/dist/es/ember-glimmer/lib/utils/custom-component-manager.js +0 -20
  196. data/dist/es/ember-glimmer/lib/utils/debug-stack.js +0 -57
  197. data/dist/es/ember-glimmer/lib/utils/iterable.js +0 -358
  198. data/dist/es/ember-glimmer/lib/utils/outlet.js +0 -89
  199. data/dist/es/ember-glimmer/lib/utils/process-args.js +0 -40
  200. data/dist/es/ember-glimmer/lib/utils/references.js +0 -325
  201. data/dist/es/ember-glimmer/lib/utils/serialization-first-node-helpers.js +0 -1
  202. data/dist/es/ember-glimmer/lib/utils/string.js +0 -98
  203. data/dist/es/ember-glimmer/lib/utils/to-bool.js +0 -9
  204. data/dist/es/ember-glimmer/lib/views/outlet.js +0 -71
  205. data/dist/es/ember-glimmer/tests/integration/application/actions-test.js +0 -107
  206. data/dist/es/ember-glimmer/tests/integration/application/engine-test.js +0 -912
  207. data/dist/es/ember-glimmer/tests/integration/application/rendering-test.js +0 -530
  208. data/dist/es/ember-glimmer/tests/integration/components/angle-bracket-invocation-test.js +0 -852
  209. data/dist/es/ember-glimmer/tests/integration/components/append-test.js +0 -742
  210. data/dist/es/ember-glimmer/tests/integration/components/attribute-bindings-test.js +0 -999
  211. data/dist/es/ember-glimmer/tests/integration/components/attrs-lookup-test.js +0 -268
  212. data/dist/es/ember-glimmer/tests/integration/components/class-bindings-test.js +0 -849
  213. data/dist/es/ember-glimmer/tests/integration/components/contextual-components-test.js +0 -1493
  214. data/dist/es/ember-glimmer/tests/integration/components/curly-components-test.js +0 -3705
  215. data/dist/es/ember-glimmer/tests/integration/components/destroy-test.js +0 -33
  216. data/dist/es/ember-glimmer/tests/integration/components/dynamic-components-test.js +0 -896
  217. data/dist/es/ember-glimmer/tests/integration/components/error-handling-test.js +0 -164
  218. data/dist/es/ember-glimmer/tests/integration/components/fragment-components-test.js +0 -285
  219. data/dist/es/ember-glimmer/tests/integration/components/instrumentation-compile-test.js +0 -108
  220. data/dist/es/ember-glimmer/tests/integration/components/instrumentation-test.js +0 -157
  221. data/dist/es/ember-glimmer/tests/integration/components/life-cycle-test.js +0 -1653
  222. data/dist/es/ember-glimmer/tests/integration/components/link-to-test.js +0 -218
  223. data/dist/es/ember-glimmer/tests/integration/components/local-lookup-test.js +0 -414
  224. data/dist/es/ember-glimmer/tests/integration/components/namespaced-lookup-test.js +0 -185
  225. data/dist/es/ember-glimmer/tests/integration/components/render-to-element-test.js +0 -0
  226. data/dist/es/ember-glimmer/tests/integration/components/target-action-test.js +0 -779
  227. data/dist/es/ember-glimmer/tests/integration/components/template-only-components-test.js +0 -225
  228. data/dist/es/ember-glimmer/tests/integration/components/to-string-test.js +0 -27
  229. data/dist/es/ember-glimmer/tests/integration/components/utils-test.js +0 -401
  230. data/dist/es/ember-glimmer/tests/integration/components/web-component-fallback-test.js +0 -35
  231. data/dist/es/ember-glimmer/tests/integration/components/will-destroy-element-hook-test.js +0 -40
  232. data/dist/es/ember-glimmer/tests/integration/content-test.js +0 -1759
  233. data/dist/es/ember-glimmer/tests/integration/custom-component-manager-test.js +0 -508
  234. data/dist/es/ember-glimmer/tests/integration/event-dispatcher-test.js +0 -607
  235. data/dist/es/ember-glimmer/tests/integration/helpers/-class-test.js +0 -76
  236. data/dist/es/ember-glimmer/tests/integration/helpers/closure-action-test.js +0 -1240
  237. data/dist/es/ember-glimmer/tests/integration/helpers/concat-test.js +0 -106
  238. data/dist/es/ember-glimmer/tests/integration/helpers/custom-helper-test.js +0 -672
  239. data/dist/es/ember-glimmer/tests/integration/helpers/element-action-test.js +0 -1595
  240. data/dist/es/ember-glimmer/tests/integration/helpers/get-test.js +0 -618
  241. data/dist/es/ember-glimmer/tests/integration/helpers/hash-test.js +0 -188
  242. data/dist/es/ember-glimmer/tests/integration/helpers/if-unless-test.js +0 -149
  243. data/dist/es/ember-glimmer/tests/integration/helpers/input-test.js +0 -827
  244. data/dist/es/ember-glimmer/tests/integration/helpers/loc-test.js +0 -103
  245. data/dist/es/ember-glimmer/tests/integration/helpers/log-test.js +0 -61
  246. data/dist/es/ember-glimmer/tests/integration/helpers/mut-test.js +0 -580
  247. data/dist/es/ember-glimmer/tests/integration/helpers/partial-test.js +0 -386
  248. data/dist/es/ember-glimmer/tests/integration/helpers/readonly-test.js +0 -293
  249. data/dist/es/ember-glimmer/tests/integration/helpers/render-test.js +0 -522
  250. data/dist/es/ember-glimmer/tests/integration/helpers/text-area-test.js +0 -166
  251. data/dist/es/ember-glimmer/tests/integration/helpers/unbound-test.js +0 -650
  252. data/dist/es/ember-glimmer/tests/integration/helpers/yield-test.js +0 -275
  253. data/dist/es/ember-glimmer/tests/integration/input-test.js +0 -242
  254. data/dist/es/ember-glimmer/tests/integration/mount-test.js +0 -424
  255. data/dist/es/ember-glimmer/tests/integration/outlet-test.js +0 -318
  256. data/dist/es/ember-glimmer/tests/integration/refinements-test.js +0 -74
  257. data/dist/es/ember-glimmer/tests/integration/render-settled-test.js +0 -72
  258. data/dist/es/ember-glimmer/tests/integration/svg-test.js +0 -158
  259. data/dist/es/ember-glimmer/tests/integration/syntax/each-in-test.js +0 -697
  260. data/dist/es/ember-glimmer/tests/integration/syntax/each-test.js +0 -1251
  261. data/dist/es/ember-glimmer/tests/integration/syntax/experimental-syntax-test.js +0 -42
  262. data/dist/es/ember-glimmer/tests/integration/syntax/if-unless-test.js +0 -108
  263. data/dist/es/ember-glimmer/tests/integration/syntax/in-element-test.js +0 -119
  264. data/dist/es/ember-glimmer/tests/integration/syntax/let-test.js +0 -390
  265. data/dist/es/ember-glimmer/tests/integration/syntax/with-dynamic-var-test.js +0 -36
  266. data/dist/es/ember-glimmer/tests/integration/syntax/with-test.js +0 -422
  267. data/dist/es/ember-glimmer/tests/unit/outlet-test.js +0 -48
  268. data/dist/es/ember-glimmer/tests/unit/runtime-resolver-cache-test.js +0 -263
  269. data/dist/es/ember-glimmer/tests/unit/template-factory-test.js +0 -67
  270. data/dist/es/ember-glimmer/tests/unit/utils/debug-stack-test.js +0 -38
  271. data/dist/es/ember-glimmer/tests/utils/abstract-test-case.js +0 -1
  272. data/dist/es/ember-glimmer/tests/utils/helpers.js +0 -15
  273. data/dist/es/ember-glimmer/tests/utils/shared-conditional-tests.js +0 -965
  274. data/dist/es/ember-glimmer/tests/utils/string-test.js +0 -47
  275. data/dist/es/ember-glimmer/tests/utils/test-case.js +0 -6
  276. data/dist/es/ember-glimmer/tests/utils/test-helpers.js +0 -1
  277. data/dist/es/ember-meta/index.js +0 -1
  278. data/dist/es/ember-meta/lib/meta.js +0 -623
  279. data/dist/es/ember-meta/tests/meta_test.js +0 -169
  280. data/dist/es/ember-metal/index.js +0 -33
  281. data/dist/es/ember-metal/lib/alias.js +0 -80
  282. data/dist/es/ember-metal/lib/array.js +0 -55
  283. data/dist/es/ember-metal/lib/array_events.js +0 -65
  284. data/dist/es/ember-metal/lib/chains.js +0 -315
  285. data/dist/es/ember-metal/lib/change_event.js +0 -4
  286. data/dist/es/ember-metal/lib/computed.js +0 -526
  287. data/dist/es/ember-metal/lib/computed_cache.js +0 -58
  288. data/dist/es/ember-metal/lib/dependent_keys.js +0 -34
  289. data/dist/es/ember-metal/lib/deprecate_property.js +0 -34
  290. data/dist/es/ember-metal/lib/descriptor.js +0 -28
  291. data/dist/es/ember-metal/lib/each_proxy.js +0 -106
  292. data/dist/es/ember-metal/lib/each_proxy_events.js +0 -13
  293. data/dist/es/ember-metal/lib/events.js +0 -174
  294. data/dist/es/ember-metal/lib/expand_properties.js +0 -64
  295. data/dist/es/ember-metal/lib/get_properties.js +0 -45
  296. data/dist/es/ember-metal/lib/injected_property.js +0 -53
  297. data/dist/es/ember-metal/lib/is_blank.js +0 -34
  298. data/dist/es/ember-metal/lib/is_empty.js +0 -63
  299. data/dist/es/ember-metal/lib/is_none.js +0 -27
  300. data/dist/es/ember-metal/lib/is_present.js +0 -38
  301. data/dist/es/ember-metal/lib/libraries.js +0 -80
  302. data/dist/es/ember-metal/lib/mixin.js +0 -646
  303. data/dist/es/ember-metal/lib/namespace_search.js +0 -166
  304. data/dist/es/ember-metal/lib/observer.js +0 -34
  305. data/dist/es/ember-metal/lib/observer_set.js +0 -48
  306. data/dist/es/ember-metal/lib/path_cache.js +0 -5
  307. data/dist/es/ember-metal/lib/properties.js +0 -192
  308. data/dist/es/ember-metal/lib/property_events.js +0 -198
  309. data/dist/es/ember-metal/lib/property_get.js +0 -160
  310. data/dist/es/ember-metal/lib/property_set.js +0 -157
  311. data/dist/es/ember-metal/lib/set_properties.js +0 -43
  312. data/dist/es/ember-metal/lib/tags.js +0 -81
  313. data/dist/es/ember-metal/lib/tracked.js +0 -201
  314. data/dist/es/ember-metal/lib/transaction.js +0 -137
  315. data/dist/es/ember-metal/lib/watch_key.js +0 -113
  316. data/dist/es/ember-metal/lib/watch_path.js +0 -24
  317. data/dist/es/ember-metal/lib/watching.js +0 -54
  318. data/dist/es/ember-metal/tests/accessors/get_path_test.js +0 -82
  319. data/dist/es/ember-metal/tests/accessors/get_properties_test.js +0 -36
  320. data/dist/es/ember-metal/tests/accessors/get_test.js +0 -335
  321. data/dist/es/ember-metal/tests/accessors/mandatory_setters_test.js +0 -470
  322. data/dist/es/ember-metal/tests/accessors/set_path_test.js +0 -97
  323. data/dist/es/ember-metal/tests/accessors/set_test.js +0 -128
  324. data/dist/es/ember-metal/tests/alias_test.js +0 -167
  325. data/dist/es/ember-metal/tests/chains_test.js +0 -210
  326. data/dist/es/ember-metal/tests/computed_test.js +0 -1040
  327. data/dist/es/ember-metal/tests/descriptor_test.js +0 -368
  328. data/dist/es/ember-metal/tests/events_test.js +0 -210
  329. data/dist/es/ember-metal/tests/expand_properties_test.js +0 -119
  330. data/dist/es/ember-metal/tests/injected_property_test.js +0 -76
  331. data/dist/es/ember-metal/tests/is_blank_test.js +0 -29
  332. data/dist/es/ember-metal/tests/is_empty_test.js +0 -55
  333. data/dist/es/ember-metal/tests/is_none_test.js +0 -23
  334. data/dist/es/ember-metal/tests/is_present_test.js +0 -30
  335. data/dist/es/ember-metal/tests/libraries_test.js +0 -99
  336. data/dist/es/ember-metal/tests/main_test.js +0 -31
  337. data/dist/es/ember-metal/tests/mixin/alias_method_test.js +0 -91
  338. data/dist/es/ember-metal/tests/mixin/apply_test.js +0 -40
  339. data/dist/es/ember-metal/tests/mixin/computed_test.js +0 -166
  340. data/dist/es/ember-metal/tests/mixin/concatenated_properties_test.js +0 -117
  341. data/dist/es/ember-metal/tests/mixin/detect_test.js +0 -40
  342. data/dist/es/ember-metal/tests/mixin/introspection_test.js +0 -75
  343. data/dist/es/ember-metal/tests/mixin/merged_properties_test.js +0 -200
  344. data/dist/es/ember-metal/tests/mixin/method_test.js +0 -252
  345. data/dist/es/ember-metal/tests/mixin/observer_test.js +0 -202
  346. data/dist/es/ember-metal/tests/mixin/reopen_test.js +0 -53
  347. data/dist/es/ember-metal/tests/mixin/without_test.js +0 -22
  348. data/dist/es/ember-metal/tests/namespace_search_test.js +0 -16
  349. data/dist/es/ember-metal/tests/observer_test.js +0 -961
  350. data/dist/es/ember-metal/tests/performance_test.js +0 -81
  351. data/dist/es/ember-metal/tests/properties_test.js +0 -120
  352. data/dist/es/ember-metal/tests/property_did_change_hook.js +0 -73
  353. data/dist/es/ember-metal/tests/set_properties_test.js +0 -49
  354. data/dist/es/ember-metal/tests/tracked/computed_test.js +0 -67
  355. data/dist/es/ember-metal/tests/tracked/get_test.js +0 -86
  356. data/dist/es/ember-metal/tests/tracked/set_test.js +0 -44
  357. data/dist/es/ember-metal/tests/tracked/support.js +0 -37
  358. data/dist/es/ember-metal/tests/tracked/validation_test.js +0 -233
  359. data/dist/es/ember-metal/tests/watching/is_watching_test.js +0 -97
  360. data/dist/es/ember-metal/tests/watching/unwatch_test.js +0 -109
  361. data/dist/es/ember-metal/tests/watching/watch_test.js +0 -255
  362. data/dist/es/ember-owner/index.js +0 -66
  363. data/dist/es/ember-routing/index.js +0 -21
  364. data/dist/es/ember-routing/lib/ext/controller.js +0 -222
  365. data/dist/es/ember-routing/lib/location/api.js +0 -118
  366. data/dist/es/ember-routing/lib/location/auto_location.js +0 -323
  367. data/dist/es/ember-routing/lib/location/hash_location.js +0 -171
  368. data/dist/es/ember-routing/lib/location/history_location.js +0 -298
  369. data/dist/es/ember-routing/lib/location/none_location.js +0 -122
  370. data/dist/es/ember-routing/lib/location/util.js +0 -114
  371. data/dist/es/ember-routing/lib/services/router.js +0 -243
  372. data/dist/es/ember-routing/lib/services/routing.js +0 -101
  373. data/dist/es/ember-routing/lib/system/cache.js +0 -40
  374. data/dist/es/ember-routing/lib/system/controller_for.js +0 -14
  375. data/dist/es/ember-routing/lib/system/dsl.js +0 -208
  376. data/dist/es/ember-routing/lib/system/generate_controller.js +0 -54
  377. data/dist/es/ember-routing/lib/system/query_params.js +0 -6
  378. data/dist/es/ember-routing/lib/system/route.js +0 -2476
  379. data/dist/es/ember-routing/lib/system/router.js +0 -1607
  380. data/dist/es/ember-routing/lib/system/router_state.js +0 -26
  381. data/dist/es/ember-routing/lib/system/transition.js +0 -153
  382. data/dist/es/ember-routing/lib/utils.js +0 -230
  383. data/dist/es/ember-routing/tests/ext/controller_test.js +0 -85
  384. data/dist/es/ember-routing/tests/location/auto_location_test.js +0 -379
  385. data/dist/es/ember-routing/tests/location/hash_location_test.js +0 -207
  386. data/dist/es/ember-routing/tests/location/history_location_test.js +0 -322
  387. data/dist/es/ember-routing/tests/location/none_location_test.js +0 -88
  388. data/dist/es/ember-routing/tests/location/util_test.js +0 -159
  389. data/dist/es/ember-routing/tests/system/cache_test.js +0 -54
  390. data/dist/es/ember-routing/tests/system/controller_for_test.js +0 -75
  391. data/dist/es/ember-routing/tests/system/dsl_test.js +0 -413
  392. data/dist/es/ember-routing/tests/system/route_test.js +0 -587
  393. data/dist/es/ember-routing/tests/system/router_test.js +0 -287
  394. data/dist/es/ember-routing/tests/utils_test.js +0 -37
  395. data/dist/es/ember-runtime/.gitignore +0 -1
  396. data/dist/es/ember-runtime/README +0 -12
  397. data/dist/es/ember-runtime/index.js +0 -35
  398. data/dist/es/ember-runtime/lib/compare.js +0 -149
  399. data/dist/es/ember-runtime/lib/copy.js +0 -106
  400. data/dist/es/ember-runtime/lib/ext/function.js +0 -154
  401. data/dist/es/ember-runtime/lib/ext/rsvp.js +0 -59
  402. data/dist/es/ember-runtime/lib/is-equal.js +0 -60
  403. data/dist/es/ember-runtime/lib/mixins/-proxy.js +0 -109
  404. data/dist/es/ember-runtime/lib/mixins/action_handler.js +0 -222
  405. data/dist/es/ember-runtime/lib/mixins/array.js +0 -1661
  406. data/dist/es/ember-runtime/lib/mixins/comparable.js +0 -38
  407. data/dist/es/ember-runtime/lib/mixins/container_proxy.js +0 -154
  408. data/dist/es/ember-runtime/lib/mixins/copyable.js +0 -34
  409. data/dist/es/ember-runtime/lib/mixins/enumerable.js +0 -16
  410. data/dist/es/ember-runtime/lib/mixins/evented.js +0 -149
  411. data/dist/es/ember-runtime/lib/mixins/mutable_enumerable.js +0 -18
  412. data/dist/es/ember-runtime/lib/mixins/observable.js +0 -482
  413. data/dist/es/ember-runtime/lib/mixins/promise_proxy.js +0 -224
  414. data/dist/es/ember-runtime/lib/mixins/registry_proxy.js +0 -265
  415. data/dist/es/ember-runtime/lib/mixins/target_action_support.js +0 -172
  416. data/dist/es/ember-runtime/lib/system/array_proxy.js +0 -298
  417. data/dist/es/ember-runtime/lib/system/core_object.js +0 -1037
  418. data/dist/es/ember-runtime/lib/system/namespace.js +0 -69
  419. data/dist/es/ember-runtime/lib/system/object.js +0 -73
  420. data/dist/es/ember-runtime/lib/system/object_proxy.js +0 -81
  421. data/dist/es/ember-runtime/lib/type-of.js +0 -107
  422. data/dist/es/ember-runtime/tests/array/any-test.js +0 -55
  423. data/dist/es/ember-runtime/tests/array/compact-test.js +0 -12
  424. data/dist/es/ember-runtime/tests/array/every-test.js +0 -82
  425. data/dist/es/ember-runtime/tests/array/filter-test.js +0 -123
  426. data/dist/es/ember-runtime/tests/array/find-test.js +0 -86
  427. data/dist/es/ember-runtime/tests/array/firstObject-test.js +0 -27
  428. data/dist/es/ember-runtime/tests/array/forEach-test.js +0 -68
  429. data/dist/es/ember-runtime/tests/array/includes-test.js +0 -46
  430. data/dist/es/ember-runtime/tests/array/indexOf-test.js +0 -27
  431. data/dist/es/ember-runtime/tests/array/invoke-test.js +0 -60
  432. data/dist/es/ember-runtime/tests/array/isAny-test.js +0 -53
  433. data/dist/es/ember-runtime/tests/array/lastIndexOf-test.js +0 -78
  434. data/dist/es/ember-runtime/tests/array/lastObject-test.js +0 -31
  435. data/dist/es/ember-runtime/tests/array/map-test.js +0 -68
  436. data/dist/es/ember-runtime/tests/array/mapBy-test.js +0 -16
  437. data/dist/es/ember-runtime/tests/array/objectAt-test.js +0 -34
  438. data/dist/es/ember-runtime/tests/array/reduce-test.js +0 -24
  439. data/dist/es/ember-runtime/tests/array/reject-test.js +0 -134
  440. data/dist/es/ember-runtime/tests/array/sortBy-test.js +0 -23
  441. data/dist/es/ember-runtime/tests/array/toArray-test.js +0 -11
  442. data/dist/es/ember-runtime/tests/array/uniq-test.js +0 -27
  443. data/dist/es/ember-runtime/tests/array/uniqBy-test.js +0 -33
  444. data/dist/es/ember-runtime/tests/array/without-test.js +0 -39
  445. data/dist/es/ember-runtime/tests/copyable-array/copy-test.js +0 -12
  446. data/dist/es/ember-runtime/tests/core/compare_test.js +0 -89
  447. data/dist/es/ember-runtime/tests/core/copy_test.js +0 -47
  448. data/dist/es/ember-runtime/tests/core/isEqual_test.js +0 -65
  449. data/dist/es/ember-runtime/tests/core/is_array_test.js +0 -59
  450. data/dist/es/ember-runtime/tests/core/is_empty_test.js +0 -15
  451. data/dist/es/ember-runtime/tests/core/type_of_test.js +0 -54
  452. data/dist/es/ember-runtime/tests/ext/function_test.js +0 -121
  453. data/dist/es/ember-runtime/tests/ext/rsvp_test.js +0 -269
  454. data/dist/es/ember-runtime/tests/helpers/array.js +0 -336
  455. data/dist/es/ember-runtime/tests/inject_test.js +0 -51
  456. data/dist/es/ember-runtime/tests/legacy_1x/mixins/observable/chained_test.js +0 -63
  457. data/dist/es/ember-runtime/tests/legacy_1x/mixins/observable/observable_test.js +0 -892
  458. data/dist/es/ember-runtime/tests/legacy_1x/mixins/observable/propertyChanges_test.js +0 -142
  459. data/dist/es/ember-runtime/tests/legacy_1x/system/object/base_test.js +0 -98
  460. data/dist/es/ember-runtime/tests/legacy_1x/system/object/concatenated_test.js +0 -131
  461. data/dist/es/ember-runtime/tests/mixins/array_test.js +0 -400
  462. data/dist/es/ember-runtime/tests/mixins/comparable_test.js +0 -37
  463. data/dist/es/ember-runtime/tests/mixins/container_proxy_test.js +0 -48
  464. data/dist/es/ember-runtime/tests/mixins/enumerable_test.js +0 -17
  465. data/dist/es/ember-runtime/tests/mixins/evented_test.js +0 -23
  466. data/dist/es/ember-runtime/tests/mixins/mutable_enumerable_test.js +0 -17
  467. data/dist/es/ember-runtime/tests/mixins/observable_test.js +0 -137
  468. data/dist/es/ember-runtime/tests/mixins/promise_proxy_test.js +0 -593
  469. data/dist/es/ember-runtime/tests/mixins/target_action_support_test.js +0 -237
  470. data/dist/es/ember-runtime/tests/mutable-array/addObject-test.js +0 -76
  471. data/dist/es/ember-runtime/tests/mutable-array/clear-test.js +0 -64
  472. data/dist/es/ember-runtime/tests/mutable-array/insertAt-test.js +0 -216
  473. data/dist/es/ember-runtime/tests/mutable-array/popObject-test.js +0 -91
  474. data/dist/es/ember-runtime/tests/mutable-array/pushObject-test.js +0 -98
  475. data/dist/es/ember-runtime/tests/mutable-array/pushObjects-test.js +0 -12
  476. data/dist/es/ember-runtime/tests/mutable-array/removeAt-test.js +0 -187
  477. data/dist/es/ember-runtime/tests/mutable-array/removeObject-test.js +0 -77
  478. data/dist/es/ember-runtime/tests/mutable-array/removeObjects-test.js +0 -202
  479. data/dist/es/ember-runtime/tests/mutable-array/replace-test.js +0 -221
  480. data/dist/es/ember-runtime/tests/mutable-array/reverseObjects-test.js +0 -35
  481. data/dist/es/ember-runtime/tests/mutable-array/setObjects-test.js +0 -63
  482. data/dist/es/ember-runtime/tests/mutable-array/shiftObject-test.js +0 -105
  483. data/dist/es/ember-runtime/tests/mutable-array/unshiftObject-test.js +0 -99
  484. data/dist/es/ember-runtime/tests/mutable-array/unshiftObjects-test.js +0 -102
  485. data/dist/es/ember-runtime/tests/system/array_proxy/arranged_content_test.js +0 -275
  486. data/dist/es/ember-runtime/tests/system/array_proxy/array_observer_test.js +0 -51
  487. data/dist/es/ember-runtime/tests/system/array_proxy/content_change_test.js +0 -85
  488. data/dist/es/ember-runtime/tests/system/array_proxy/length_test.js +0 -201
  489. data/dist/es/ember-runtime/tests/system/array_proxy/watching_and_listening_test.js +0 -157
  490. data/dist/es/ember-runtime/tests/system/core_object_test.js +0 -114
  491. data/dist/es/ember-runtime/tests/system/namespace/base_test.js +0 -175
  492. data/dist/es/ember-runtime/tests/system/native_array/a_test.js +0 -16
  493. data/dist/es/ember-runtime/tests/system/native_array/copyable_suite_test.js +0 -19
  494. data/dist/es/ember-runtime/tests/system/native_array/replace_test.js +0 -17
  495. data/dist/es/ember-runtime/tests/system/object/computed_test.js +0 -352
  496. data/dist/es/ember-runtime/tests/system/object/create_test.js +0 -135
  497. data/dist/es/ember-runtime/tests/system/object/destroy_test.js +0 -146
  498. data/dist/es/ember-runtime/tests/system/object/detectInstance_test.js +0 -38
  499. data/dist/es/ember-runtime/tests/system/object/detect_test.js +0 -33
  500. data/dist/es/ember-runtime/tests/system/object/es-compatibility-test.js +0 -469
  501. data/dist/es/ember-runtime/tests/system/object/events_test.js +0 -156
  502. data/dist/es/ember-runtime/tests/system/object/extend_test.js +0 -153
  503. data/dist/es/ember-runtime/tests/system/object/observer_test.js +0 -216
  504. data/dist/es/ember-runtime/tests/system/object/reopenClass_test.js +0 -36
  505. data/dist/es/ember-runtime/tests/system/object/reopen_test.js +0 -48
  506. data/dist/es/ember-runtime/tests/system/object/strict-mode-test.js +0 -31
  507. data/dist/es/ember-runtime/tests/system/object/toString_test.js +0 -125
  508. data/dist/es/ember-runtime/tests/system/object_proxy_test.js +0 -314
  509. data/dist/es/ember-template-compiler/index.js +0 -26
  510. data/dist/es/ember-template-compiler/lib/compat.js +0 -16
  511. data/dist/es/ember-template-compiler/lib/plugins/assert-if-helper-without-arguments.js +0 -38
  512. data/dist/es/ember-template-compiler/lib/plugins/assert-input-helper-without-block.js +0 -20
  513. data/dist/es/ember-template-compiler/lib/plugins/assert-reserved-named-arguments.js +0 -26
  514. data/dist/es/ember-template-compiler/lib/plugins/assert-splattribute-expression.js +0 -27
  515. data/dist/es/ember-template-compiler/lib/plugins/deprecate-render-model.js +0 -38
  516. data/dist/es/ember-template-compiler/lib/plugins/deprecate-render.js +0 -41
  517. data/dist/es/ember-template-compiler/lib/plugins/deprecate-send-action.js +0 -42
  518. data/dist/es/ember-template-compiler/lib/plugins/index.js +0 -50
  519. data/dist/es/ember-template-compiler/lib/plugins/transform-action-syntax.js +0 -52
  520. data/dist/es/ember-template-compiler/lib/plugins/transform-angle-bracket-components.js +0 -10
  521. data/dist/es/ember-template-compiler/lib/plugins/transform-attrs-into-args.js +0 -62
  522. data/dist/es/ember-template-compiler/lib/plugins/transform-dot-component-invocation.js +0 -88
  523. data/dist/es/ember-template-compiler/lib/plugins/transform-each-in-into-each.js +0 -48
  524. data/dist/es/ember-template-compiler/lib/plugins/transform-has-block-syntax.js +0 -46
  525. data/dist/es/ember-template-compiler/lib/plugins/transform-in-element.js +0 -83
  526. data/dist/es/ember-template-compiler/lib/plugins/transform-inline-link-to.js +0 -31
  527. data/dist/es/ember-template-compiler/lib/plugins/transform-input-type-syntax.js +0 -52
  528. data/dist/es/ember-template-compiler/lib/plugins/transform-old-binding-syntax.js +0 -48
  529. data/dist/es/ember-template-compiler/lib/plugins/transform-old-class-binding-syntax.js +0 -102
  530. data/dist/es/ember-template-compiler/lib/plugins/transform-quoted-bindings-into-just-bindings.js +0 -34
  531. data/dist/es/ember-template-compiler/lib/plugins/transform-top-level-components.js +0 -41
  532. data/dist/es/ember-template-compiler/lib/system/bootstrap.js +0 -44
  533. data/dist/es/ember-template-compiler/lib/system/calculate-location-display.js +0 -20
  534. data/dist/es/ember-template-compiler/lib/system/compile-options.js +0 -71
  535. data/dist/es/ember-template-compiler/lib/system/compile.js +0 -28
  536. data/dist/es/ember-template-compiler/lib/system/dasherize-component-name.js +0 -13
  537. data/dist/es/ember-template-compiler/lib/system/initializer.js +0 -22
  538. data/dist/es/ember-template-compiler/lib/system/precompile.js +0 -18
  539. data/dist/es/ember-template-compiler/tests/plugins/assert-if-helper-without-arguments-test.js +0 -51
  540. data/dist/es/ember-template-compiler/tests/plugins/assert-input-helper-without-block-test.js +0 -17
  541. data/dist/es/ember-template-compiler/tests/plugins/assert-reserved-named-arguments-test.js +0 -416
  542. data/dist/es/ember-template-compiler/tests/plugins/assert-splattribute-expression-test.js +0 -57
  543. data/dist/es/ember-template-compiler/tests/plugins/deprecate-render-model-test.js +0 -19
  544. data/dist/es/ember-template-compiler/tests/plugins/deprecate-render-test.js +0 -19
  545. data/dist/es/ember-template-compiler/tests/plugins/deprecate-send-action-test.js +0 -29
  546. data/dist/es/ember-template-compiler/tests/plugins/transform-dot-component-invocation-test.js +0 -27
  547. data/dist/es/ember-template-compiler/tests/plugins/transform-inline-link-to-test.js +0 -15
  548. data/dist/es/ember-template-compiler/tests/plugins/transform-input-type-syntax-test.js +0 -25
  549. data/dist/es/ember-template-compiler/tests/system/bootstrap-test.js +0 -155
  550. data/dist/es/ember-template-compiler/tests/system/compile_options_test.js +0 -115
  551. data/dist/es/ember-template-compiler/tests/system/dasherize-component-name-test.js +0 -19
  552. data/dist/es/ember-testing/index.js +0 -10
  553. data/dist/es/ember-testing/lib/adapters/adapter.js +0 -58
  554. data/dist/es/ember-testing/lib/adapters/qunit.js +0 -47
  555. data/dist/es/ember-testing/lib/events.js +0 -136
  556. data/dist/es/ember-testing/lib/ext/application.js +0 -191
  557. data/dist/es/ember-testing/lib/ext/rsvp.js +0 -19
  558. data/dist/es/ember-testing/lib/helpers.js +0 -30
  559. data/dist/es/ember-testing/lib/helpers/-is-form-control.js +0 -16
  560. data/dist/es/ember-testing/lib/helpers/and_then.js +0 -3
  561. data/dist/es/ember-testing/lib/helpers/click.js +0 -36
  562. data/dist/es/ember-testing/lib/helpers/current_path.js +0 -27
  563. data/dist/es/ember-testing/lib/helpers/current_route_name.js +0 -25
  564. data/dist/es/ember-testing/lib/helpers/current_url.js +0 -27
  565. data/dist/es/ember-testing/lib/helpers/fill_in.js +0 -46
  566. data/dist/es/ember-testing/lib/helpers/find.js +0 -41
  567. data/dist/es/ember-testing/lib/helpers/find_with_assert.js +0 -34
  568. data/dist/es/ember-testing/lib/helpers/key_event.js +0 -36
  569. data/dist/es/ember-testing/lib/helpers/pause_test.js +0 -65
  570. data/dist/es/ember-testing/lib/helpers/trigger_event.js +0 -62
  571. data/dist/es/ember-testing/lib/helpers/visit.js +0 -42
  572. data/dist/es/ember-testing/lib/helpers/wait.js +0 -72
  573. data/dist/es/ember-testing/lib/initializers.js +0 -17
  574. data/dist/es/ember-testing/lib/setup_for_testing.js +0 -44
  575. data/dist/es/ember-testing/lib/support.js +0 -62
  576. data/dist/es/ember-testing/lib/test.js +0 -70
  577. data/dist/es/ember-testing/lib/test/adapter.js +0 -33
  578. data/dist/es/ember-testing/lib/test/helpers.js +0 -125
  579. data/dist/es/ember-testing/lib/test/on_inject_helpers.js +0 -38
  580. data/dist/es/ember-testing/lib/test/pending_requests.js +0 -24
  581. data/dist/es/ember-testing/lib/test/promise.js +0 -79
  582. data/dist/es/ember-testing/lib/test/run.js +0 -9
  583. data/dist/es/ember-testing/lib/test/waiters.js +0 -117
  584. data/dist/es/ember-testing/tests/acceptance_test.js +0 -478
  585. data/dist/es/ember-testing/tests/adapters/adapter_test.js +0 -31
  586. data/dist/es/ember-testing/tests/adapters/qunit_test.js +0 -50
  587. data/dist/es/ember-testing/tests/adapters_test.js +0 -405
  588. data/dist/es/ember-testing/tests/ext/rsvp_test.js +0 -124
  589. data/dist/es/ember-testing/tests/helper_registration_test.js +0 -98
  590. data/dist/es/ember-testing/tests/helpers_test.js +0 -1228
  591. data/dist/es/ember-testing/tests/integration_test.js +0 -106
  592. data/dist/es/ember-testing/tests/reexports_test.js +0 -26
  593. data/dist/es/ember-testing/tests/test/waiters-test.js +0 -145
  594. data/dist/es/ember-utils/index.js +0 -28
  595. data/dist/es/ember-utils/lib/cache.js +0 -36
  596. data/dist/es/ember-utils/lib/dictionary.js +0 -11
  597. data/dist/es/ember-utils/lib/guid.js +0 -120
  598. data/dist/es/ember-utils/lib/inspect.js +0 -112
  599. data/dist/es/ember-utils/lib/intern.js +0 -49
  600. data/dist/es/ember-utils/lib/invoke.js +0 -53
  601. data/dist/es/ember-utils/lib/is_proxy.js +0 -14
  602. data/dist/es/ember-utils/lib/lookup-descriptor.js +0 -11
  603. data/dist/es/ember-utils/lib/make-array.js +0 -7
  604. data/dist/es/ember-utils/lib/name.js +0 -9
  605. data/dist/es/ember-utils/lib/proxy-utils.js +0 -1
  606. data/dist/es/ember-utils/lib/spec.js +0 -14
  607. data/dist/es/ember-utils/lib/super.js +0 -83
  608. data/dist/es/ember-utils/lib/symbol-utils.js +0 -8
  609. data/dist/es/ember-utils/lib/symbol.js +0 -15
  610. data/dist/es/ember-utils/lib/to-string.js +0 -35
  611. data/dist/es/ember-utils/lib/weak_set.js +0 -18
  612. data/dist/es/ember-utils/tests/cache_test.js +0 -77
  613. data/dist/es/ember-utils/tests/can_invoke_test.js +0 -46
  614. data/dist/es/ember-utils/tests/checkHasSuper_test.js +0 -17
  615. data/dist/es/ember-utils/tests/generate_guid_test.js +0 -13
  616. data/dist/es/ember-utils/tests/guid_for_test.js +0 -101
  617. data/dist/es/ember-utils/tests/inspect_test.js +0 -146
  618. data/dist/es/ember-utils/tests/is_proxy_test.js +0 -18
  619. data/dist/es/ember-utils/tests/make_array_test.js +0 -41
  620. data/dist/es/ember-utils/tests/to-string-test.js +0 -32
  621. data/dist/es/ember-utils/tests/try_invoke_test.js +0 -48
  622. data/dist/es/ember-views/index.js +0 -28
  623. data/dist/es/ember-views/lib/compat/attrs.js +0 -3
  624. data/dist/es/ember-views/lib/compat/fallback-view-registry.js +0 -3
  625. data/dist/es/ember-views/lib/component_lookup.js +0 -27
  626. data/dist/es/ember-views/lib/mixins/action_support.js +0 -189
  627. data/dist/es/ember-views/lib/mixins/child_views_support.js +0 -27
  628. data/dist/es/ember-views/lib/mixins/class_names_support.js +0 -102
  629. data/dist/es/ember-views/lib/mixins/text_support.js +0 -333
  630. data/dist/es/ember-views/lib/mixins/view_state_support.js +0 -19
  631. data/dist/es/ember-views/lib/mixins/view_support.js +0 -452
  632. data/dist/es/ember-views/lib/system/action_manager.js +0 -14
  633. data/dist/es/ember-views/lib/system/event_dispatcher.js +0 -454
  634. data/dist/es/ember-views/lib/system/jquery.js +0 -29
  635. data/dist/es/ember-views/lib/system/jquery_event_deprecation.js +0 -61
  636. data/dist/es/ember-views/lib/system/lookup_partial.js +0 -55
  637. data/dist/es/ember-views/lib/system/utils.js +0 -201
  638. data/dist/es/ember-views/lib/utils/lookup-component.js +0 -58
  639. data/dist/es/ember-views/lib/views/core_view.js +0 -83
  640. data/dist/es/ember-views/lib/views/states.js +0 -48
  641. data/dist/es/ember-views/lib/views/states/default.js +0 -17
  642. data/dist/es/ember-views/lib/views/states/destroying.js +0 -16
  643. data/dist/es/ember-views/lib/views/states/has_element.js +0 -31
  644. data/dist/es/ember-views/lib/views/states/in_dom.js +0 -28
  645. data/dist/es/ember-views/lib/views/states/pre_render.js +0 -3
  646. data/dist/es/ember/index.js +0 -645
  647. data/dist/es/ember/tests/application_lifecycle_test.js +0 -188
  648. data/dist/es/ember/tests/component_context_test.js +0 -255
  649. data/dist/es/ember/tests/component_registration_test.js +0 -252
  650. data/dist/es/ember/tests/controller_test.js +0 -44
  651. data/dist/es/ember/tests/error_handler_test.js +0 -581
  652. data/dist/es/ember/tests/helpers/helper_registration_test.js +0 -103
  653. data/dist/es/ember/tests/helpers/link_to_test.js +0 -2103
  654. data/dist/es/ember/tests/helpers/link_to_test/link_to_transitioning_classes_test.js +0 -342
  655. data/dist/es/ember/tests/helpers/link_to_test/link_to_with_query_params_test.js +0 -694
  656. data/dist/es/ember/tests/homepage_example_test.js +0 -47
  657. data/dist/es/ember/tests/integration/multiple-app-test.js +0 -101
  658. data/dist/es/ember/tests/production_build_test.js +0 -34
  659. data/dist/es/ember/tests/reexports_test.js +0 -307
  660. data/dist/es/ember/tests/routing/decoupled_basic_test.js +0 -4506
  661. data/dist/es/ember/tests/routing/query_params_test.js +0 -1579
  662. data/dist/es/ember/tests/routing/query_params_test/model_dependent_state_with_query_params_test.js +0 -1117
  663. data/dist/es/ember/tests/routing/query_params_test/overlapping_query_params_test.js +0 -185
  664. data/dist/es/ember/tests/routing/query_params_test/query_param_async_get_handler_test.js +0 -327
  665. data/dist/es/ember/tests/routing/query_params_test/query_params_paramless_link_to_test.js +0 -37
  666. data/dist/es/ember/tests/routing/query_params_test/shared_state_test.js +0 -84
  667. data/dist/es/ember/tests/routing/router_map_test.js +0 -46
  668. data/dist/es/ember/tests/routing/router_service_test/basic_test.js +0 -95
  669. data/dist/es/ember/tests/routing/router_service_test/currenturl_lifecycle_test.js +0 -149
  670. data/dist/es/ember/tests/routing/router_service_test/isActive_test.js +0 -113
  671. data/dist/es/ember/tests/routing/router_service_test/replaceWith_test.js +0 -144
  672. data/dist/es/ember/tests/routing/router_service_test/transitionTo_test.js +0 -370
  673. data/dist/es/ember/tests/routing/router_service_test/urlFor_test.js +0 -307
  674. data/dist/es/ember/tests/routing/substates_test.js +0 -1110
  675. data/dist/es/ember/tests/routing/toplevel_dom_test.js +0 -37
  676. data/dist/es/ember/tests/service_injection_test.js +0 -278
  677. data/dist/es/ember/tests/view_instrumentation_test.js +0 -47
  678. data/dist/es/ember/version.js +0 -1
  679. data/dist/es/handlebars.js +0 -1268
  680. data/dist/es/internal-test-helpers/index.js +0 -31
  681. data/dist/es/internal-test-helpers/lib/.gitkeep +0 -0
  682. data/dist/es/internal-test-helpers/lib/apply-mixins.js +0 -37
  683. data/dist/es/internal-test-helpers/lib/browser-detect.js +0 -4
  684. data/dist/es/internal-test-helpers/lib/build-owner.js +0 -49
  685. data/dist/es/internal-test-helpers/lib/confirm-export.js +0 -45
  686. data/dist/es/internal-test-helpers/lib/ember-dev/assertion.js +0 -87
  687. data/dist/es/internal-test-helpers/lib/ember-dev/containers.js +0 -34
  688. data/dist/es/internal-test-helpers/lib/ember-dev/debug.js +0 -47
  689. data/dist/es/internal-test-helpers/lib/ember-dev/deprecation.js +0 -71
  690. data/dist/es/internal-test-helpers/lib/ember-dev/index.js +0 -19
  691. data/dist/es/internal-test-helpers/lib/ember-dev/method-call-tracker.js +0 -127
  692. data/dist/es/internal-test-helpers/lib/ember-dev/namespaces.js +0 -34
  693. data/dist/es/internal-test-helpers/lib/ember-dev/run-loop.js +0 -28
  694. data/dist/es/internal-test-helpers/lib/ember-dev/setup-qunit.js +0 -26
  695. data/dist/es/internal-test-helpers/lib/ember-dev/utils.js +0 -33
  696. data/dist/es/internal-test-helpers/lib/ember-dev/warning.js +0 -71
  697. data/dist/es/internal-test-helpers/lib/equal-inner-html.js +0 -37
  698. data/dist/es/internal-test-helpers/lib/equal-tokens.js +0 -53
  699. data/dist/es/internal-test-helpers/lib/factory.js +0 -65
  700. data/dist/es/internal-test-helpers/lib/get-all-property-names.js +0 -12
  701. data/dist/es/internal-test-helpers/lib/get-text-of.js +0 -3
  702. data/dist/es/internal-test-helpers/lib/matchers.js +0 -167
  703. data/dist/es/internal-test-helpers/lib/module-for.js +0 -89
  704. data/dist/es/internal-test-helpers/lib/registry-check.js +0 -28
  705. data/dist/es/internal-test-helpers/lib/run.js +0 -11
  706. data/dist/es/internal-test-helpers/lib/strip.js +0 -12
  707. data/dist/es/internal-test-helpers/lib/system/synthetic-events.js +0 -183
  708. data/dist/es/internal-test-helpers/lib/test-cases/abstract-application.js +0 -70
  709. data/dist/es/internal-test-helpers/lib/test-cases/abstract-rendering.js +0 -203
  710. data/dist/es/internal-test-helpers/lib/test-cases/abstract.js +0 -222
  711. data/dist/es/internal-test-helpers/lib/test-cases/application.js +0 -39
  712. data/dist/es/internal-test-helpers/lib/test-cases/autoboot-application.js +0 -34
  713. data/dist/es/internal-test-helpers/lib/test-cases/default-resolver-application.js +0 -43
  714. data/dist/es/internal-test-helpers/lib/test-cases/node-query.js +0 -120
  715. data/dist/es/internal-test-helpers/lib/test-cases/query-param.js +0 -124
  716. data/dist/es/internal-test-helpers/lib/test-cases/rendering.js +0 -14
  717. data/dist/es/internal-test-helpers/lib/test-cases/router.js +0 -26
  718. data/dist/es/internal-test-helpers/lib/test-cases/test-resolver-application.js +0 -40
  719. data/dist/es/internal-test-helpers/lib/test-resolver.js +0 -86
  720. data/dist/es/internal-test-helpers/tests/index-test.js +0 -10
  721. data/dist/es/route-recognizer.js +0 -685
  722. data/dist/es/router.js +0 -2454
  723. data/dist/es/rsvp.js +0 -2394
  724. data/dist/es/simple-html-tokenizer.js +0 -638
  725. data/dist/jquery/jquery.js +0 -10364
  726. data/dist/node/app-boot-test.js +0 -146
  727. data/dist/node/build-info-test.js +0 -177
  728. data/dist/node/component-rendering-test.js +0 -34
  729. data/dist/node/helpers/app-module.js +0 -198
  730. data/dist/node/helpers/assert-html-matches.js +0 -25
  731. data/dist/node/helpers/build-owner.js +0 -28
  732. data/dist/node/helpers/component-module.js +0 -137
  733. data/dist/node/sourcemap-test.js +0 -27
  734. data/dist/node/template-compiler-test.js +0 -45
  735. data/dist/node/visit-test.js +0 -349
  736. data/dist/qunit/qunit.css +0 -436
  737. data/dist/qunit/qunit.js +0 -5188
  738. data/dist/tests/index.html +0 -254
  739. data/ember-source.gemspec +0 -28
  740. data/node_modules/.yarn-integrity +0 -10
  741. data/yarn.lock +0 -4
@@ -1,3705 +0,0 @@
1
- import { run } from '@ember/runloop';
2
- import { DEBUG } from '@glimmer/env';
3
- /* globals EmberDev */
4
- import { set, get, observer, on, computed } from 'ember-metal';
5
- import Service, { inject as injectService } from '@ember/service';
6
- import { Object as EmberObject, A as emberA } from 'ember-runtime';
7
- import { jQueryDisabled } from 'ember-views';
8
- import { ENV } from 'ember-environment';
9
- import { Component, compile, htmlSafe } from '../../utils/helpers';
10
- import { strip } from '../../utils/abstract-test-case';
11
- import { moduleFor, RenderingTest } from '../../utils/test-case';
12
- import { classes, equalTokens, equalsElement, styles } from '../../utils/test-helpers';
13
-
14
- moduleFor(
15
- 'Components test: curly components',
16
- class extends RenderingTest {
17
- constructor() {
18
- super(...arguments);
19
- this.originalDidInitAttrsSupport = ENV._ENABLE_DID_INIT_ATTRS_SUPPORT;
20
- }
21
-
22
- teardown() {
23
- ENV._ENABLE_DID_INIT_ATTRS_SUPPORT = this.originalDidInitAttrsSupport;
24
- super.teardown();
25
- }
26
-
27
- ['@test it can render a basic component']() {
28
- this.registerComponent('foo-bar', { template: 'hello' });
29
-
30
- this.render('{{foo-bar}}');
31
-
32
- this.assertComponentElement(this.firstChild, { content: 'hello' });
33
-
34
- this.runTask(() => this.rerender());
35
-
36
- this.assertComponentElement(this.firstChild, { content: 'hello' });
37
- }
38
-
39
- ['@test it can have a custom id and it is not bound']() {
40
- this.registerComponent('foo-bar', { template: '{{id}} {{elementId}}' });
41
-
42
- this.render('{{foo-bar id=customId}}', {
43
- customId: 'bizz',
44
- });
45
-
46
- this.assertComponentElement(this.firstChild, {
47
- tagName: 'div',
48
- attrs: { id: 'bizz' },
49
- content: 'bizz bizz',
50
- });
51
-
52
- this.runTask(() => this.rerender());
53
-
54
- this.assertComponentElement(this.firstChild, {
55
- tagName: 'div',
56
- attrs: { id: 'bizz' },
57
- content: 'bizz bizz',
58
- });
59
-
60
- this.runTask(() => set(this.context, 'customId', 'bar'));
61
-
62
- this.assertComponentElement(this.firstChild, {
63
- tagName: 'div',
64
- attrs: { id: 'bizz' },
65
- content: 'bar bizz',
66
- });
67
-
68
- this.runTask(() => set(this.context, 'customId', 'bizz'));
69
-
70
- this.assertComponentElement(this.firstChild, {
71
- tagName: 'div',
72
- attrs: { id: 'bizz' },
73
- content: 'bizz bizz',
74
- });
75
- }
76
-
77
- ['@test elementId cannot change'](assert) {
78
- let component;
79
- let FooBarComponent = Component.extend({
80
- elementId: 'blahzorz',
81
- init() {
82
- this._super(...arguments);
83
- component = this;
84
- },
85
- });
86
-
87
- this.registerComponent('foo-bar', {
88
- ComponentClass: FooBarComponent,
89
- template: '{{elementId}}',
90
- });
91
-
92
- this.render('{{foo-bar}}');
93
-
94
- this.assertComponentElement(this.firstChild, {
95
- tagName: 'div',
96
- attrs: { id: 'blahzorz' },
97
- content: 'blahzorz',
98
- });
99
-
100
- if (EmberDev && !EmberDev.runningProdBuild) {
101
- let willThrow = () => run(null, set, component, 'elementId', 'herpyderpy');
102
-
103
- assert.throws(willThrow, /Changing a view's elementId after creation is not allowed/);
104
-
105
- this.assertComponentElement(this.firstChild, {
106
- tagName: 'div',
107
- attrs: { id: 'blahzorz' },
108
- content: 'blahzorz',
109
- });
110
- }
111
- }
112
-
113
- ['@test can specify template with `layoutName` property']() {
114
- let FooBarComponent = Component.extend({
115
- elementId: 'blahzorz',
116
- layoutName: 'fizz-bar',
117
- init() {
118
- this._super(...arguments);
119
- this.local = 'hey';
120
- },
121
- });
122
-
123
- this.registerTemplate('fizz-bar', `FIZZ BAR {{local}}`);
124
-
125
- this.registerComponent('foo-bar', { ComponentClass: FooBarComponent });
126
-
127
- this.render('{{foo-bar}}');
128
-
129
- this.assertText('FIZZ BAR hey');
130
- }
131
-
132
- ['@test layout supports computed property']() {
133
- let FooBarComponent = Component.extend({
134
- elementId: 'blahzorz',
135
- layout: computed(function() {
136
- return compile('so much layout wat {{lulz}}');
137
- }),
138
- init() {
139
- this._super(...arguments);
140
- this.lulz = 'heyo';
141
- },
142
- });
143
-
144
- this.registerComponent('foo-bar', { ComponentClass: FooBarComponent });
145
-
146
- this.render('{{foo-bar}}');
147
-
148
- this.assertText('so much layout wat heyo');
149
- }
150
-
151
- ['@test passing undefined elementId results in a default elementId'](assert) {
152
- let FooBarComponent = Component.extend({
153
- tagName: 'h1',
154
- });
155
-
156
- this.registerComponent('foo-bar', {
157
- ComponentClass: FooBarComponent,
158
- template: 'something',
159
- });
160
-
161
- this.render('{{foo-bar id=somethingUndefined}}');
162
-
163
- let foundId = this.$('h1').attr('id');
164
- assert.ok(
165
- /^ember/.test(foundId),
166
- 'Has a reasonable id attribute (found id=' + foundId + ').'
167
- );
168
-
169
- this.runTask(() => this.rerender());
170
-
171
- let newFoundId = this.$('h1').attr('id');
172
- assert.ok(
173
- /^ember/.test(newFoundId),
174
- 'Has a reasonable id attribute (found id=' + newFoundId + ').'
175
- );
176
-
177
- assert.equal(foundId, newFoundId);
178
- }
179
-
180
- ['@test id is an alias for elementId'](assert) {
181
- let FooBarComponent = Component.extend({
182
- tagName: 'h1',
183
- });
184
-
185
- this.registerComponent('foo-bar', {
186
- ComponentClass: FooBarComponent,
187
- template: 'something',
188
- });
189
-
190
- this.render('{{foo-bar id="custom-id"}}');
191
-
192
- let foundId = this.$('h1').attr('id');
193
- assert.equal(foundId, 'custom-id');
194
-
195
- this.runTask(() => this.rerender());
196
-
197
- let newFoundId = this.$('h1').attr('id');
198
- assert.equal(newFoundId, 'custom-id');
199
-
200
- assert.equal(foundId, newFoundId);
201
- }
202
-
203
- ['@test cannot pass both id and elementId at the same time']() {
204
- this.registerComponent('foo-bar', { template: '' });
205
-
206
- expectAssertion(() => {
207
- this.render('{{foo-bar id="zomg" elementId="lol"}}');
208
- }, /You cannot invoke a component with both 'id' and 'elementId' at the same time./);
209
- }
210
-
211
- ['@test it can have a custom tagName']() {
212
- let FooBarComponent = Component.extend({
213
- tagName: 'foo-bar',
214
- });
215
-
216
- this.registerComponent('foo-bar', {
217
- ComponentClass: FooBarComponent,
218
- template: 'hello',
219
- });
220
-
221
- this.render('{{foo-bar}}');
222
-
223
- this.assertComponentElement(this.firstChild, {
224
- tagName: 'foo-bar',
225
- content: 'hello',
226
- });
227
-
228
- this.runTask(() => this.rerender());
229
-
230
- this.assertComponentElement(this.firstChild, {
231
- tagName: 'foo-bar',
232
- content: 'hello',
233
- });
234
- }
235
-
236
- ['@test it can have a custom tagName set in the constructor']() {
237
- let FooBarComponent = Component.extend({
238
- init() {
239
- this._super();
240
- this.tagName = 'foo-bar';
241
- },
242
- });
243
-
244
- this.registerComponent('foo-bar', {
245
- ComponentClass: FooBarComponent,
246
- template: 'hello',
247
- });
248
-
249
- this.render('{{foo-bar}}');
250
-
251
- this.assertComponentElement(this.firstChild, {
252
- tagName: 'foo-bar',
253
- content: 'hello',
254
- });
255
-
256
- this.runTask(() => this.rerender());
257
-
258
- this.assertComponentElement(this.firstChild, {
259
- tagName: 'foo-bar',
260
- content: 'hello',
261
- });
262
- }
263
-
264
- ['@test it can have a custom tagName from the invocation']() {
265
- this.registerComponent('foo-bar', { template: 'hello' });
266
-
267
- this.render('{{foo-bar tagName="foo-bar"}}');
268
-
269
- this.assertComponentElement(this.firstChild, {
270
- tagName: 'foo-bar',
271
- content: 'hello',
272
- });
273
-
274
- this.runTask(() => this.rerender());
275
-
276
- this.assertComponentElement(this.firstChild, {
277
- tagName: 'foo-bar',
278
- content: 'hello',
279
- });
280
- }
281
-
282
- ['@test tagName can not be a computed property']() {
283
- let FooBarComponent = Component.extend({
284
- tagName: computed(function() {
285
- return 'foo-bar';
286
- }),
287
- });
288
-
289
- this.registerComponent('foo-bar', {
290
- ComponentClass: FooBarComponent,
291
- template: 'hello',
292
- });
293
-
294
- expectAssertion(() => {
295
- this.render('{{foo-bar}}');
296
- }, /You cannot use a computed property for the component's `tagName` \(<.+?>\)\./);
297
- }
298
-
299
- ['@test class is applied before didInsertElement'](assert) {
300
- let componentClass;
301
- let FooBarComponent = Component.extend({
302
- didInsertElement() {
303
- componentClass = this.element.className;
304
- },
305
- });
306
-
307
- this.registerComponent('foo-bar', {
308
- ComponentClass: FooBarComponent,
309
- template: 'hello',
310
- });
311
-
312
- this.render('{{foo-bar class="foo-bar"}}');
313
-
314
- assert.equal(componentClass, 'foo-bar ember-view');
315
- }
316
-
317
- ['@test it can have custom classNames']() {
318
- let FooBarComponent = Component.extend({
319
- classNames: ['foo', 'bar'],
320
- });
321
-
322
- this.registerComponent('foo-bar', {
323
- ComponentClass: FooBarComponent,
324
- template: 'hello',
325
- });
326
-
327
- this.render('{{foo-bar}}');
328
-
329
- this.assertComponentElement(this.firstChild, {
330
- tagName: 'div',
331
- attrs: { class: classes('ember-view foo bar') },
332
- content: 'hello',
333
- });
334
-
335
- this.runTask(() => this.rerender());
336
-
337
- this.assertComponentElement(this.firstChild, {
338
- tagName: 'div',
339
- attrs: { class: classes('ember-view foo bar') },
340
- content: 'hello',
341
- });
342
- }
343
-
344
- ['@test should not apply falsy class name']() {
345
- this.registerComponent('foo-bar', { template: 'hello' });
346
-
347
- this.render('{{foo-bar class=somethingFalsy}}', {
348
- somethingFalsy: false,
349
- });
350
-
351
- this.assertComponentElement(this.firstChild, {
352
- tagName: 'div',
353
- attrs: { class: 'ember-view' },
354
- content: 'hello',
355
- });
356
-
357
- this.runTask(() => this.rerender());
358
-
359
- this.assertComponentElement(this.firstChild, {
360
- tagName: 'div',
361
- attrs: { class: 'ember-view' },
362
- content: 'hello',
363
- });
364
- }
365
-
366
- ['@test should update class using inline if, initially false, no alternate']() {
367
- this.registerComponent('foo-bar', { template: 'hello' });
368
-
369
- this.render('{{foo-bar class=(if predicate "thing") }}', {
370
- predicate: false,
371
- });
372
-
373
- this.assertComponentElement(this.firstChild, {
374
- tagName: 'div',
375
- attrs: { class: 'ember-view' },
376
- content: 'hello',
377
- });
378
-
379
- this.runTask(() => set(this.context, 'predicate', true));
380
- this.runTask(() => this.rerender());
381
-
382
- this.assertComponentElement(this.firstChild, {
383
- tagName: 'div',
384
- attrs: { class: classes('ember-view thing') },
385
- content: 'hello',
386
- });
387
-
388
- this.runTask(() => set(this.context, 'predicate', false));
389
- this.runTask(() => this.rerender());
390
-
391
- this.assertComponentElement(this.firstChild, {
392
- tagName: 'div',
393
- attrs: { class: 'ember-view' },
394
- content: 'hello',
395
- });
396
- }
397
-
398
- ['@test should update class using inline if, initially true, no alternate']() {
399
- this.registerComponent('foo-bar', { template: 'hello' });
400
-
401
- this.render('{{foo-bar class=(if predicate "thing") }}', {
402
- predicate: true,
403
- });
404
-
405
- this.assertComponentElement(this.firstChild, {
406
- tagName: 'div',
407
- attrs: { class: classes('ember-view thing') },
408
- content: 'hello',
409
- });
410
-
411
- this.runTask(() => set(this.context, 'predicate', false));
412
- this.runTask(() => this.rerender());
413
-
414
- this.assertComponentElement(this.firstChild, {
415
- tagName: 'div',
416
- attrs: { class: 'ember-view' },
417
- content: 'hello',
418
- });
419
-
420
- this.runTask(() => set(this.context, 'predicate', true));
421
- this.runTask(() => this.rerender());
422
-
423
- this.assertComponentElement(this.firstChild, {
424
- tagName: 'div',
425
- attrs: { class: classes('ember-view thing') },
426
- content: 'hello',
427
- });
428
- }
429
-
430
- ['@test should apply classes of the dasherized property name when bound property specified is true']() {
431
- this.registerComponent('foo-bar', { template: 'hello' });
432
-
433
- this.render('{{foo-bar class=model.someTruth}}', {
434
- model: { someTruth: true },
435
- });
436
-
437
- this.assertComponentElement(this.firstChild, {
438
- tagName: 'div',
439
- attrs: { class: classes('ember-view some-truth') },
440
- content: 'hello',
441
- });
442
-
443
- this.runTask(() => this.rerender());
444
-
445
- this.assertComponentElement(this.firstChild, {
446
- tagName: 'div',
447
- attrs: { class: classes('ember-view some-truth') },
448
- content: 'hello',
449
- });
450
-
451
- this.runTask(() => set(this.context, 'model.someTruth', false));
452
-
453
- this.assertComponentElement(this.firstChild, {
454
- tagName: 'div',
455
- attrs: { class: classes('ember-view') },
456
- content: 'hello',
457
- });
458
-
459
- this.runTask(() => set(this.context, 'model', { someTruth: true }));
460
-
461
- this.assertComponentElement(this.firstChild, {
462
- tagName: 'div',
463
- attrs: { class: classes('ember-view some-truth') },
464
- content: 'hello',
465
- });
466
- }
467
-
468
- ['@test class property on components can be dynamic']() {
469
- this.registerComponent('foo-bar', { template: 'hello' });
470
-
471
- this.render('{{foo-bar class=(if fooBar "foo-bar")}}', {
472
- fooBar: true,
473
- });
474
-
475
- this.assertComponentElement(this.firstChild, {
476
- content: 'hello',
477
- attrs: { class: classes('ember-view foo-bar') },
478
- });
479
-
480
- this.runTask(() => this.rerender());
481
-
482
- this.assertComponentElement(this.firstChild, {
483
- content: 'hello',
484
- attrs: { class: classes('ember-view foo-bar') },
485
- });
486
-
487
- this.runTask(() => set(this.context, 'fooBar', false));
488
-
489
- this.assertComponentElement(this.firstChild, {
490
- content: 'hello',
491
- attrs: { class: classes('ember-view') },
492
- });
493
-
494
- this.runTask(() => set(this.context, 'fooBar', true));
495
-
496
- this.assertComponentElement(this.firstChild, {
497
- content: 'hello',
498
- attrs: { class: classes('ember-view foo-bar') },
499
- });
500
- }
501
-
502
- ['@test it can have custom classNames from constructor']() {
503
- let FooBarComponent = Component.extend({
504
- init() {
505
- this._super();
506
- this.classNames = this.classNames.slice();
507
- this.classNames.push('foo', 'bar', `outside-${this.get('extraClass')}`);
508
- },
509
- });
510
-
511
- this.registerComponent('foo-bar', {
512
- ComponentClass: FooBarComponent,
513
- template: 'hello',
514
- });
515
-
516
- this.render('{{foo-bar extraClass="baz"}}');
517
-
518
- this.assertComponentElement(this.firstChild, {
519
- tagName: 'div',
520
- attrs: { class: classes('ember-view foo bar outside-baz') },
521
- content: 'hello',
522
- });
523
-
524
- this.runTask(() => this.rerender());
525
-
526
- this.assertComponentElement(this.firstChild, {
527
- tagName: 'div',
528
- attrs: { class: classes('ember-view foo bar outside-baz') },
529
- content: 'hello',
530
- });
531
- }
532
-
533
- ['@test it can set custom classNames from the invocation']() {
534
- let FooBarComponent = Component.extend({
535
- classNames: ['foo'],
536
- });
537
-
538
- this.registerComponent('foo-bar', {
539
- ComponentClass: FooBarComponent,
540
- template: 'hello',
541
- });
542
-
543
- this.render(strip`
544
- {{foo-bar class="bar baz"}}
545
- {{foo-bar classNames="bar baz"}}
546
- {{foo-bar}}
547
- `);
548
-
549
- this.assertComponentElement(this.nthChild(0), {
550
- tagName: 'div',
551
- attrs: { class: classes('ember-view foo bar baz') },
552
- content: 'hello',
553
- });
554
- this.assertComponentElement(this.nthChild(1), {
555
- tagName: 'div',
556
- attrs: { class: classes('ember-view foo bar baz') },
557
- content: 'hello',
558
- });
559
- this.assertComponentElement(this.nthChild(2), {
560
- tagName: 'div',
561
- attrs: { class: classes('ember-view foo') },
562
- content: 'hello',
563
- });
564
-
565
- this.runTask(() => this.rerender());
566
-
567
- this.assertComponentElement(this.nthChild(0), {
568
- tagName: 'div',
569
- attrs: { class: classes('ember-view foo bar baz') },
570
- content: 'hello',
571
- });
572
- this.assertComponentElement(this.nthChild(1), {
573
- tagName: 'div',
574
- attrs: { class: classes('ember-view foo bar baz') },
575
- content: 'hello',
576
- });
577
- this.assertComponentElement(this.nthChild(2), {
578
- tagName: 'div',
579
- attrs: { class: classes('ember-view foo') },
580
- content: 'hello',
581
- });
582
- }
583
-
584
- ['@test it has an element']() {
585
- let instance;
586
-
587
- let FooBarComponent = Component.extend({
588
- init() {
589
- this._super();
590
- instance = this;
591
- },
592
- });
593
-
594
- this.registerComponent('foo-bar', {
595
- ComponentClass: FooBarComponent,
596
- template: 'hello',
597
- });
598
-
599
- this.render('{{foo-bar}}');
600
-
601
- let element1 = instance.element;
602
-
603
- this.assertComponentElement(element1, { content: 'hello' });
604
-
605
- this.runTask(() => this.rerender());
606
-
607
- let element2 = instance.element;
608
-
609
- this.assertComponentElement(element2, { content: 'hello' });
610
-
611
- this.assertSameNode(element2, element1);
612
- }
613
-
614
- ['@test an empty component does not have childNodes'](assert) {
615
- let fooBarInstance;
616
- let FooBarComponent = Component.extend({
617
- tagName: 'input',
618
- init() {
619
- this._super();
620
- fooBarInstance = this;
621
- },
622
- });
623
-
624
- this.registerComponent('foo-bar', {
625
- ComponentClass: FooBarComponent,
626
- template: '',
627
- });
628
-
629
- this.render('{{foo-bar}}');
630
-
631
- this.assertComponentElement(this.firstChild, { tagName: 'input' });
632
-
633
- assert.strictEqual(fooBarInstance.element.childNodes.length, 0);
634
-
635
- this.runTask(() => this.rerender());
636
-
637
- this.assertComponentElement(this.firstChild, { tagName: 'input' });
638
-
639
- assert.strictEqual(fooBarInstance.element.childNodes.length, 0);
640
- }
641
-
642
- ['@test it has the right parentView and childViews'](assert) {
643
- let fooBarInstance, fooBarBazInstance;
644
-
645
- let FooBarComponent = Component.extend({
646
- init() {
647
- this._super();
648
- fooBarInstance = this;
649
- },
650
- });
651
-
652
- let FooBarBazComponent = Component.extend({
653
- init() {
654
- this._super();
655
- fooBarBazInstance = this;
656
- },
657
- });
658
-
659
- this.registerComponent('foo-bar', {
660
- ComponentClass: FooBarComponent,
661
- template: 'foo-bar {{foo-bar-baz}}',
662
- });
663
- this.registerComponent('foo-bar-baz', {
664
- ComponentClass: FooBarBazComponent,
665
- template: 'foo-bar-baz',
666
- });
667
-
668
- this.render('{{foo-bar}}');
669
- this.assertText('foo-bar foo-bar-baz');
670
-
671
- assert.equal(fooBarInstance.parentView, this.component);
672
- assert.equal(fooBarBazInstance.parentView, fooBarInstance);
673
-
674
- assert.deepEqual(this.component.childViews, [fooBarInstance]);
675
- assert.deepEqual(fooBarInstance.childViews, [fooBarBazInstance]);
676
-
677
- this.runTask(() => this.rerender());
678
- this.assertText('foo-bar foo-bar-baz');
679
-
680
- assert.equal(fooBarInstance.parentView, this.component);
681
- assert.equal(fooBarBazInstance.parentView, fooBarInstance);
682
-
683
- assert.deepEqual(this.component.childViews, [fooBarInstance]);
684
- assert.deepEqual(fooBarInstance.childViews, [fooBarBazInstance]);
685
- }
686
-
687
- ['@feature(ember-glimmer-named-arguments) it renders passed named arguments']() {
688
- this.registerComponent('foo-bar', {
689
- template: '{{@foo}}',
690
- });
691
-
692
- this.render('{{foo-bar foo=model.bar}}', {
693
- model: {
694
- bar: 'Hola',
695
- },
696
- });
697
-
698
- this.assertText('Hola');
699
-
700
- this.runTask(() => this.rerender());
701
-
702
- this.assertText('Hola');
703
-
704
- this.runTask(() => this.context.set('model.bar', 'Hello'));
705
-
706
- this.assertText('Hello');
707
-
708
- this.runTask(() => this.context.set('model', { bar: 'Hola' }));
709
-
710
- this.assertText('Hola');
711
- }
712
-
713
- ['@test it reflects named arguments as properties']() {
714
- this.registerComponent('foo-bar', {
715
- template: '{{foo}}',
716
- });
717
-
718
- this.render('{{foo-bar foo=model.bar}}', {
719
- model: {
720
- bar: 'Hola',
721
- },
722
- });
723
-
724
- this.assertText('Hola');
725
-
726
- this.runTask(() => this.rerender());
727
-
728
- this.assertText('Hola');
729
-
730
- this.runTask(() => this.context.set('model.bar', 'Hello'));
731
-
732
- this.assertText('Hello');
733
-
734
- this.runTask(() => this.context.set('model', { bar: 'Hola' }));
735
-
736
- this.assertText('Hola');
737
- }
738
-
739
- ['@test it can render a basic component with a block']() {
740
- this.registerComponent('foo-bar', {
741
- template: '{{yield}} - In component',
742
- });
743
-
744
- this.render('{{#foo-bar}}hello{{/foo-bar}}');
745
-
746
- this.assertComponentElement(this.firstChild, {
747
- content: 'hello - In component',
748
- });
749
-
750
- this.runTask(() => this.rerender());
751
-
752
- this.assertComponentElement(this.firstChild, {
753
- content: 'hello - In component',
754
- });
755
- }
756
-
757
- ['@test it can render a basic component with a block when the yield is in a partial']() {
758
- this.registerPartial('_partialWithYield', 'yielded: [{{yield}}]');
759
-
760
- this.registerComponent('foo-bar', {
761
- template: '{{partial "partialWithYield"}} - In component',
762
- });
763
-
764
- this.render('{{#foo-bar}}hello{{/foo-bar}}');
765
-
766
- this.assertComponentElement(this.firstChild, {
767
- content: 'yielded: [hello] - In component',
768
- });
769
-
770
- this.runTask(() => this.rerender());
771
-
772
- this.assertComponentElement(this.firstChild, {
773
- content: 'yielded: [hello] - In component',
774
- });
775
- }
776
-
777
- ['@test it can render a basic component with a block param when the yield is in a partial']() {
778
- this.registerPartial('_partialWithYield', 'yielded: [{{yield "hello"}}]');
779
-
780
- this.registerComponent('foo-bar', {
781
- template: '{{partial "partialWithYield"}} - In component',
782
- });
783
-
784
- this.render('{{#foo-bar as |value|}}{{value}}{{/foo-bar}}');
785
-
786
- this.assertComponentElement(this.firstChild, {
787
- content: 'yielded: [hello] - In component',
788
- });
789
-
790
- this.runTask(() => this.rerender());
791
-
792
- this.assertComponentElement(this.firstChild, {
793
- content: 'yielded: [hello] - In component',
794
- });
795
- }
796
-
797
- ['@test it renders the layout with the component instance as the context']() {
798
- let instance;
799
-
800
- let FooBarComponent = Component.extend({
801
- init() {
802
- this._super();
803
- instance = this;
804
- this.set('message', 'hello');
805
- },
806
- });
807
-
808
- this.registerComponent('foo-bar', {
809
- ComponentClass: FooBarComponent,
810
- template: '{{message}}',
811
- });
812
-
813
- this.render('{{foo-bar}}');
814
-
815
- this.assertComponentElement(this.firstChild, { content: 'hello' });
816
-
817
- this.runTask(() => this.rerender());
818
-
819
- this.assertComponentElement(this.firstChild, { content: 'hello' });
820
-
821
- this.runTask(() => set(instance, 'message', 'goodbye'));
822
-
823
- this.assertComponentElement(this.firstChild, { content: 'goodbye' });
824
-
825
- this.runTask(() => set(instance, 'message', 'hello'));
826
-
827
- this.assertComponentElement(this.firstChild, { content: 'hello' });
828
- }
829
-
830
- ['@test it preserves the outer context when yielding']() {
831
- this.registerComponent('foo-bar', { template: '{{yield}}' });
832
-
833
- this.render('{{#foo-bar}}{{message}}{{/foo-bar}}', { message: 'hello' });
834
-
835
- this.assertComponentElement(this.firstChild, { content: 'hello' });
836
-
837
- this.runTask(() => this.rerender());
838
-
839
- this.assertComponentElement(this.firstChild, { content: 'hello' });
840
-
841
- this.runTask(() => set(this.context, 'message', 'goodbye'));
842
-
843
- this.assertComponentElement(this.firstChild, { content: 'goodbye' });
844
-
845
- this.runTask(() => set(this.context, 'message', 'hello'));
846
-
847
- this.assertComponentElement(this.firstChild, { content: 'hello' });
848
- }
849
-
850
- ['@test it can yield a block param named for reserved words [GH#14096]']() {
851
- let instance;
852
-
853
- let FooBarComponent = Component.extend({
854
- init() {
855
- this._super(...arguments);
856
- instance = this;
857
- },
858
-
859
- name: 'foo-bar',
860
- });
861
-
862
- this.registerComponent('foo-bar', {
863
- ComponentClass: FooBarComponent,
864
- template: '{{yield this}}',
865
- });
866
-
867
- this.render('{{#foo-bar as |component|}}{{component.name}}{{/foo-bar}}');
868
-
869
- this.assertComponentElement(this.firstChild, { content: 'foo-bar' });
870
-
871
- this.assertStableRerender();
872
-
873
- this.runTask(() => set(instance, 'name', 'derp-qux'));
874
-
875
- this.assertComponentElement(this.firstChild, { content: 'derp-qux' });
876
-
877
- this.runTask(() => set(instance, 'name', 'foo-bar'));
878
-
879
- this.assertComponentElement(this.firstChild, { content: 'foo-bar' });
880
- }
881
-
882
- ['@test it can yield internal and external properties positionally']() {
883
- let instance;
884
-
885
- let FooBarComponent = Component.extend({
886
- init() {
887
- this._super(...arguments);
888
- instance = this;
889
- },
890
- greeting: 'hello',
891
- });
892
-
893
- this.registerComponent('foo-bar', {
894
- ComponentClass: FooBarComponent,
895
- template: '{{yield greeting greetee.firstName}}',
896
- });
897
-
898
- this.render(
899
- '{{#foo-bar greetee=person as |greeting name|}}{{name}} {{person.lastName}}, {{greeting}}{{/foo-bar}}',
900
- {
901
- person: {
902
- firstName: 'Joel',
903
- lastName: 'Kang',
904
- },
905
- }
906
- );
907
-
908
- this.assertComponentElement(this.firstChild, {
909
- content: 'Joel Kang, hello',
910
- });
911
-
912
- this.runTask(() => this.rerender());
913
-
914
- this.assertComponentElement(this.firstChild, {
915
- content: 'Joel Kang, hello',
916
- });
917
-
918
- this.runTask(() =>
919
- set(this.context, 'person', {
920
- firstName: 'Dora',
921
- lastName: 'the Explorer',
922
- })
923
- );
924
-
925
- this.assertComponentElement(this.firstChild, {
926
- content: 'Dora the Explorer, hello',
927
- });
928
-
929
- this.runTask(() => set(instance, 'greeting', 'hola'));
930
-
931
- this.assertComponentElement(this.firstChild, {
932
- content: 'Dora the Explorer, hola',
933
- });
934
-
935
- this.runTask(() => {
936
- set(instance, 'greeting', 'hello');
937
- set(this.context, 'person', {
938
- firstName: 'Joel',
939
- lastName: 'Kang',
940
- });
941
- });
942
-
943
- this.assertComponentElement(this.firstChild, {
944
- content: 'Joel Kang, hello',
945
- });
946
- }
947
-
948
- ['@test #11519 - block param infinite loop']() {
949
- let instance;
950
- let FooBarComponent = Component.extend({
951
- init() {
952
- this._super(...arguments);
953
- instance = this;
954
- },
955
- danger: 0,
956
- });
957
-
958
- this.registerComponent('foo-bar', {
959
- ComponentClass: FooBarComponent,
960
- template: '{{danger}}{{yield danger}}',
961
- });
962
-
963
- // On initial render, create streams. The bug will not have manifested yet, but at this point
964
- // we have created streams that create a circular invalidation.
965
- this.render(`{{#foo-bar as |dangerBlockParam|}}{{/foo-bar}}`);
966
-
967
- this.assertText('0');
968
-
969
- // Trigger a non-revalidating re-render. The yielded block will not be dirtied
970
- // nor will block param streams, and thus no infinite loop will occur.
971
- this.runTask(() => this.rerender());
972
-
973
- this.assertText('0');
974
-
975
- // Trigger a revalidation, which will cause an infinite loop without the fix
976
- // in place. Note that we do not see the infinite loop is in testing mode,
977
- // because a deprecation warning about re-renders is issued, which Ember
978
- // treats as an exception.
979
- this.runTask(() => set(instance, 'danger', 1));
980
-
981
- this.assertText('1');
982
-
983
- this.runTask(() => set(instance, 'danger', 0));
984
-
985
- this.assertText('0');
986
- }
987
-
988
- ['@test the component and its child components are destroyed'](assert) {
989
- let destroyed = { 1: 0, 2: 0, 3: 0, 4: 0, 5: 0, 6: 0, 7: 0, 8: 0 };
990
-
991
- this.registerComponent('foo-bar', {
992
- template: '{{id}} {{yield}}',
993
- ComponentClass: Component.extend({
994
- willDestroy() {
995
- this._super();
996
- destroyed[this.get('id')]++;
997
- },
998
- }),
999
- });
1000
-
1001
- this.render(
1002
- strip`
1003
- {{#if cond1}}
1004
- {{#foo-bar id=1}}
1005
- {{#if cond2}}
1006
- {{#foo-bar id=2}}{{/foo-bar}}
1007
- {{#if cond3}}
1008
- {{#foo-bar id=3}}
1009
- {{#if cond4}}
1010
- {{#foo-bar id=4}}
1011
- {{#if cond5}}
1012
- {{#foo-bar id=5}}{{/foo-bar}}
1013
- {{#foo-bar id=6}}{{/foo-bar}}
1014
- {{#foo-bar id=7}}{{/foo-bar}}
1015
- {{/if}}
1016
- {{#foo-bar id=8}}{{/foo-bar}}
1017
- {{/foo-bar}}
1018
- {{/if}}
1019
- {{/foo-bar}}
1020
- {{/if}}
1021
- {{/if}}
1022
- {{/foo-bar}}
1023
- {{/if}}`,
1024
- {
1025
- cond1: true,
1026
- cond2: true,
1027
- cond3: true,
1028
- cond4: true,
1029
- cond5: true,
1030
- }
1031
- );
1032
-
1033
- this.assertText('1 2 3 4 5 6 7 8 ');
1034
-
1035
- this.runTask(() => this.rerender());
1036
-
1037
- assert.deepEqual(destroyed, {
1038
- 1: 0,
1039
- 2: 0,
1040
- 3: 0,
1041
- 4: 0,
1042
- 5: 0,
1043
- 6: 0,
1044
- 7: 0,
1045
- 8: 0,
1046
- });
1047
-
1048
- this.runTask(() => set(this.context, 'cond5', false));
1049
-
1050
- this.assertText('1 2 3 4 8 ');
1051
-
1052
- assert.deepEqual(destroyed, {
1053
- 1: 0,
1054
- 2: 0,
1055
- 3: 0,
1056
- 4: 0,
1057
- 5: 1,
1058
- 6: 1,
1059
- 7: 1,
1060
- 8: 0,
1061
- });
1062
-
1063
- this.runTask(() => {
1064
- set(this.context, 'cond3', false);
1065
- set(this.context, 'cond5', true);
1066
- set(this.context, 'cond4', false);
1067
- });
1068
-
1069
- assert.deepEqual(destroyed, {
1070
- 1: 0,
1071
- 2: 0,
1072
- 3: 1,
1073
- 4: 1,
1074
- 5: 1,
1075
- 6: 1,
1076
- 7: 1,
1077
- 8: 1,
1078
- });
1079
-
1080
- this.runTask(() => {
1081
- set(this.context, 'cond2', false);
1082
- set(this.context, 'cond1', false);
1083
- });
1084
-
1085
- assert.deepEqual(destroyed, {
1086
- 1: 1,
1087
- 2: 1,
1088
- 3: 1,
1089
- 4: 1,
1090
- 5: 1,
1091
- 6: 1,
1092
- 7: 1,
1093
- 8: 1,
1094
- });
1095
- }
1096
-
1097
- ['@test should escape HTML in normal mustaches']() {
1098
- let component;
1099
- let FooBarComponent = Component.extend({
1100
- init() {
1101
- this._super(...arguments);
1102
- component = this;
1103
- },
1104
- output: 'you need to be more <b>bold</b>',
1105
- });
1106
-
1107
- this.registerComponent('foo-bar', {
1108
- ComponentClass: FooBarComponent,
1109
- template: '{{output}}',
1110
- });
1111
-
1112
- this.render('{{foo-bar}}');
1113
-
1114
- this.assertText('you need to be more <b>bold</b>');
1115
-
1116
- this.runTask(() => this.rerender());
1117
-
1118
- this.assertText('you need to be more <b>bold</b>');
1119
-
1120
- this.runTask(() => set(component, 'output', 'you are so <i>super</i>'));
1121
-
1122
- this.assertText('you are so <i>super</i>');
1123
-
1124
- this.runTask(() => set(component, 'output', 'you need to be more <b>bold</b>'));
1125
- }
1126
-
1127
- ['@test should not escape HTML in triple mustaches']() {
1128
- let expectedHtmlBold = 'you need to be more <b>bold</b>';
1129
- let expectedHtmlItalic = 'you are so <i>super</i>';
1130
- let component;
1131
- let FooBarComponent = Component.extend({
1132
- init() {
1133
- this._super(...arguments);
1134
- component = this;
1135
- },
1136
- output: expectedHtmlBold,
1137
- });
1138
-
1139
- this.registerComponent('foo-bar', {
1140
- ComponentClass: FooBarComponent,
1141
- template: '{{{output}}}',
1142
- });
1143
-
1144
- this.render('{{foo-bar}}');
1145
-
1146
- equalTokens(this.firstChild, expectedHtmlBold);
1147
-
1148
- this.runTask(() => this.rerender());
1149
-
1150
- equalTokens(this.firstChild, expectedHtmlBold);
1151
-
1152
- this.runTask(() => set(component, 'output', expectedHtmlItalic));
1153
-
1154
- equalTokens(this.firstChild, expectedHtmlItalic);
1155
-
1156
- this.runTask(() => set(component, 'output', expectedHtmlBold));
1157
-
1158
- equalTokens(this.firstChild, expectedHtmlBold);
1159
- }
1160
-
1161
- ['@test should not escape HTML if string is a htmlSafe']() {
1162
- let expectedHtmlBold = 'you need to be more <b>bold</b>';
1163
- let expectedHtmlItalic = 'you are so <i>super</i>';
1164
- let component;
1165
- let FooBarComponent = Component.extend({
1166
- init() {
1167
- this._super(...arguments);
1168
- component = this;
1169
- },
1170
- output: htmlSafe(expectedHtmlBold),
1171
- });
1172
-
1173
- this.registerComponent('foo-bar', {
1174
- ComponentClass: FooBarComponent,
1175
- template: '{{output}}',
1176
- });
1177
-
1178
- this.render('{{foo-bar}}');
1179
-
1180
- equalTokens(this.firstChild, expectedHtmlBold);
1181
-
1182
- this.runTask(() => this.rerender());
1183
-
1184
- equalTokens(this.firstChild, expectedHtmlBold);
1185
-
1186
- this.runTask(() => set(component, 'output', htmlSafe(expectedHtmlItalic)));
1187
-
1188
- equalTokens(this.firstChild, expectedHtmlItalic);
1189
-
1190
- this.runTask(() => set(component, 'output', htmlSafe(expectedHtmlBold)));
1191
-
1192
- equalTokens(this.firstChild, expectedHtmlBold);
1193
- }
1194
-
1195
- ['@test late bound layouts return the same definition'](assert) {
1196
- let templateIds = [];
1197
-
1198
- // This is testing the scenario where you import a template and
1199
- // set it to the layout property:
1200
- //
1201
- // import Component from '@ember/component';
1202
- // import layout from './template';
1203
- //
1204
- // export default Component.extend({
1205
- // layout
1206
- // });
1207
- let hello = compile('Hello');
1208
- let bye = compile('Bye');
1209
-
1210
- let FooBarComponent = Component.extend({
1211
- init() {
1212
- this._super(...arguments);
1213
- this.layout = this.cond ? hello : bye;
1214
- templateIds.push(this.layout.id);
1215
- },
1216
- });
1217
-
1218
- this.registerComponent('foo-bar', { ComponentClass: FooBarComponent });
1219
-
1220
- this.render(
1221
- '{{foo-bar cond=true}}{{foo-bar cond=false}}{{foo-bar cond=true}}{{foo-bar cond=false}}'
1222
- );
1223
-
1224
- let [t1, t2, t3, t4] = templateIds;
1225
- assert.equal(t1, t3);
1226
- assert.equal(t2, t4);
1227
- }
1228
-
1229
- ['@test can use isStream property without conflict (#13271)']() {
1230
- let component;
1231
- let FooBarComponent = Component.extend({
1232
- isStream: true,
1233
-
1234
- init() {
1235
- this._super(...arguments);
1236
- component = this;
1237
- },
1238
- });
1239
-
1240
- this.registerComponent('foo-bar', {
1241
- ComponentClass: FooBarComponent,
1242
-
1243
- template: strip`
1244
- {{#if isStream}}
1245
- true
1246
- {{else}}
1247
- false
1248
- {{/if}}
1249
- `,
1250
- });
1251
-
1252
- this.render('{{foo-bar}}');
1253
-
1254
- this.assertComponentElement(this.firstChild, { content: 'true' });
1255
-
1256
- this.runTask(() => this.rerender());
1257
-
1258
- this.assertComponentElement(this.firstChild, { content: 'true' });
1259
-
1260
- this.runTask(() => set(component, 'isStream', false));
1261
-
1262
- this.assertComponentElement(this.firstChild, { content: 'false' });
1263
-
1264
- this.runTask(() => set(component, 'isStream', true));
1265
-
1266
- this.assertComponentElement(this.firstChild, { content: 'true' });
1267
- }
1268
- ['@test lookup of component takes priority over property']() {
1269
- this.registerComponent('some-component', {
1270
- template: 'some-component',
1271
- });
1272
-
1273
- this.render('{{some-prop}} {{some-component}}', {
1274
- 'some-component': 'not-some-component',
1275
- 'some-prop': 'some-prop',
1276
- });
1277
-
1278
- this.assertText('some-prop some-component');
1279
-
1280
- this.runTask(() => this.rerender());
1281
-
1282
- this.assertText('some-prop some-component');
1283
- }
1284
-
1285
- ['@test component without dash is not looked up']() {
1286
- this.registerComponent('somecomponent', {
1287
- template: 'somecomponent',
1288
- });
1289
-
1290
- this.render('{{somecomponent}}', {
1291
- somecomponent: 'notsomecomponent',
1292
- });
1293
-
1294
- this.assertText('notsomecomponent');
1295
-
1296
- this.runTask(() => this.rerender());
1297
-
1298
- this.assertText('notsomecomponent');
1299
-
1300
- this.runTask(() => this.context.set('somecomponent', 'not not notsomecomponent'));
1301
-
1302
- this.assertText('not not notsomecomponent');
1303
-
1304
- this.runTask(() => this.context.set('somecomponent', 'notsomecomponent'));
1305
-
1306
- this.assertText('notsomecomponent');
1307
- }
1308
-
1309
- ['@test non-block with properties on attrs']() {
1310
- this.registerComponent('non-block', {
1311
- template: 'In layout - someProp: {{attrs.someProp}}',
1312
- });
1313
-
1314
- this.render('{{non-block someProp=prop}}', {
1315
- prop: 'something here',
1316
- });
1317
-
1318
- this.assertText('In layout - someProp: something here');
1319
-
1320
- this.runTask(() => this.rerender());
1321
-
1322
- this.assertText('In layout - someProp: something here');
1323
-
1324
- this.runTask(() => this.context.set('prop', 'other thing there'));
1325
-
1326
- this.assertText('In layout - someProp: other thing there');
1327
-
1328
- this.runTask(() => this.context.set('prop', 'something here'));
1329
-
1330
- this.assertText('In layout - someProp: something here');
1331
- }
1332
-
1333
- ['@feature(ember-glimmer-named-arguments) non-block with named argument']() {
1334
- this.registerComponent('non-block', {
1335
- template: 'In layout - someProp: {{@someProp}}',
1336
- });
1337
-
1338
- this.render('{{non-block someProp=prop}}', {
1339
- prop: 'something here',
1340
- });
1341
-
1342
- this.assertText('In layout - someProp: something here');
1343
-
1344
- this.runTask(() => this.rerender());
1345
-
1346
- this.assertText('In layout - someProp: something here');
1347
-
1348
- this.runTask(() => this.context.set('prop', 'other thing there'));
1349
-
1350
- this.assertText('In layout - someProp: other thing there');
1351
-
1352
- this.runTask(() => this.context.set('prop', 'something here'));
1353
-
1354
- this.assertText('In layout - someProp: something here');
1355
- }
1356
-
1357
- ['@test non-block with properties overridden in init']() {
1358
- let instance;
1359
- this.registerComponent('non-block', {
1360
- ComponentClass: Component.extend({
1361
- init() {
1362
- this._super(...arguments);
1363
- instance = this;
1364
- this.someProp = 'value set in instance';
1365
- },
1366
- }),
1367
- template: 'In layout - someProp: {{someProp}}',
1368
- });
1369
-
1370
- this.render('{{non-block someProp=prop}}', {
1371
- prop: 'something passed when invoked',
1372
- });
1373
-
1374
- this.assertText('In layout - someProp: value set in instance');
1375
-
1376
- this.runTask(() => this.rerender());
1377
-
1378
- this.assertText('In layout - someProp: value set in instance');
1379
-
1380
- this.runTask(() => this.context.set('prop', 'updated something passed when invoked'));
1381
-
1382
- this.assertText('In layout - someProp: updated something passed when invoked');
1383
-
1384
- this.runTask(() => instance.set('someProp', 'update value set in instance'));
1385
-
1386
- this.assertText('In layout - someProp: update value set in instance');
1387
-
1388
- this.runTask(() => this.context.set('prop', 'something passed when invoked'));
1389
- this.runTask(() => instance.set('someProp', 'value set in instance'));
1390
-
1391
- this.assertText('In layout - someProp: value set in instance');
1392
- }
1393
-
1394
- ['@test rerendering component with attrs from parent'](assert) {
1395
- let willUpdateCount = 0;
1396
- let didReceiveAttrsCount = 0;
1397
-
1398
- function expectHooks({ willUpdate, didReceiveAttrs }, callback) {
1399
- willUpdateCount = 0;
1400
- didReceiveAttrsCount = 0;
1401
-
1402
- callback();
1403
-
1404
- if (willUpdate) {
1405
- assert.strictEqual(willUpdateCount, 1, 'The willUpdate hook was fired');
1406
- } else {
1407
- assert.strictEqual(willUpdateCount, 0, 'The willUpdate hook was not fired');
1408
- }
1409
-
1410
- if (didReceiveAttrs) {
1411
- assert.strictEqual(didReceiveAttrsCount, 1, 'The didReceiveAttrs hook was fired');
1412
- } else {
1413
- assert.strictEqual(didReceiveAttrsCount, 0, 'The didReceiveAttrs hook was not fired');
1414
- }
1415
- }
1416
-
1417
- this.registerComponent('non-block', {
1418
- ComponentClass: Component.extend({
1419
- didReceiveAttrs() {
1420
- didReceiveAttrsCount++;
1421
- },
1422
-
1423
- willUpdate() {
1424
- willUpdateCount++;
1425
- },
1426
- }),
1427
- template: 'In layout - someProp: {{someProp}}',
1428
- });
1429
-
1430
- expectHooks({ willUpdate: false, didReceiveAttrs: true }, () => {
1431
- this.render('{{non-block someProp=someProp}}', {
1432
- someProp: 'wycats',
1433
- });
1434
- });
1435
-
1436
- this.assertText('In layout - someProp: wycats');
1437
-
1438
- // Note: Hooks are not fired in Glimmer for idempotent re-renders
1439
- expectHooks({ willUpdate: false, didReceiveAttrs: false }, () => {
1440
- this.runTask(() => this.rerender());
1441
- });
1442
-
1443
- this.assertText('In layout - someProp: wycats');
1444
-
1445
- expectHooks({ willUpdate: true, didReceiveAttrs: true }, () => {
1446
- this.runTask(() => this.context.set('someProp', 'tomdale'));
1447
- });
1448
-
1449
- this.assertText('In layout - someProp: tomdale');
1450
-
1451
- // Note: Hooks are not fired in Glimmer for idempotent re-renders
1452
- expectHooks({ willUpdate: false, didReceiveAttrs: false }, () => {
1453
- this.runTask(() => this.rerender());
1454
- });
1455
-
1456
- this.assertText('In layout - someProp: tomdale');
1457
-
1458
- expectHooks({ willUpdate: true, didReceiveAttrs: true }, () => {
1459
- this.runTask(() => this.context.set('someProp', 'wycats'));
1460
- });
1461
-
1462
- this.assertText('In layout - someProp: wycats');
1463
- }
1464
-
1465
- ['@feature(!ember-glimmer-named-arguments) this.attrs.foo === attrs.foo === foo']() {
1466
- this.registerComponent('foo-bar', {
1467
- template: strip`
1468
- Args: {{this.attrs.value}} | {{attrs.value}} | {{value}}
1469
- {{#each this.attrs.items as |item|}}
1470
- {{item}}
1471
- {{/each}}
1472
- {{#each attrs.items as |item|}}
1473
- {{item}}
1474
- {{/each}}
1475
- {{#each items as |item|}}
1476
- {{item}}
1477
- {{/each}}
1478
- `,
1479
- });
1480
-
1481
- this.render('{{foo-bar value=model.value items=model.items}}', {
1482
- model: {
1483
- value: 'wat',
1484
- items: [1, 2, 3],
1485
- },
1486
- });
1487
-
1488
- this.assertStableRerender();
1489
-
1490
- this.runTask(() => {
1491
- this.context.set('model.value', 'lul');
1492
- this.context.set('model.items', [1]);
1493
- });
1494
-
1495
- this.assertText(strip`Args: lul | lul | lul111`);
1496
-
1497
- this.runTask(() => this.context.set('model', { value: 'wat', items: [1, 2, 3] }));
1498
-
1499
- this.assertText('Args: wat | wat | wat123123123');
1500
- }
1501
-
1502
- ['@feature(ember-glimmer-named-arguments) this.attrs.foo === attrs.foo === @foo === foo']() {
1503
- this.registerComponent('foo-bar', {
1504
- template: strip`
1505
- Args: {{this.attrs.value}} | {{attrs.value}} | {{@value}} | {{value}}
1506
- {{#each this.attrs.items as |item|}}
1507
- {{item}}
1508
- {{/each}}
1509
- {{#each attrs.items as |item|}}
1510
- {{item}}
1511
- {{/each}}
1512
- {{#each @items as |item|}}
1513
- {{item}}
1514
- {{/each}}
1515
- {{#each items as |item|}}
1516
- {{item}}
1517
- {{/each}}
1518
- `,
1519
- });
1520
-
1521
- this.render('{{foo-bar value=model.value items=model.items}}', {
1522
- model: {
1523
- value: 'wat',
1524
- items: [1, 2, 3],
1525
- },
1526
- });
1527
-
1528
- this.assertStableRerender();
1529
-
1530
- this.runTask(() => {
1531
- this.context.set('model.value', 'lul');
1532
- this.context.set('model.items', [1]);
1533
- });
1534
-
1535
- this.assertText(strip`Args: lul | lul | lul | lul1111`);
1536
-
1537
- this.runTask(() => this.context.set('model', { value: 'wat', items: [1, 2, 3] }));
1538
-
1539
- this.assertText('Args: wat | wat | wat | wat123123123123');
1540
- }
1541
-
1542
- ['@test non-block with properties on self']() {
1543
- this.registerComponent('non-block', {
1544
- template: 'In layout - someProp: {{someProp}}',
1545
- });
1546
-
1547
- this.render('{{non-block someProp=prop}}', {
1548
- prop: 'something here',
1549
- });
1550
-
1551
- this.assertText('In layout - someProp: something here');
1552
-
1553
- this.runTask(() => this.rerender());
1554
-
1555
- this.assertText('In layout - someProp: something here');
1556
-
1557
- this.runTask(() => this.context.set('prop', 'something else'));
1558
-
1559
- this.assertText('In layout - someProp: something else');
1560
-
1561
- this.runTask(() => this.context.set('prop', 'something here'));
1562
-
1563
- this.assertText('In layout - someProp: something here');
1564
- }
1565
-
1566
- ['@test block with properties on self']() {
1567
- this.registerComponent('with-block', {
1568
- template: 'In layout - someProp: {{someProp}} - {{yield}}',
1569
- });
1570
-
1571
- this.render(
1572
- strip`
1573
- {{#with-block someProp=prop}}
1574
- In template
1575
- {{/with-block}}`,
1576
- {
1577
- prop: 'something here',
1578
- }
1579
- );
1580
-
1581
- this.assertText('In layout - someProp: something here - In template');
1582
-
1583
- this.runTask(() => this.rerender());
1584
-
1585
- this.assertText('In layout - someProp: something here - In template');
1586
-
1587
- this.runTask(() => this.context.set('prop', 'something else'));
1588
-
1589
- this.assertText('In layout - someProp: something else - In template');
1590
-
1591
- this.runTask(() => this.context.set('prop', 'something here'));
1592
-
1593
- this.assertText('In layout - someProp: something here - In template');
1594
- }
1595
-
1596
- ['@test block with properties on attrs']() {
1597
- this.registerComponent('with-block', {
1598
- template: 'In layout - someProp: {{attrs.someProp}} - {{yield}}',
1599
- });
1600
-
1601
- this.render(
1602
- strip`
1603
- {{#with-block someProp=prop}}
1604
- In template
1605
- {{/with-block}}`,
1606
- {
1607
- prop: 'something here',
1608
- }
1609
- );
1610
-
1611
- this.assertText('In layout - someProp: something here - In template');
1612
-
1613
- this.runTask(() => this.rerender());
1614
-
1615
- this.assertText('In layout - someProp: something here - In template');
1616
-
1617
- this.runTask(() => this.context.set('prop', 'something else'));
1618
-
1619
- this.assertText('In layout - someProp: something else - In template');
1620
-
1621
- this.runTask(() => this.context.set('prop', 'something here'));
1622
-
1623
- this.assertText('In layout - someProp: something here - In template');
1624
- }
1625
-
1626
- ['@feature(ember-glimmer-named-arguments) block with named argument']() {
1627
- this.registerComponent('with-block', {
1628
- template: 'In layout - someProp: {{@someProp}} - {{yield}}',
1629
- });
1630
-
1631
- this.render(
1632
- strip`
1633
- {{#with-block someProp=prop}}
1634
- In template
1635
- {{/with-block}}`,
1636
- {
1637
- prop: 'something here',
1638
- }
1639
- );
1640
-
1641
- this.assertText('In layout - someProp: something here - In template');
1642
-
1643
- this.runTask(() => this.rerender());
1644
-
1645
- this.assertText('In layout - someProp: something here - In template');
1646
-
1647
- this.runTask(() => this.context.set('prop', 'something else'));
1648
-
1649
- this.assertText('In layout - someProp: something else - In template');
1650
-
1651
- this.runTask(() => this.context.set('prop', 'something here'));
1652
-
1653
- this.assertText('In layout - someProp: something here - In template');
1654
- }
1655
-
1656
- ['@test static arbitrary number of positional parameters'](assert) {
1657
- this.registerComponent('sample-component', {
1658
- ComponentClass: Component.extend().reopenClass({
1659
- positionalParams: 'names',
1660
- }),
1661
- template: strip`
1662
- {{#each names as |name|}}
1663
- {{name}}
1664
- {{/each}}`,
1665
- });
1666
-
1667
- this.render(strip`
1668
- {{sample-component "Foo" 4 "Bar" elementId="args-3"}}
1669
- {{sample-component "Foo" 4 "Bar" 5 "Baz" elementId="args-5"}}`);
1670
-
1671
- assert.equal(this.$('#args-3').text(), 'Foo4Bar');
1672
- assert.equal(this.$('#args-5').text(), 'Foo4Bar5Baz');
1673
-
1674
- this.runTask(() => this.rerender());
1675
-
1676
- assert.equal(this.$('#args-3').text(), 'Foo4Bar');
1677
- assert.equal(this.$('#args-5').text(), 'Foo4Bar5Baz');
1678
- }
1679
-
1680
- ['@test arbitrary positional parameter conflict with hash parameter is reported']() {
1681
- this.registerComponent('sample-component', {
1682
- ComponentClass: Component.extend().reopenClass({
1683
- positionalParams: 'names',
1684
- }),
1685
- template: strip`
1686
- {{#each names as |name|}}
1687
- {{name}}
1688
- {{/each}}`,
1689
- });
1690
-
1691
- expectAssertion(() => {
1692
- this.render(`{{sample-component "Foo" 4 "Bar" names=numbers id="args-3"}}`, {
1693
- numbers: [1, 2, 3],
1694
- });
1695
- }, 'You cannot specify positional parameters and the hash argument `names`.');
1696
- }
1697
-
1698
- ['@test can use hash parameter instead of arbitrary positional param [GH #12444]']() {
1699
- this.registerComponent('sample-component', {
1700
- ComponentClass: Component.extend().reopenClass({
1701
- positionalParams: 'names',
1702
- }),
1703
- template: strip`
1704
- {{#each names as |name|}}
1705
- {{name}}
1706
- {{/each}}`,
1707
- });
1708
-
1709
- this.render('{{sample-component names=things}}', {
1710
- things: emberA(['Foo', 4, 'Bar']),
1711
- });
1712
-
1713
- this.assertText('Foo4Bar');
1714
-
1715
- this.runTask(() => this.rerender());
1716
-
1717
- this.assertText('Foo4Bar');
1718
-
1719
- this.runTask(() => this.context.get('things').pushObject(5));
1720
-
1721
- this.assertText('Foo4Bar5');
1722
-
1723
- this.runTask(() => this.context.get('things').shiftObject());
1724
-
1725
- this.assertText('4Bar5');
1726
-
1727
- this.runTask(() => this.context.get('things').clear());
1728
-
1729
- this.assertText('');
1730
-
1731
- this.runTask(() => this.context.set('things', emberA(['Foo', 4, 'Bar'])));
1732
-
1733
- this.assertText('Foo4Bar');
1734
- }
1735
-
1736
- ['@test can use hash parameter instead of positional param'](assert) {
1737
- this.registerComponent('sample-component', {
1738
- ComponentClass: Component.extend().reopenClass({
1739
- positionalParams: ['first', 'second'],
1740
- }),
1741
- template: '{{first}} - {{second}}',
1742
- });
1743
-
1744
- // TODO: Fix when id is implemented
1745
- this.render(strip`
1746
- {{sample-component "one" "two" elementId="two-positional"}}
1747
- {{sample-component "one" second="two" elementId="one-positional"}}
1748
- {{sample-component first="one" second="two" elementId="no-positional"}}`);
1749
-
1750
- assert.equal(this.$('#two-positional').text(), 'one - two');
1751
- assert.equal(this.$('#one-positional').text(), 'one - two');
1752
- assert.equal(this.$('#no-positional').text(), 'one - two');
1753
-
1754
- this.runTask(() => this.rerender());
1755
-
1756
- assert.equal(this.$('#two-positional').text(), 'one - two');
1757
- assert.equal(this.$('#one-positional').text(), 'one - two');
1758
- assert.equal(this.$('#no-positional').text(), 'one - two');
1759
- }
1760
-
1761
- ['@test dynamic arbitrary number of positional parameters']() {
1762
- this.registerComponent('sample-component', {
1763
- ComponentClass: Component.extend().reopenClass({
1764
- positionalParams: 'n',
1765
- }),
1766
- template: strip`
1767
- {{#each n as |name|}}
1768
- {{name}}
1769
- {{/each}}`,
1770
- });
1771
-
1772
- this.render(`{{sample-component user1 user2}}`, {
1773
- user1: 'Foo',
1774
- user2: 4,
1775
- });
1776
-
1777
- this.assertText('Foo4');
1778
-
1779
- this.runTask(() => this.rerender());
1780
-
1781
- this.assertText('Foo4');
1782
-
1783
- this.runTask(() => this.context.set('user1', 'Bar'));
1784
-
1785
- this.assertText('Bar4');
1786
-
1787
- this.runTask(() => this.context.set('user2', '5'));
1788
-
1789
- this.assertText('Bar5');
1790
-
1791
- this.runTask(() => {
1792
- this.context.set('user1', 'Foo');
1793
- this.context.set('user2', 4);
1794
- });
1795
-
1796
- this.assertText('Foo4');
1797
- }
1798
-
1799
- ['@test with ariaRole specified']() {
1800
- this.registerComponent('aria-test', {
1801
- template: 'Here!',
1802
- });
1803
-
1804
- this.render('{{aria-test ariaRole=role}}', {
1805
- role: 'main',
1806
- });
1807
-
1808
- this.assertComponentElement(this.firstChild, { attrs: { role: 'main' } });
1809
-
1810
- this.runTask(() => this.rerender());
1811
-
1812
- this.assertComponentElement(this.firstChild, { attrs: { role: 'main' } });
1813
-
1814
- this.runTask(() => this.context.set('role', 'input'));
1815
-
1816
- this.assertComponentElement(this.firstChild, {
1817
- attrs: { role: 'input' },
1818
- });
1819
-
1820
- this.runTask(() => this.context.set('role', 'main'));
1821
-
1822
- this.assertComponentElement(this.firstChild, { attrs: { role: 'main' } });
1823
- }
1824
-
1825
- ['@test with ariaRole defined but initially falsey GH#16379']() {
1826
- this.registerComponent('aria-test', {
1827
- template: 'Here!',
1828
- });
1829
-
1830
- this.render('{{aria-test ariaRole=role}}', {
1831
- role: undefined,
1832
- });
1833
-
1834
- this.assertComponentElement(this.firstChild, { attrs: {} });
1835
-
1836
- this.runTask(() => this.rerender());
1837
-
1838
- this.assertComponentElement(this.firstChild, { attrs: {} });
1839
-
1840
- this.runTask(() => this.context.set('role', 'input'));
1841
-
1842
- this.assertComponentElement(this.firstChild, {
1843
- attrs: { role: 'input' },
1844
- });
1845
-
1846
- this.runTask(() => this.context.set('role', undefined));
1847
-
1848
- this.assertComponentElement(this.firstChild, { attrs: {} });
1849
- }
1850
-
1851
- ['@test without ariaRole defined initially']() {
1852
- // we are using the ability to lazily add a role as a sign that we are
1853
- // doing extra work
1854
- let instance;
1855
- this.registerComponent('aria-test', {
1856
- ComponentClass: Component.extend({
1857
- init() {
1858
- this._super(...arguments);
1859
- instance = this;
1860
- },
1861
- }),
1862
- template: 'Here!',
1863
- });
1864
-
1865
- this.render('{{aria-test}}');
1866
-
1867
- this.assertComponentElement(this.firstChild, { attrs: {} });
1868
-
1869
- this.runTask(() => this.rerender());
1870
-
1871
- this.assertComponentElement(this.firstChild, { attrs: {} });
1872
-
1873
- this.runTask(() => instance.set('ariaRole', 'input'));
1874
-
1875
- this.assertComponentElement(this.firstChild, { attrs: {} });
1876
- }
1877
-
1878
- ['@test `template` specified in component is overridden by block']() {
1879
- this.registerComponent('with-template', {
1880
- ComponentClass: Component.extend({
1881
- template: compile('Should not be used'),
1882
- }),
1883
- template: '[In layout - {{name}}] {{yield}}',
1884
- });
1885
-
1886
- this.render(
1887
- strip`
1888
- {{#with-template name="with-block"}}
1889
- [In block - {{name}}]
1890
- {{/with-template}}
1891
- {{with-template name="without-block"}}`,
1892
- {
1893
- name: 'Whoop, whoop!',
1894
- }
1895
- );
1896
-
1897
- this.assertText(
1898
- '[In layout - with-block] [In block - Whoop, whoop!][In layout - without-block] '
1899
- );
1900
-
1901
- this.runTask(() => this.rerender());
1902
-
1903
- this.assertText(
1904
- '[In layout - with-block] [In block - Whoop, whoop!][In layout - without-block] '
1905
- );
1906
-
1907
- this.runTask(() => this.context.set('name', 'Ole, ole'));
1908
-
1909
- this.assertText('[In layout - with-block] [In block - Ole, ole][In layout - without-block] ');
1910
-
1911
- this.runTask(() => this.context.set('name', 'Whoop, whoop!'));
1912
-
1913
- this.assertText(
1914
- '[In layout - with-block] [In block - Whoop, whoop!][In layout - without-block] '
1915
- );
1916
- }
1917
-
1918
- ['@test hasBlock is true when block supplied']() {
1919
- this.registerComponent('with-block', {
1920
- template: strip`
1921
- {{#if hasBlock}}
1922
- {{yield}}
1923
- {{else}}
1924
- No Block!
1925
- {{/if}}`,
1926
- });
1927
-
1928
- this.render(strip`
1929
- {{#with-block}}
1930
- In template
1931
- {{/with-block}}`);
1932
-
1933
- this.assertText('In template');
1934
-
1935
- this.runTask(() => this.rerender());
1936
-
1937
- this.assertText('In template');
1938
- }
1939
-
1940
- ['@test hasBlock is false when no block supplied']() {
1941
- this.registerComponent('with-block', {
1942
- template: strip`
1943
- {{#if hasBlock}}
1944
- {{yield}}
1945
- {{else}}
1946
- No Block!
1947
- {{/if}}`,
1948
- });
1949
-
1950
- this.render('{{with-block}}');
1951
-
1952
- this.assertText('No Block!');
1953
-
1954
- this.runTask(() => this.rerender());
1955
-
1956
- this.assertText('No Block!');
1957
- }
1958
-
1959
- ['@test hasBlockParams is true when block param supplied']() {
1960
- this.registerComponent('with-block', {
1961
- template: strip`
1962
- {{#if hasBlockParams}}
1963
- {{yield this}} - In Component
1964
- {{else}}
1965
- {{yield}} No Block!
1966
- {{/if}}`,
1967
- });
1968
-
1969
- this.render(strip`
1970
- {{#with-block as |something|}}
1971
- In template
1972
- {{/with-block}}`);
1973
-
1974
- this.assertText('In template - In Component');
1975
-
1976
- this.runTask(() => this.rerender());
1977
-
1978
- this.assertText('In template - In Component');
1979
- }
1980
-
1981
- ['@test hasBlockParams is false when no block param supplied']() {
1982
- this.registerComponent('with-block', {
1983
- template: strip`
1984
- {{#if hasBlockParams}}
1985
- {{yield this}}
1986
- {{else}}
1987
- {{yield}} No Block Param!
1988
- {{/if}}`,
1989
- });
1990
-
1991
- this.render(strip`
1992
- {{#with-block}}
1993
- In block
1994
- {{/with-block}}`);
1995
-
1996
- this.assertText('In block No Block Param!');
1997
-
1998
- this.runTask(() => this.rerender());
1999
-
2000
- this.assertText('In block No Block Param!');
2001
- }
2002
-
2003
- ['@test static named positional parameters']() {
2004
- this.registerComponent('sample-component', {
2005
- ComponentClass: Component.extend().reopenClass({
2006
- positionalParams: ['name', 'age'],
2007
- }),
2008
- template: '{{name}}{{age}}',
2009
- });
2010
-
2011
- this.render('{{sample-component "Quint" 4}}');
2012
-
2013
- this.assertText('Quint4');
2014
-
2015
- this.runTask(() => this.rerender());
2016
-
2017
- this.assertText('Quint4');
2018
- }
2019
-
2020
- ['@test dynamic named positional parameters']() {
2021
- this.registerComponent('sample-component', {
2022
- ComponentClass: Component.extend().reopenClass({
2023
- positionalParams: ['name', 'age'],
2024
- }),
2025
- template: '{{name}}{{age}}',
2026
- });
2027
-
2028
- this.render('{{sample-component myName myAge}}', {
2029
- myName: 'Quint',
2030
- myAge: 4,
2031
- });
2032
-
2033
- this.assertText('Quint4');
2034
-
2035
- this.runTask(() => this.rerender());
2036
-
2037
- this.assertText('Quint4');
2038
-
2039
- this.runTask(() => this.context.set('myName', 'Sergio'));
2040
-
2041
- this.assertText('Sergio4');
2042
-
2043
- this.runTask(() => this.context.set('myAge', 2));
2044
-
2045
- this.assertText('Sergio2');
2046
-
2047
- this.runTask(() => {
2048
- this.context.set('myName', 'Quint');
2049
- this.context.set('myAge', 4);
2050
- });
2051
-
2052
- this.assertText('Quint4');
2053
- }
2054
-
2055
- ['@test if a value is passed as a non-positional parameter, it raises an assertion']() {
2056
- this.registerComponent('sample-component', {
2057
- ComponentClass: Component.extend().reopenClass({
2058
- positionalParams: ['name'],
2059
- }),
2060
- template: '{{name}}',
2061
- });
2062
-
2063
- expectDeprecation(() => {
2064
- this.render('{{sample-component notMyName name=myName}}', {
2065
- myName: 'Quint',
2066
- notMyName: 'Sergio',
2067
- });
2068
- }, 'You cannot specify both a positional param (at position 0) and the hash argument `name`.');
2069
- }
2070
-
2071
- ['@test yield to inverse']() {
2072
- this.registerComponent('my-if', {
2073
- template: strip`
2074
- {{#if predicate}}
2075
- Yes:{{yield someValue}}
2076
- {{else}}
2077
- No:{{yield to="inverse"}}
2078
- {{/if}}`,
2079
- });
2080
-
2081
- this.render(
2082
- strip`
2083
- {{#my-if predicate=activated someValue=42 as |result|}}
2084
- Hello{{result}}
2085
- {{else}}
2086
- Goodbye
2087
- {{/my-if}}`,
2088
- {
2089
- activated: true,
2090
- }
2091
- );
2092
-
2093
- this.assertText('Yes:Hello42');
2094
-
2095
- this.runTask(() => this.rerender());
2096
-
2097
- this.assertText('Yes:Hello42');
2098
-
2099
- this.runTask(() => this.context.set('activated', false));
2100
-
2101
- this.assertText('No:Goodbye');
2102
-
2103
- this.runTask(() => this.context.set('activated', true));
2104
-
2105
- this.assertText('Yes:Hello42');
2106
- }
2107
-
2108
- ['@test expression hasBlock inverse']() {
2109
- this.registerComponent('check-inverse', {
2110
- template: strip`
2111
- {{#if (hasBlock "inverse")}}
2112
- Yes
2113
- {{else}}
2114
- No
2115
- {{/if}}`,
2116
- });
2117
-
2118
- this.render(strip`
2119
- {{#check-inverse}}{{/check-inverse}}
2120
- {{#check-inverse}}{{else}}{{/check-inverse}}`);
2121
-
2122
- this.assertComponentElement(this.firstChild, { content: 'No' });
2123
- this.assertComponentElement(this.nthChild(1), { content: 'Yes' });
2124
-
2125
- this.assertStableRerender();
2126
- }
2127
-
2128
- ['@test expression hasBlock default']() {
2129
- this.registerComponent('check-block', {
2130
- template: strip`
2131
- {{#if (hasBlock)}}
2132
- Yes
2133
- {{else}}
2134
- No
2135
- {{/if}}`,
2136
- });
2137
-
2138
- this.render(strip`
2139
- {{check-block}}
2140
- {{#check-block}}{{/check-block}}`);
2141
-
2142
- this.assertComponentElement(this.firstChild, { content: 'No' });
2143
- this.assertComponentElement(this.nthChild(1), { content: 'Yes' });
2144
-
2145
- this.assertStableRerender();
2146
- }
2147
-
2148
- ['@test expression hasBlockParams inverse']() {
2149
- this.registerComponent('check-inverse', {
2150
- template: strip`
2151
- {{#if (hasBlockParams "inverse")}}
2152
- Yes
2153
- {{else}}
2154
- No
2155
- {{/if}}`,
2156
- });
2157
-
2158
- this.render(strip`
2159
- {{#check-inverse}}{{/check-inverse}}
2160
- {{#check-inverse as |something|}}{{/check-inverse}}`);
2161
-
2162
- this.assertComponentElement(this.firstChild, { content: 'No' });
2163
- this.assertComponentElement(this.nthChild(1), { content: 'No' });
2164
-
2165
- this.assertStableRerender();
2166
- }
2167
-
2168
- ['@test expression hasBlockParams default']() {
2169
- this.registerComponent('check-block', {
2170
- template: strip`
2171
- {{#if (hasBlockParams)}}
2172
- Yes
2173
- {{else}}
2174
- No
2175
- {{/if}}`,
2176
- });
2177
-
2178
- this.render(strip`
2179
- {{#check-block}}{{/check-block}}
2180
- {{#check-block as |something|}}{{/check-block}}`);
2181
-
2182
- this.assertComponentElement(this.firstChild, { content: 'No' });
2183
- this.assertComponentElement(this.nthChild(1), { content: 'Yes' });
2184
-
2185
- this.assertStableRerender();
2186
- }
2187
-
2188
- ['@test non-expression hasBlock']() {
2189
- this.registerComponent('check-block', {
2190
- template: strip`
2191
- {{#if hasBlock}}
2192
- Yes
2193
- {{else}}
2194
- No
2195
- {{/if}}`,
2196
- });
2197
-
2198
- this.render(strip`
2199
- {{check-block}}
2200
- {{#check-block}}{{/check-block}}`);
2201
-
2202
- this.assertComponentElement(this.firstChild, { content: 'No' });
2203
- this.assertComponentElement(this.nthChild(1), { content: 'Yes' });
2204
-
2205
- this.assertStableRerender();
2206
- }
2207
-
2208
- ['@test expression hasBlockParams']() {
2209
- this.registerComponent('check-params', {
2210
- template: strip`
2211
- {{#if (hasBlockParams)}}
2212
- Yes
2213
- {{else}}
2214
- No
2215
- {{/if}}`,
2216
- });
2217
-
2218
- this.render(strip`
2219
- {{#check-params}}{{/check-params}}
2220
- {{#check-params as |foo|}}{{/check-params}}`);
2221
-
2222
- this.assertComponentElement(this.firstChild, { content: 'No' });
2223
- this.assertComponentElement(this.nthChild(1), { content: 'Yes' });
2224
-
2225
- this.assertStableRerender();
2226
- }
2227
-
2228
- ['@test non-expression hasBlockParams']() {
2229
- this.registerComponent('check-params', {
2230
- template: strip`
2231
- {{#if hasBlockParams}}
2232
- Yes
2233
- {{else}}
2234
- No
2235
- {{/if}}`,
2236
- });
2237
-
2238
- this.render(strip`
2239
- {{#check-params}}{{/check-params}}
2240
- {{#check-params as |foo|}}{{/check-params}}`);
2241
-
2242
- this.assertComponentElement(this.firstChild, { content: 'No' });
2243
- this.assertComponentElement(this.nthChild(1), { content: 'Yes' });
2244
-
2245
- this.assertStableRerender();
2246
- }
2247
-
2248
- ['@test hasBlock expression in an attribute'](assert) {
2249
- this.registerComponent('check-attr', {
2250
- template: '<button name={{hasBlock}}></button>',
2251
- });
2252
-
2253
- this.render(strip`
2254
- {{check-attr}}
2255
- {{#check-attr}}{{/check-attr}}`);
2256
-
2257
- equalsElement(assert, this.$('button')[0], 'button', { name: 'false' }, '');
2258
- equalsElement(assert, this.$('button')[1], 'button', { name: 'true' }, '');
2259
-
2260
- this.assertStableRerender();
2261
- }
2262
-
2263
- ['@test hasBlock inverse expression in an attribute'](assert) {
2264
- this.registerComponent(
2265
- 'check-attr',
2266
- {
2267
- template: '<button name={{hasBlock "inverse"}}></button>',
2268
- },
2269
- ''
2270
- );
2271
-
2272
- this.render(strip`
2273
- {{#check-attr}}{{/check-attr}}
2274
- {{#check-attr}}{{else}}{{/check-attr}}`);
2275
-
2276
- equalsElement(assert, this.$('button')[0], 'button', { name: 'false' }, '');
2277
- equalsElement(assert, this.$('button')[1], 'button', { name: 'true' }, '');
2278
-
2279
- this.assertStableRerender();
2280
- }
2281
-
2282
- ['@test hasBlockParams expression in an attribute'](assert) {
2283
- this.registerComponent('check-attr', {
2284
- template: '<button name={{hasBlockParams}}></button>',
2285
- });
2286
-
2287
- this.render(strip`
2288
- {{#check-attr}}{{/check-attr}}
2289
- {{#check-attr as |something|}}{{/check-attr}}`);
2290
-
2291
- equalsElement(assert, this.$('button')[0], 'button', { name: 'false' }, '');
2292
- equalsElement(assert, this.$('button')[1], 'button', { name: 'true' }, '');
2293
-
2294
- this.assertStableRerender();
2295
- }
2296
-
2297
- ['@test hasBlockParams inverse expression in an attribute'](assert) {
2298
- this.registerComponent(
2299
- 'check-attr',
2300
- {
2301
- template: '<button name={{hasBlockParams "inverse"}}></button>',
2302
- },
2303
- ''
2304
- );
2305
-
2306
- this.render(strip`
2307
- {{#check-attr}}{{/check-attr}}
2308
- {{#check-attr as |something|}}{{/check-attr}}`);
2309
-
2310
- equalsElement(assert, this.$('button')[0], 'button', { name: 'false' }, '');
2311
- equalsElement(assert, this.$('button')[1], 'button', { name: 'false' }, '');
2312
-
2313
- this.assertStableRerender();
2314
- }
2315
-
2316
- ['@test hasBlock as a param to a helper']() {
2317
- this.registerComponent('check-helper', {
2318
- template: '{{if hasBlock "true" "false"}}',
2319
- });
2320
-
2321
- this.render(strip`
2322
- {{check-helper}}
2323
- {{#check-helper}}{{/check-helper}}`);
2324
-
2325
- this.assertComponentElement(this.firstChild, { content: 'false' });
2326
- this.assertComponentElement(this.nthChild(1), { content: 'true' });
2327
-
2328
- this.assertStableRerender();
2329
- }
2330
-
2331
- ['@test hasBlock as an expression param to a helper']() {
2332
- this.registerComponent('check-helper', {
2333
- template: '{{if (hasBlock) "true" "false"}}',
2334
- });
2335
-
2336
- this.render(strip`
2337
- {{check-helper}}
2338
- {{#check-helper}}{{/check-helper}}`);
2339
-
2340
- this.assertComponentElement(this.firstChild, { content: 'false' });
2341
- this.assertComponentElement(this.nthChild(1), { content: 'true' });
2342
-
2343
- this.assertStableRerender();
2344
- }
2345
-
2346
- ['@test hasBlock inverse as a param to a helper']() {
2347
- this.registerComponent('check-helper', {
2348
- template: '{{if (hasBlock "inverse") "true" "false"}}',
2349
- });
2350
-
2351
- this.render(strip`
2352
- {{#check-helper}}{{/check-helper}}
2353
- {{#check-helper}}{{else}}{{/check-helper}}`);
2354
-
2355
- this.assertComponentElement(this.firstChild, { content: 'false' });
2356
- this.assertComponentElement(this.nthChild(1), { content: 'true' });
2357
-
2358
- this.assertStableRerender();
2359
- }
2360
-
2361
- ['@test hasBlockParams as a param to a helper']() {
2362
- this.registerComponent('check-helper', {
2363
- template: '{{if hasBlockParams "true" "false"}}',
2364
- });
2365
-
2366
- this.render(strip`
2367
- {{#check-helper}}{{/check-helper}}
2368
- {{#check-helper as |something|}}{{/check-helper}}`);
2369
-
2370
- this.assertComponentElement(this.firstChild, { content: 'false' });
2371
- this.assertComponentElement(this.nthChild(1), { content: 'true' });
2372
-
2373
- this.assertStableRerender();
2374
- }
2375
-
2376
- ['@test hasBlockParams as an expression param to a helper']() {
2377
- this.registerComponent('check-helper', {
2378
- template: '{{if (hasBlockParams) "true" "false"}}',
2379
- });
2380
-
2381
- this.render(strip`
2382
- {{#check-helper}}{{/check-helper}}
2383
- {{#check-helper as |something|}}{{/check-helper}}`);
2384
-
2385
- this.assertComponentElement(this.firstChild, { content: 'false' });
2386
- this.assertComponentElement(this.nthChild(1), { content: 'true' });
2387
-
2388
- this.assertStableRerender();
2389
- }
2390
-
2391
- ['@test hasBlockParams inverse as a param to a helper']() {
2392
- this.registerComponent('check-helper', {
2393
- template: '{{if (hasBlockParams "inverse") "true" "false"}}',
2394
- });
2395
-
2396
- this.render(strip`
2397
- {{#check-helper}}{{/check-helper}}
2398
- {{#check-helper as |something|}}{{/check-helper}}`);
2399
-
2400
- this.assertComponentElement(this.firstChild, { content: 'false' });
2401
- this.assertComponentElement(this.nthChild(1), { content: 'false' });
2402
-
2403
- this.assertStableRerender();
2404
- }
2405
-
2406
- ['@test component in template of a yielding component should have the proper parentView'](
2407
- assert
2408
- ) {
2409
- let outer, innerTemplate, innerLayout;
2410
-
2411
- this.registerComponent('x-outer', {
2412
- ComponentClass: Component.extend({
2413
- init() {
2414
- this._super(...arguments);
2415
- outer = this;
2416
- },
2417
- }),
2418
- template: '{{x-inner-in-layout}}{{yield}}',
2419
- });
2420
-
2421
- this.registerComponent('x-inner-in-template', {
2422
- ComponentClass: Component.extend({
2423
- init() {
2424
- this._super(...arguments);
2425
- innerTemplate = this;
2426
- },
2427
- }),
2428
- });
2429
-
2430
- this.registerComponent('x-inner-in-layout', {
2431
- ComponentClass: Component.extend({
2432
- init() {
2433
- this._super(...arguments);
2434
- innerLayout = this;
2435
- },
2436
- }),
2437
- });
2438
-
2439
- this.render('{{#x-outer}}{{x-inner-in-template}}{{/x-outer}}');
2440
-
2441
- assert.equal(
2442
- innerTemplate.parentView,
2443
- outer,
2444
- 'receives the wrapping component as its parentView in template blocks'
2445
- );
2446
- assert.equal(
2447
- innerLayout.parentView,
2448
- outer,
2449
- 'receives the wrapping component as its parentView in layout'
2450
- );
2451
- assert.equal(
2452
- outer.parentView,
2453
- this.context,
2454
- 'x-outer receives the ambient scope as its parentView'
2455
- );
2456
-
2457
- this.runTask(() => this.rerender());
2458
-
2459
- assert.equal(
2460
- innerTemplate.parentView,
2461
- outer,
2462
- 'receives the wrapping component as its parentView in template blocks'
2463
- );
2464
- assert.equal(
2465
- innerLayout.parentView,
2466
- outer,
2467
- 'receives the wrapping component as its parentView in layout'
2468
- );
2469
- assert.equal(
2470
- outer.parentView,
2471
- this.context,
2472
- 'x-outer receives the ambient scope as its parentView'
2473
- );
2474
- }
2475
-
2476
- ['@test newly-added sub-components get correct parentView'](assert) {
2477
- let outer, inner;
2478
-
2479
- this.registerComponent('x-outer', {
2480
- ComponentClass: Component.extend({
2481
- init() {
2482
- this._super(...arguments);
2483
- outer = this;
2484
- },
2485
- }),
2486
- });
2487
-
2488
- this.registerComponent('x-inner', {
2489
- ComponentClass: Component.extend({
2490
- init() {
2491
- this._super(...arguments);
2492
- inner = this;
2493
- },
2494
- }),
2495
- });
2496
-
2497
- this.render(
2498
- strip`
2499
- {{#x-outer}}
2500
- {{#if showInner}}
2501
- {{x-inner}}
2502
- {{/if}}
2503
- {{/x-outer}}`,
2504
- {
2505
- showInner: false,
2506
- }
2507
- );
2508
-
2509
- assert.equal(
2510
- outer.parentView,
2511
- this.context,
2512
- 'x-outer receives the ambient scope as its parentView'
2513
- );
2514
-
2515
- this.runTask(() => this.rerender());
2516
-
2517
- assert.equal(
2518
- outer.parentView,
2519
- this.context,
2520
- 'x-outer receives the ambient scope as its parentView (after rerender)'
2521
- );
2522
-
2523
- this.runTask(() => this.context.set('showInner', true));
2524
-
2525
- assert.equal(
2526
- outer.parentView,
2527
- this.context,
2528
- 'x-outer receives the ambient scope as its parentView'
2529
- );
2530
- assert.equal(
2531
- inner.parentView,
2532
- outer,
2533
- 'receives the wrapping component as its parentView in template blocks'
2534
- );
2535
-
2536
- this.runTask(() => this.context.set('showInner', false));
2537
-
2538
- assert.equal(
2539
- outer.parentView,
2540
- this.context,
2541
- 'x-outer receives the ambient scope as its parentView'
2542
- );
2543
- }
2544
-
2545
- ["@test when a property is changed during children's rendering"](assert) {
2546
- let outer, middle;
2547
-
2548
- this.registerComponent('x-outer', {
2549
- ComponentClass: Component.extend({
2550
- init() {
2551
- this._super(...arguments);
2552
- outer = this;
2553
- },
2554
- value: 1,
2555
- }),
2556
- template: '{{#x-middle}}{{x-inner value=value}}{{/x-middle}}',
2557
- });
2558
-
2559
- this.registerComponent('x-middle', {
2560
- ComponentClass: Component.extend({
2561
- init() {
2562
- this._super(...arguments);
2563
- middle = this;
2564
- },
2565
- value: null,
2566
- }),
2567
- template: '<div id="middle-value">{{value}}</div>{{yield}}',
2568
- });
2569
-
2570
- this.registerComponent('x-inner', {
2571
- ComponentClass: Component.extend({
2572
- value: null,
2573
- pushDataUp: observer('value', function() {
2574
- middle.set('value', this.get('value'));
2575
- }),
2576
- }),
2577
- template: '<div id="inner-value">{{value}}</div>',
2578
- });
2579
-
2580
- this.render('{{x-outer}}');
2581
-
2582
- assert.equal(this.$('#inner-value').text(), '1', 'initial render of inner');
2583
- assert.equal(
2584
- this.$('#middle-value').text(),
2585
- '',
2586
- 'initial render of middle (observers do not run during init)'
2587
- );
2588
-
2589
- this.runTask(() => this.rerender());
2590
-
2591
- assert.equal(this.$('#inner-value').text(), '1', 'initial render of inner');
2592
- assert.equal(
2593
- this.$('#middle-value').text(),
2594
- '',
2595
- 'initial render of middle (observers do not run during init)'
2596
- );
2597
-
2598
- let expectedBacktrackingMessage = /modified "value" twice on <.+?> in a single render\. It was rendered in "component:x-middle" and modified in "component:x-inner"/;
2599
-
2600
- expectAssertion(() => {
2601
- this.runTask(() => outer.set('value', 2));
2602
- }, expectedBacktrackingMessage);
2603
- }
2604
-
2605
- ["@test when a shared dependency is changed during children's rendering"]() {
2606
- this.registerComponent('x-outer', {
2607
- ComponentClass: Component.extend({
2608
- value: 1,
2609
- wrapper: EmberObject.create({ content: null }),
2610
- }),
2611
- template:
2612
- '<div id="outer-value">{{wrapper.content}}</div> {{x-inner value=value wrapper=wrapper}}',
2613
- });
2614
-
2615
- this.registerComponent('x-inner', {
2616
- ComponentClass: Component.extend({
2617
- didReceiveAttrs() {
2618
- this.get('wrapper').set('content', this.get('value'));
2619
- },
2620
- value: null,
2621
- }),
2622
- template: '<div id="inner-value">{{wrapper.content}}</div>',
2623
- });
2624
-
2625
- let expectedBacktrackingMessage = /modified "wrapper\.content" twice on <.+?> in a single render\. It was rendered in "component:x-outer" and modified in "component:x-inner"/;
2626
-
2627
- expectAssertion(() => {
2628
- this.render('{{x-outer}}');
2629
- }, expectedBacktrackingMessage);
2630
- }
2631
-
2632
- ['@test non-block with each rendering child components']() {
2633
- this.registerComponent('non-block', {
2634
- template: strip`
2635
- In layout. {{#each items as |item|}}
2636
- [{{child-non-block item=item}}]
2637
- {{/each}}`,
2638
- });
2639
-
2640
- this.registerComponent('child-non-block', {
2641
- template: 'Child: {{item}}.',
2642
- });
2643
-
2644
- let items = emberA(['Tom', 'Dick', 'Harry']);
2645
-
2646
- this.render('{{non-block items=items}}', { items });
2647
-
2648
- this.assertText('In layout. [Child: Tom.][Child: Dick.][Child: Harry.]');
2649
-
2650
- this.runTask(() => this.rerender());
2651
-
2652
- this.assertText('In layout. [Child: Tom.][Child: Dick.][Child: Harry.]');
2653
-
2654
- this.runTask(() => this.context.get('items').pushObject('Sergio'));
2655
-
2656
- this.assertText('In layout. [Child: Tom.][Child: Dick.][Child: Harry.][Child: Sergio.]');
2657
-
2658
- this.runTask(() => this.context.get('items').shiftObject());
2659
-
2660
- this.assertText('In layout. [Child: Dick.][Child: Harry.][Child: Sergio.]');
2661
-
2662
- this.runTask(() => this.context.set('items', emberA(['Tom', 'Dick', 'Harry'])));
2663
-
2664
- this.assertText('In layout. [Child: Tom.][Child: Dick.][Child: Harry.]');
2665
- }
2666
-
2667
- ['@test specifying classNames results in correct class'](assert) {
2668
- this.registerComponent('some-clicky-thing', {
2669
- ComponentClass: Component.extend({
2670
- tagName: 'button',
2671
- classNames: ['foo', 'bar'],
2672
- }),
2673
- });
2674
-
2675
- this.render(strip`
2676
- {{#some-clicky-thing classNames="baz"}}
2677
- Click Me
2678
- {{/some-clicky-thing}}`);
2679
-
2680
- // TODO: ember-view is no longer viewable in the classNames array. Bug or
2681
- // feature?
2682
- let expectedClassNames = ['ember-view', 'foo', 'bar', 'baz'];
2683
-
2684
- assert.ok(
2685
- this.$('button').is('.foo.bar.baz.ember-view'),
2686
- `the element has the correct classes: ${this.$('button').attr('class')}`
2687
- );
2688
- // `ember-view` is no longer in classNames.
2689
- // assert.deepEqual(clickyThing.get('classNames'), expectedClassNames, 'classNames are properly combined');
2690
- this.assertComponentElement(this.firstChild, {
2691
- tagName: 'button',
2692
- attrs: { class: classes(expectedClassNames.join(' ')) },
2693
- });
2694
-
2695
- this.runTask(() => this.rerender());
2696
-
2697
- assert.ok(
2698
- this.$('button').is('.foo.bar.baz.ember-view'),
2699
- `the element has the correct classes: ${this.$('button').attr('class')} (rerender)`
2700
- );
2701
- // `ember-view` is no longer in classNames.
2702
- // assert.deepEqual(clickyThing.get('classNames'), expectedClassNames, 'classNames are properly combined (rerender)');
2703
- this.assertComponentElement(this.firstChild, {
2704
- tagName: 'button',
2705
- attrs: { class: classes(expectedClassNames.join(' ')) },
2706
- });
2707
- }
2708
-
2709
- ['@test specifying custom concatenatedProperties avoids clobbering']() {
2710
- this.registerComponent('some-clicky-thing', {
2711
- ComponentClass: Component.extend({
2712
- concatenatedProperties: ['blahzz'],
2713
- blahzz: ['blark', 'pory'],
2714
- }),
2715
- template: strip`
2716
- {{#each blahzz as |p|}}
2717
- {{p}}
2718
- {{/each}}
2719
- - {{yield}}`,
2720
- });
2721
-
2722
- this.render(strip`
2723
- {{#some-clicky-thing blahzz="baz"}}
2724
- Click Me
2725
- {{/some-clicky-thing}}`);
2726
-
2727
- this.assertText('blarkporybaz- Click Me');
2728
-
2729
- this.runTask(() => this.rerender());
2730
-
2731
- this.assertText('blarkporybaz- Click Me');
2732
- }
2733
-
2734
- ['@test a two way binding flows upstream when consumed in the template']() {
2735
- let component;
2736
- let FooBarComponent = Component.extend({
2737
- init() {
2738
- this._super(...arguments);
2739
- component = this;
2740
- },
2741
- });
2742
-
2743
- this.registerComponent('foo-bar', {
2744
- ComponentClass: FooBarComponent,
2745
-
2746
- template: '{{bar}}',
2747
- });
2748
-
2749
- this.render('{{localBar}} - {{foo-bar bar=localBar}}', {
2750
- localBar: 'initial value',
2751
- });
2752
-
2753
- this.assertText('initial value - initial value');
2754
-
2755
- this.runTask(() => this.rerender());
2756
-
2757
- this.assertText('initial value - initial value');
2758
-
2759
- if (DEBUG) {
2760
- expectAssertion(() => {
2761
- component.bar = 'foo-bar';
2762
- }, /You must use set\(\) to set the `bar` property \(of .+\) to `foo-bar`\./);
2763
-
2764
- this.assertText('initial value - initial value');
2765
- }
2766
-
2767
- this.runTask(() => {
2768
- component.set('bar', 'updated value');
2769
- });
2770
-
2771
- this.assertText('updated value - updated value');
2772
-
2773
- this.runTask(() => {
2774
- component.set('bar', undefined);
2775
- });
2776
-
2777
- this.assertText(' - ');
2778
-
2779
- this.runTask(() => {
2780
- this.component.set('localBar', 'initial value');
2781
- });
2782
-
2783
- this.assertText('initial value - initial value');
2784
- }
2785
-
2786
- ['@test a two way binding flows upstream through a CP when consumed in the template']() {
2787
- let component;
2788
- let FooBarComponent = Component.extend({
2789
- init() {
2790
- this._super(...arguments);
2791
- component = this;
2792
- },
2793
-
2794
- bar: computed({
2795
- get() {
2796
- return this._bar;
2797
- },
2798
-
2799
- set(key, value) {
2800
- this._bar = value;
2801
- return this._bar;
2802
- },
2803
- }),
2804
- });
2805
-
2806
- this.registerComponent('foo-bar', {
2807
- ComponentClass: FooBarComponent,
2808
-
2809
- template: '{{bar}}',
2810
- });
2811
-
2812
- this.render('{{localBar}} - {{foo-bar bar=localBar}}', {
2813
- localBar: 'initial value',
2814
- });
2815
-
2816
- this.assertText('initial value - initial value');
2817
-
2818
- this.runTask(() => this.rerender());
2819
-
2820
- this.assertText('initial value - initial value');
2821
-
2822
- this.runTask(() => {
2823
- component.set('bar', 'updated value');
2824
- });
2825
-
2826
- this.assertText('updated value - updated value');
2827
-
2828
- this.runTask(() => {
2829
- this.component.set('localBar', 'initial value');
2830
- });
2831
-
2832
- this.assertText('initial value - initial value');
2833
- }
2834
-
2835
- ['@test a two way binding flows upstream through a CP without template consumption']() {
2836
- let component;
2837
- let FooBarComponent = Component.extend({
2838
- init() {
2839
- this._super(...arguments);
2840
- component = this;
2841
- },
2842
-
2843
- bar: computed({
2844
- get() {
2845
- return this._bar;
2846
- },
2847
-
2848
- set(key, value) {
2849
- this._bar = value;
2850
- return this._bar;
2851
- },
2852
- }),
2853
- });
2854
-
2855
- this.registerComponent('foo-bar', {
2856
- ComponentClass: FooBarComponent,
2857
- template: '',
2858
- });
2859
-
2860
- this.render('{{localBar}}{{foo-bar bar=localBar}}', {
2861
- localBar: 'initial value',
2862
- });
2863
-
2864
- this.assertText('initial value');
2865
-
2866
- this.runTask(() => this.rerender());
2867
-
2868
- this.assertText('initial value');
2869
-
2870
- this.runTask(() => {
2871
- component.set('bar', 'updated value');
2872
- });
2873
-
2874
- this.assertText('updated value');
2875
-
2876
- this.runTask(() => {
2877
- this.component.set('localBar', 'initial value');
2878
- });
2879
-
2880
- this.assertText('initial value');
2881
- }
2882
-
2883
- ['@test services can be injected into components']() {
2884
- let service;
2885
- this.registerService(
2886
- 'name',
2887
- Service.extend({
2888
- init() {
2889
- this._super(...arguments);
2890
- service = this;
2891
- },
2892
- last: 'Jackson',
2893
- })
2894
- );
2895
-
2896
- this.registerComponent('foo-bar', {
2897
- ComponentClass: Component.extend({
2898
- name: injectService(),
2899
- }),
2900
- template: '{{name.last}}',
2901
- });
2902
-
2903
- this.render('{{foo-bar}}');
2904
-
2905
- this.assertText('Jackson');
2906
-
2907
- this.runTask(() => this.rerender());
2908
-
2909
- this.assertText('Jackson');
2910
-
2911
- this.runTask(() => {
2912
- service.set('last', 'McGuffey');
2913
- });
2914
-
2915
- this.assertText('McGuffey');
2916
-
2917
- this.runTask(() => {
2918
- service.set('last', 'Jackson');
2919
- });
2920
-
2921
- this.assertText('Jackson');
2922
- }
2923
-
2924
- ['@test injecting an unknown service raises an exception']() {
2925
- this.registerComponent('foo-bar', {
2926
- ComponentClass: Component.extend({
2927
- missingService: injectService(),
2928
- }),
2929
- });
2930
-
2931
- expectAssertion(() => {
2932
- this.render('{{foo-bar}}');
2933
- }, "Attempting to inject an unknown injection: 'service:missingService'");
2934
- }
2935
-
2936
- ['@test throws if `this._super` is not called from `init`']() {
2937
- this.registerComponent('foo-bar', {
2938
- ComponentClass: Component.extend({
2939
- init() {},
2940
- }),
2941
- });
2942
-
2943
- expectAssertion(() => {
2944
- this.render('{{foo-bar}}');
2945
- }, /You must call `this._super\(...arguments\);` when overriding `init` on a framework object. Please update .* to call `this._super\(...arguments\);` from `init`./);
2946
- }
2947
-
2948
- ['@test should toggle visibility with isVisible'](assert) {
2949
- let assertStyle = expected => {
2950
- let matcher = styles(expected);
2951
- let actual = this.firstChild.getAttribute('style');
2952
-
2953
- assert.pushResult({
2954
- result: matcher.match(actual),
2955
- message: matcher.message(),
2956
- actual,
2957
- expected,
2958
- });
2959
- };
2960
-
2961
- this.registerComponent('foo-bar', {
2962
- template: `<p>foo</p>`,
2963
- });
2964
-
2965
- this.render(`{{foo-bar id="foo-bar" isVisible=visible}}`, {
2966
- visible: false,
2967
- });
2968
-
2969
- assertStyle('display: none;');
2970
-
2971
- this.assertStableRerender();
2972
-
2973
- this.runTask(() => {
2974
- set(this.context, 'visible', true);
2975
- });
2976
- assertStyle('');
2977
-
2978
- this.runTask(() => {
2979
- set(this.context, 'visible', false);
2980
- });
2981
- assertStyle('display: none;');
2982
- }
2983
-
2984
- ['@test isVisible does not overwrite component style']() {
2985
- this.registerComponent('foo-bar', {
2986
- ComponentClass: Component.extend({
2987
- attributeBindings: ['style'],
2988
- style: htmlSafe('color: blue;'),
2989
- }),
2990
-
2991
- template: `<p>foo</p>`,
2992
- });
2993
-
2994
- this.render(`{{foo-bar id="foo-bar" isVisible=visible}}`, {
2995
- visible: false,
2996
- });
2997
-
2998
- this.assertComponentElement(this.firstChild, {
2999
- tagName: 'div',
3000
- attrs: { id: 'foo-bar', style: styles('color: blue; display: none;') },
3001
- });
3002
-
3003
- this.assertStableRerender();
3004
-
3005
- this.runTask(() => {
3006
- set(this.context, 'visible', true);
3007
- });
3008
-
3009
- this.assertComponentElement(this.firstChild, {
3010
- tagName: 'div',
3011
- attrs: { id: 'foo-bar', style: styles('color: blue;') },
3012
- });
3013
-
3014
- this.runTask(() => {
3015
- set(this.context, 'visible', false);
3016
- });
3017
-
3018
- this.assertComponentElement(this.firstChild, {
3019
- tagName: 'div',
3020
- attrs: { id: 'foo-bar', style: styles('color: blue; display: none;') },
3021
- });
3022
- }
3023
-
3024
- ['@test adds isVisible binding when style binding is missing and other bindings exist'](
3025
- assert
3026
- ) {
3027
- let assertStyle = expected => {
3028
- let matcher = styles(expected);
3029
- let actual = this.firstChild.getAttribute('style');
3030
-
3031
- assert.pushResult({
3032
- result: matcher.match(actual),
3033
- message: matcher.message(),
3034
- actual,
3035
- expected,
3036
- });
3037
- };
3038
-
3039
- this.registerComponent('foo-bar', {
3040
- ComponentClass: Component.extend({
3041
- attributeBindings: ['foo'],
3042
- foo: 'bar',
3043
- }),
3044
- template: `<p>foo</p>`,
3045
- });
3046
-
3047
- this.render(`{{foo-bar id="foo-bar" foo=foo isVisible=visible}}`, {
3048
- visible: false,
3049
- foo: 'baz',
3050
- });
3051
-
3052
- assertStyle('display: none;');
3053
-
3054
- this.assertStableRerender();
3055
-
3056
- this.runTask(() => {
3057
- set(this.context, 'visible', true);
3058
- });
3059
-
3060
- assertStyle('');
3061
-
3062
- this.runTask(() => {
3063
- set(this.context, 'visible', false);
3064
- set(this.context, 'foo', 'woo');
3065
- });
3066
-
3067
- assertStyle('display: none;');
3068
- assert.equal(this.firstChild.getAttribute('foo'), 'woo');
3069
- }
3070
-
3071
- ['@test it can use readDOMAttr to read input value']() {
3072
- let component;
3073
- let assertElement = expectedValue => {
3074
- // value is a property, not an attribute
3075
- this.assertHTML(`<input class="ember-view" id="${component.elementId}">`);
3076
- this.assert.equal(this.firstChild.value, expectedValue, 'value property is correct');
3077
- this.assert.equal(
3078
- get(component, 'value'),
3079
- expectedValue,
3080
- 'component.get("value") is correct'
3081
- );
3082
- };
3083
-
3084
- this.registerComponent('one-way-input', {
3085
- ComponentClass: Component.extend({
3086
- tagName: 'input',
3087
- attributeBindings: ['value'],
3088
-
3089
- init() {
3090
- this._super(...arguments);
3091
- component = this;
3092
- },
3093
-
3094
- change() {
3095
- let value = this.readDOMAttr('value');
3096
- this.set('value', value);
3097
- },
3098
- }),
3099
- });
3100
-
3101
- this.render('{{one-way-input value=value}}', {
3102
- value: 'foo',
3103
- });
3104
-
3105
- assertElement('foo');
3106
-
3107
- this.assertStableRerender();
3108
-
3109
- this.runTask(() => {
3110
- this.firstChild.value = 'bar';
3111
- this.$('input').trigger('change');
3112
- });
3113
-
3114
- assertElement('bar');
3115
-
3116
- this.runTask(() => {
3117
- this.firstChild.value = 'foo';
3118
- this.$('input').trigger('change');
3119
- });
3120
-
3121
- assertElement('foo');
3122
-
3123
- this.runTask(() => {
3124
- set(component, 'value', 'bar');
3125
- });
3126
-
3127
- assertElement('bar');
3128
-
3129
- this.runTask(() => {
3130
- this.firstChild.value = 'foo';
3131
- this.$('input').trigger('change');
3132
- });
3133
-
3134
- assertElement('foo');
3135
- }
3136
-
3137
- ['@test child triggers revalidate during parent destruction (GH#13846)']() {
3138
- this.registerComponent('x-select', {
3139
- ComponentClass: Component.extend({
3140
- tagName: 'select',
3141
-
3142
- init() {
3143
- this._super();
3144
- this.options = emberA([]);
3145
- this.value = null;
3146
- },
3147
-
3148
- updateValue() {
3149
- var newValue = this.get('options.lastObject.value');
3150
-
3151
- this.set('value', newValue);
3152
- },
3153
-
3154
- registerOption(option) {
3155
- this.get('options').addObject(option);
3156
- },
3157
-
3158
- unregisterOption(option) {
3159
- this.get('options').removeObject(option);
3160
-
3161
- this.updateValue();
3162
- },
3163
- }),
3164
-
3165
- template: '{{yield this}}',
3166
- });
3167
-
3168
- this.registerComponent('x-option', {
3169
- ComponentClass: Component.extend({
3170
- tagName: 'option',
3171
- attributeBindings: ['selected'],
3172
-
3173
- didInsertElement() {
3174
- this._super(...arguments);
3175
-
3176
- this.get('select').registerOption(this);
3177
- },
3178
-
3179
- selected: computed('select.value', function() {
3180
- return this.get('value') === this.get('select.value');
3181
- }),
3182
-
3183
- willDestroyElement() {
3184
- this._super(...arguments);
3185
- this.get('select').unregisterOption(this);
3186
- },
3187
- }),
3188
- });
3189
-
3190
- this.render(strip`
3191
- {{#x-select value=value as |select|}}
3192
- {{#x-option value="1" select=select}}1{{/x-option}}
3193
- {{#x-option value="2" select=select}}2{{/x-option}}
3194
- {{/x-select}}
3195
- `);
3196
-
3197
- this.teardown();
3198
-
3199
- this.assert.ok(true, 'no errors during teardown');
3200
- }
3201
-
3202
- ['@test setting a property in willDestroyElement does not assert (GH#14273)'](assert) {
3203
- assert.expect(2);
3204
-
3205
- this.registerComponent('foo-bar', {
3206
- ComponentClass: Component.extend({
3207
- init() {
3208
- this._super(...arguments);
3209
- this.showFoo = true;
3210
- },
3211
-
3212
- willDestroyElement() {
3213
- this.set('showFoo', false);
3214
- assert.ok(true, 'willDestroyElement was fired');
3215
- this._super(...arguments);
3216
- },
3217
- }),
3218
-
3219
- template: `{{#if showFoo}}things{{/if}}`,
3220
- });
3221
-
3222
- this.render(`{{foo-bar}}`);
3223
-
3224
- this.assertText('things');
3225
- }
3226
-
3227
- ['@test using didInitAttrs as an event is deprecated'](assert) {
3228
- ENV._ENABLE_DID_INIT_ATTRS_SUPPORT = true;
3229
-
3230
- this.registerComponent('foo-bar', {
3231
- ComponentClass: Component.extend({
3232
- foo: on('didInitAttrs', function() {
3233
- assert.ok(true, 'should fire `didInitAttrs` event');
3234
- }),
3235
- }),
3236
- });
3237
-
3238
- expectDeprecation(() => {
3239
- this.render('{{foo-bar}}');
3240
- }, /didInitAttrs called/);
3241
- }
3242
-
3243
- ['@test using didInitAttrs as an event throws an assert'](assert) {
3244
- this.registerComponent('foo-bar', {
3245
- ComponentClass: Component.extend({
3246
- foo: on('didInitAttrs', function() {
3247
- assert.ok(true, 'should fire `didInitAttrs` event');
3248
- }),
3249
- }),
3250
- });
3251
-
3252
- expectAssertion(() => {
3253
- this.render('{{foo-bar}}');
3254
- }, /didInitAttrs called/);
3255
- }
3256
-
3257
- ['@test didReceiveAttrs fires after .init() but before observers become active'](assert) {
3258
- let barCopyDidChangeCount = 0;
3259
-
3260
- this.registerComponent('foo-bar', {
3261
- ComponentClass: Component.extend({
3262
- init() {
3263
- this._super(...arguments);
3264
- this.didInit = true;
3265
- },
3266
-
3267
- didReceiveAttrs() {
3268
- assert.ok(this.didInit, 'expected init to have run before didReceiveAttrs');
3269
- this.set('barCopy', this.attrs.bar.value + 1);
3270
- },
3271
-
3272
- barCopyDidChange: observer('barCopy', () => {
3273
- barCopyDidChangeCount++;
3274
- }),
3275
- }),
3276
-
3277
- template: '{{bar}}-{{barCopy}}',
3278
- });
3279
-
3280
- this.render(`{{foo-bar bar=bar}}`, { bar: 3 });
3281
-
3282
- this.assertText('3-4');
3283
-
3284
- assert.strictEqual(barCopyDidChangeCount, 1, 'expected observer firing for: barCopy');
3285
-
3286
- this.runTask(() => set(this.context, 'bar', 7));
3287
-
3288
- this.assertText('7-8');
3289
-
3290
- assert.strictEqual(barCopyDidChangeCount, 2, 'expected observer firing for: barCopy');
3291
- }
3292
-
3293
- ['@test overriding didReceiveAttrs does not trigger deprecation'](assert) {
3294
- this.registerComponent('foo-bar', {
3295
- ComponentClass: Component.extend({
3296
- didReceiveAttrs() {
3297
- assert.equal(1, this.get('foo'), 'expected attrs to have correct value');
3298
- },
3299
- }),
3300
-
3301
- template: '{{foo}}-{{fooCopy}}-{{bar}}-{{barCopy}}',
3302
- });
3303
-
3304
- this.render(`{{foo-bar foo=foo bar=bar}}`, { foo: 1, bar: 3 });
3305
- }
3306
-
3307
- ['@test overriding didUpdateAttrs does not trigger deprecation'](assert) {
3308
- this.registerComponent('foo-bar', {
3309
- ComponentClass: Component.extend({
3310
- didUpdateAttrs() {
3311
- assert.equal(5, this.get('foo'), 'expected newAttrs to have new value');
3312
- },
3313
- }),
3314
-
3315
- template: '{{foo}}-{{fooCopy}}-{{bar}}-{{barCopy}}',
3316
- });
3317
-
3318
- this.render(`{{foo-bar foo=foo bar=bar}}`, { foo: 1, bar: 3 });
3319
-
3320
- this.runTask(() => set(this.context, 'foo', 5));
3321
- }
3322
-
3323
- ['@test returning `true` from an action does not bubble if `target` is not specified (GH#14275)'](
3324
- assert
3325
- ) {
3326
- this.registerComponent('display-toggle', {
3327
- ComponentClass: Component.extend({
3328
- actions: {
3329
- show() {
3330
- assert.ok(true, 'display-toggle show action was called');
3331
- return true;
3332
- },
3333
- },
3334
- }),
3335
-
3336
- template: `<button {{action 'show'}}>Show</button>`,
3337
- });
3338
-
3339
- this.render(`{{display-toggle}}`, {
3340
- send() {
3341
- assert.notOk(true, 'send should not be called when action is not "subscribed" to');
3342
- },
3343
- });
3344
-
3345
- this.assertText('Show');
3346
-
3347
- this.runTask(() => this.$('button').click());
3348
- }
3349
-
3350
- ['@test returning `true` from an action bubbles to the `target` if specified'](assert) {
3351
- assert.expect(4);
3352
-
3353
- this.registerComponent('display-toggle', {
3354
- ComponentClass: Component.extend({
3355
- actions: {
3356
- show() {
3357
- assert.ok(true, 'display-toggle show action was called');
3358
- return true;
3359
- },
3360
- },
3361
- }),
3362
-
3363
- template: `<button {{action 'show'}}>Show</button>`,
3364
- });
3365
-
3366
- this.render(`{{display-toggle target=this}}`, {
3367
- send(actionName) {
3368
- assert.ok(true, 'send should be called when action is "subscribed" to');
3369
- assert.equal(actionName, 'show');
3370
- },
3371
- });
3372
-
3373
- this.assertText('Show');
3374
-
3375
- this.runTask(() => this.$('button').click());
3376
- }
3377
-
3378
- ['@test triggering an event only attempts to invoke an identically named method, if it actually is a function (GH#15228)'](
3379
- assert
3380
- ) {
3381
- assert.expect(3);
3382
-
3383
- let payload = ['arbitrary', 'event', 'data'];
3384
-
3385
- this.registerComponent('evented-component', {
3386
- ComponentClass: Component.extend({
3387
- someTruthyProperty: true,
3388
-
3389
- init() {
3390
- this._super(...arguments);
3391
- this.trigger('someMethod', ...payload);
3392
- this.trigger('someTruthyProperty', ...payload);
3393
- },
3394
-
3395
- someMethod(...data) {
3396
- assert.deepEqual(
3397
- data,
3398
- payload,
3399
- 'the method `someMethod` should be called, when `someMethod` is triggered'
3400
- );
3401
- },
3402
-
3403
- listenerForSomeMethod: on('someMethod', function(...data) {
3404
- assert.deepEqual(
3405
- data,
3406
- payload,
3407
- 'the listener `listenerForSomeMethod` should be called, when `someMethod` is triggered'
3408
- );
3409
- }),
3410
-
3411
- listenerForSomeTruthyProperty: on('someTruthyProperty', function(...data) {
3412
- assert.deepEqual(
3413
- data,
3414
- payload,
3415
- 'the listener `listenerForSomeTruthyProperty` should be called, when `someTruthyProperty` is triggered'
3416
- );
3417
- }),
3418
- }),
3419
- });
3420
-
3421
- this.render(`{{evented-component}}`);
3422
- }
3423
-
3424
- ['@test component yielding in an {{#each}} has correct block values after rerendering (GH#14284)']() {
3425
- this.registerComponent('list-items', {
3426
- template: `{{#each items as |item|}}{{yield item}}{{/each}}`,
3427
- });
3428
-
3429
- this.render(
3430
- strip`
3431
- {{#list-items items=items as |thing|}}
3432
- |{{thing}}|
3433
-
3434
- {{#if editMode}}
3435
- Remove {{thing}}
3436
- {{/if}}
3437
- {{/list-items}}
3438
- `,
3439
- {
3440
- editMode: false,
3441
- items: ['foo', 'bar', 'qux', 'baz'],
3442
- }
3443
- );
3444
-
3445
- this.assertText('|foo||bar||qux||baz|');
3446
-
3447
- this.assertStableRerender();
3448
-
3449
- this.runTask(() => set(this.context, 'editMode', true));
3450
-
3451
- this.assertText('|foo|Remove foo|bar|Remove bar|qux|Remove qux|baz|Remove baz');
3452
-
3453
- this.runTask(() => set(this.context, 'editMode', false));
3454
-
3455
- this.assertText('|foo||bar||qux||baz|');
3456
- }
3457
-
3458
- ['@test unimplimented positionalParams do not cause an error GH#14416']() {
3459
- this.registerComponent('foo-bar', {
3460
- template: 'hello',
3461
- });
3462
-
3463
- this.render('{{foo-bar wat}}');
3464
- this.assertText('hello');
3465
- }
3466
-
3467
- ['@test using attrs for positional params']() {
3468
- let MyComponent = Component.extend();
3469
-
3470
- this.registerComponent('foo-bar', {
3471
- ComponentClass: MyComponent.reopenClass({
3472
- positionalParams: ['myVar'],
3473
- }),
3474
- template: 'MyVar1: {{attrs.myVar}} {{myVar}} MyVar2: {{myVar2}} {{attrs.myVar2}}',
3475
- });
3476
-
3477
- this.render('{{foo-bar 1 myVar2=2}}');
3478
-
3479
- this.assertText('MyVar1: 1 1 MyVar2: 2 2');
3480
- }
3481
-
3482
- ['@feature(ember-glimmer-named-arguments) using named arguments for positional params']() {
3483
- let MyComponent = Component.extend();
3484
-
3485
- this.registerComponent('foo-bar', {
3486
- ComponentClass: MyComponent.reopenClass({
3487
- positionalParams: ['myVar'],
3488
- }),
3489
- template: 'MyVar1: {{@myVar}} {{myVar}} MyVar2: {{myVar2}} {{@myVar2}}',
3490
- });
3491
-
3492
- this.render('{{foo-bar 1 myVar2=2}}');
3493
-
3494
- this.assertText('MyVar1: 1 1 MyVar2: 2 2');
3495
- }
3496
-
3497
- ["@test can use `{{this}}` to emit the component's toString value [GH#14581]"]() {
3498
- this.registerComponent('foo-bar', {
3499
- ComponentClass: Component.extend({
3500
- toString() {
3501
- return 'special sauce goes here!';
3502
- },
3503
- }),
3504
- template: '{{this}}',
3505
- });
3506
-
3507
- this.render('{{foo-bar}}');
3508
-
3509
- this.assertText('special sauce goes here!');
3510
- }
3511
-
3512
- ['@test can use `{{this` to access paths on current context [GH#14581]']() {
3513
- let instance;
3514
- this.registerComponent('foo-bar', {
3515
- ComponentClass: Component.extend({
3516
- init() {
3517
- this._super(...arguments);
3518
-
3519
- instance = this;
3520
- },
3521
-
3522
- foo: {
3523
- bar: {
3524
- baz: 'huzzah!',
3525
- },
3526
- },
3527
- }),
3528
- template: '{{this.foo.bar.baz}}',
3529
- });
3530
-
3531
- this.render('{{foo-bar}}');
3532
-
3533
- this.assertText('huzzah!');
3534
-
3535
- this.assertStableRerender();
3536
-
3537
- this.runTask(() => set(instance, 'foo.bar.baz', 'yippie!'));
3538
-
3539
- this.assertText('yippie!');
3540
-
3541
- this.runTask(() => set(instance, 'foo.bar.baz', 'huzzah!'));
3542
-
3543
- this.assertText('huzzah!');
3544
- }
3545
-
3546
- ['@test can use custom element in component layout']() {
3547
- this.registerComponent('foo-bar', {
3548
- template: '<blah-zorz>Hi!</blah-zorz>',
3549
- });
3550
-
3551
- this.render('{{foo-bar}}');
3552
-
3553
- this.assertText('Hi!');
3554
- }
3555
-
3556
- ['@test can use nested custom element in component layout']() {
3557
- this.registerComponent('foo-bar', {
3558
- template: '<blah-zorz><hows-it-going>Hi!</hows-it-going></blah-zorz>',
3559
- });
3560
-
3561
- this.render('{{foo-bar}}');
3562
-
3563
- this.assertText('Hi!');
3564
- }
3565
-
3566
- ['@feature(!ember-glimmer-named-arguments) can access properties off of rest style positionalParams array']() {
3567
- this.registerComponent('foo-bar', {
3568
- ComponentClass: Component.extend().reopenClass({
3569
- positionalParams: 'things',
3570
- }),
3571
- // using `attrs` here to simulate `@things.length`
3572
- template: `{{attrs.things.length}}`,
3573
- });
3574
-
3575
- this.render('{{foo-bar "foo" "bar" "baz"}}');
3576
-
3577
- this.assertText('3');
3578
- }
3579
-
3580
- ['@feature(ember-glimmer-named-arguments) can access properties off of rest style positionalParams array']() {
3581
- this.registerComponent('foo-bar', {
3582
- ComponentClass: Component.extend().reopenClass({
3583
- positionalParams: 'things',
3584
- }),
3585
- template: `{{@things.length}}`,
3586
- });
3587
-
3588
- this.render('{{foo-bar "foo" "bar" "baz"}}');
3589
-
3590
- this.assertText('3');
3591
- }
3592
-
3593
- ['@test has attrs by didReceiveAttrs with native classes'](assert) {
3594
- class FooBarComponent extends Component {
3595
- constructor(injections) {
3596
- super(injections);
3597
- // analagous to class field defaults
3598
- this.foo = 'bar';
3599
- }
3600
-
3601
- didReceiveAttrs() {
3602
- assert.equal(this.foo, 'bar', 'received default attrs correctly');
3603
- }
3604
- }
3605
-
3606
- this.registerComponent('foo-bar', { ComponentClass: FooBarComponent });
3607
-
3608
- this.render('{{foo-bar}}');
3609
- }
3610
- }
3611
- );
3612
-
3613
- if (jQueryDisabled) {
3614
- moduleFor(
3615
- 'Components test: curly components: jQuery disabled',
3616
- class extends RenderingTest {
3617
- ['@test jQuery proxy is not available without jQuery']() {
3618
- let instance;
3619
-
3620
- let FooBarComponent = Component.extend({
3621
- init() {
3622
- this._super();
3623
- instance = this;
3624
- },
3625
- });
3626
-
3627
- this.registerComponent('foo-bar', {
3628
- ComponentClass: FooBarComponent,
3629
- template: 'hello',
3630
- });
3631
-
3632
- this.render('{{foo-bar}}');
3633
-
3634
- expectAssertion(() => {
3635
- instance.$()[0];
3636
- }, 'You cannot access this.$() with `jQuery` disabled.');
3637
- }
3638
- }
3639
- );
3640
- } else {
3641
- moduleFor(
3642
- 'Components test: curly components: jQuery enabled',
3643
- class extends RenderingTest {
3644
- ['@test it has a jQuery proxy to the element']() {
3645
- let instance;
3646
-
3647
- let FooBarComponent = Component.extend({
3648
- init() {
3649
- this._super();
3650
- instance = this;
3651
- },
3652
- });
3653
-
3654
- this.registerComponent('foo-bar', {
3655
- ComponentClass: FooBarComponent,
3656
- template: 'hello',
3657
- });
3658
-
3659
- this.render('{{foo-bar}}');
3660
-
3661
- let element1 = instance.$()[0];
3662
-
3663
- this.assertComponentElement(element1, { content: 'hello' });
3664
-
3665
- this.runTask(() => this.rerender());
3666
-
3667
- let element2 = instance.$()[0];
3668
-
3669
- this.assertComponentElement(element2, { content: 'hello' });
3670
-
3671
- this.assertSameNode(element2, element1);
3672
- }
3673
-
3674
- ['@test it scopes the jQuery proxy to the component element'](assert) {
3675
- let instance;
3676
-
3677
- let FooBarComponent = Component.extend({
3678
- init() {
3679
- this._super();
3680
- instance = this;
3681
- },
3682
- });
3683
-
3684
- this.registerComponent('foo-bar', {
3685
- ComponentClass: FooBarComponent,
3686
- template: '<span class="inner">inner</span>',
3687
- });
3688
-
3689
- this.render('<span class="outer">outer</span>{{foo-bar}}');
3690
-
3691
- let $span = instance.$('span');
3692
-
3693
- assert.equal($span.length, 1);
3694
- assert.equal($span.attr('class'), 'inner');
3695
-
3696
- this.runTask(() => this.rerender());
3697
-
3698
- $span = instance.$('span');
3699
-
3700
- assert.equal($span.length, 1);
3701
- assert.equal($span.attr('class'), 'inner');
3702
- }
3703
- }
3704
- );
3705
- }