Skip to content

Fix skipped tests related to outlets.#14177

Merged
rwjblue merged 2 commits intomasterfrom
bound-outlet
Sep 1, 2016
Merged

Fix skipped tests related to outlets.#14177
rwjblue merged 2 commits intomasterfrom
bound-outlet

Conversation

@rwjblue
Copy link
Member

@rwjblue rwjblue commented Sep 1, 2016

  • Fix issue with setting outlet state after initial render.
    • When the initially rendered outlet state was undefined an error
      occurred (due to not handling the missing template case).
    • When a completely new outlet state object is setup, the .value
      calculation for TopLevelOutletComponentReference was completely
      incorrect (it was looking for newState.outlets.main.render.template
      instead of newState.render.template).
  • Fix usage of bound outlet name. Previously, we were eagerly evaluating the bound reference and passing the final value around instead of the reference to the final outlet name value. This means that given {{outlet foo}} when the property foo changes then no updates would be made. The fix is to avoid eagerly evaluating the reference, band and ensure that the ComponentDefition includes a tag the represents both the outlet name and the outlet state. While debugging this, I also came across an untested scenario where we coerced any falsy values for outlet name into 'main'. However, we should only be defaulting to 'main' if no positional argument is present.

Addresses 2 more tests in #14170.

Robert Jackson added 2 commits September 1, 2016 01:28
Previously, we were eagerly evaluating the bound reference and passing
the final value around instead of the reference to the final outlet name
value. This means that given `{{outlet foo}}` when the property `foo`
changes then no updates would be made.

The fix is to avoid eagerly evaluating the reference, band and ensure
that the `ComponentDefition` includes a tag the represents both the
outlet name and the outlet state.

While debugging this, I also came across an untested scenario where we
coerced any falsy values for outlet name into `'main'`. However, we
should only be defaulting to `'main'` if no positional argument is present.
A couple issues are fixed here:

* When the initially rendered outlet state was `undefined` an error
  occurred (due to not handling the missing template case).
* When a completely new outlet state object is setup, the `.value`
  calculation for `TopLevelOutletComponentReference` was completely
  incorrect (it was looking for `newState.outlets.main.render.template`
  instead of `newState.render.template`).
@rwjblue rwjblue merged commit c64433c into master Sep 1, 2016
@rwjblue rwjblue deleted the bound-outlet branch September 1, 2016 06:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants