Skip to content

Fix issues with the recent template factory refactor and @ember/test-helpers v1.6.0#18168

Merged
rwjblue merged 2 commits into
masterfrom
add-basic-ember-test-helpers-smoke-test
Jul 4, 2019
Merged

Fix issues with the recent template factory refactor and @ember/test-helpers v1.6.0#18168
rwjblue merged 2 commits into
masterfrom
add-basic-ember-test-helpers-smoke-test

Conversation

@rwjblue
Copy link
Copy Markdown
Member

@rwjblue rwjblue commented Jul 2, 2019

This PR does two main things:

  • Adds a smoke test that emulates what @ember/test-helpers@1.6.0 does for setupRenderingTest type of tests
  • Fixes issues within the {{outlet}} component manager when the result of owner.lookup is passed directly into the outlet state (which is what @ember/test-helpers has done for most of the 1.x series)

I do personally think the fix/workaround is "fine" to leave in for quite some time, but it can be removed after @ember/test-helpers@1.6.0 is "aged out" and no longer supported.

@rwjblue rwjblue force-pushed the add-basic-ember-test-helpers-smoke-test branch from b598002 to 1da52ec Compare July 3, 2019 03:33
@rwjblue rwjblue requested review from chancancode and krisselden July 3, 2019 03:34
@rwjblue rwjblue changed the title Add failing smoke test for @ember/test-helpers v1.6.0. Fix issues with the recent template factory refactor and @ember/test-helpers v1.6.0 Jul 3, 2019
@rwjblue rwjblue force-pushed the add-basic-ember-test-helpers-smoke-test branch 2 times, most recently from 741f445 to 6bd7fff Compare July 3, 2019 04:11
Robert Jackson added 2 commits July 3, 2019 01:25
This fix allows _either_ `owner.lookup('template:foo')` or
`owner.lookup('template:foo')(owner)` to be passed as the `template`
property in `outletState.render`. This ensures that existing versions of
`@ember/test-helpers` work properly before and after the recent template
factory refactors.
@rwjblue rwjblue force-pushed the add-basic-ember-test-helpers-smoke-test branch from 6bd7fff to 7d139a7 Compare July 3, 2019 05:26
if (template === undefined) return null;

// this guard can be removed once @ember/test-helpers@1.6.0 has "aged out"
// and is no longer considered supported
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So is the intention to still merge and release emberjs/ember-test-helpers#677 or to rather make a new backwards-incompatible release of @ember/test-helpers that drops support for all Ember versions prior to #18096? 🤔

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ya, I still think we should still land emberjs/ember-test-helpers#677.

export type StaticTemplate = SerializedTemplateWithLazyBlock<StaticTemplateMeta>;
export type OwnedTemplate = Template<OwnedTemplateMeta>;

export function isTemplateFactory(template: OwnedTemplate | Factory): template is Factory {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we rename the interface below to TemplateFactory?

@krisselden
Copy link
Copy Markdown
Contributor

We have a test that is hanging in the browserstack tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants