Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement testing RFC #1211

Merged
merged 23 commits into from
Apr 21, 2022
Merged

Conversation

cafreeman
Copy link
Contributor

@cafreeman cafreeman commented Apr 11, 2022

This PR implements the majority of emberjs/rfcs#785. More specifically, it adds:

  • a new rerender helper that allows tests to wait exclusively on render operations (as opposed to full settledness).
  • an updated version of render that accepts components as well as templates

Notably, this PR does not address the component named argument ergonomics issue mentioned in the RFC. That will need to come in a follow-on RFC/PR.

TODO

@cafreeman cafreeman changed the title add rerender helper Implement testing RFC Apr 11, 2022
let renderSettled: () => Promise<void>;

// TODO need to add the actual version `@ember/renderer` landed once we know it
if (macroCondition(dependencySatisfies('ember-source', '>=4.9999999.0'))) {
Copy link
Member

Choose a reason for hiding this comment

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

😆 🤣 😢

Copy link
Member

Choose a reason for hiding this comment

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

Ok, now that the Ember change has landed for realz let's update this to 4.5.0-beta.1.

addon-test-support/@ember/test-helpers/rerender.ts Outdated Show resolved Hide resolved
addon-test-support/@ember/test-helpers/rerender.ts Outdated Show resolved Hide resolved
addon-test-support/@ember/test-helpers/setup-context.ts Outdated Show resolved Hide resolved
tests/integration/rerender-test.js Outdated Show resolved Hide resolved
tests/integration/settled-test.js Outdated Show resolved Hide resolved
tests/integration/settled-test.js Outdated Show resolved Hide resolved
tests/unit/setup-rendering-context-test.js Outdated Show resolved Hide resolved
tests/unit/setup-rendering-context-test.js Outdated Show resolved Hide resolved
cafreeman and others added 4 commits April 12, 2022 09:45
@cafreeman cafreeman force-pushed the cfreeman/implement-testing-rfc branch from 9ccfdf6 to 8d935fb Compare April 12, 2022 16:23
@cafreeman cafreeman force-pushed the cfreeman/implement-testing-rfc branch from d41647a to 2c6b47f Compare April 12, 2022 19:05
@cafreeman cafreeman marked this pull request as ready for review April 15, 2022 15:17
@rwjblue rwjblue merged commit 52714fd into emberjs:master Apr 21, 2022

const OUTLET_TEMPLATE = hbs`{{outlet}}`;
const EMPTY_TEMPLATE = hbs``;
const INVOKE_PROVIDED_COMPONENT = hbs`<this.ProvidedComponent />`;
Copy link
Contributor

Choose a reason for hiding this comment

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

@chriskrycho here is this mystic this.ProvidedComponent that fails ember-optimized scenario

SergeAstapov added a commit to adopted-ember-addons/ember-keyboard that referenced this pull request Jul 8, 2022
PR emberjs/ember-test-helpers#1211 (released in v2.8.0)
made `ember-source` a peerDependency of `@ember/test-helpers`.

In case of `ember-keyboard` monorepo setup, package `ember-source`
does not get hoisted and stay in the `test-app/node_modules` but at the same time
`@ember/test-helpers` gets hoisted as well as some another version of `ember-source`.

By not hoisting `@ember/test-helpers` in the `test-app` package we avoid this issue.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants