You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 29, 2024. It is now read-only.
There are a few things about the testing infrastructure that need to be addressed moving forward:
Currently render() and settled() return a string containing the HTML output. This is a good way to get started with many types of tests, doesn't give us much flexibility. A better solution would be to incorporate QUnit.dom so that we can make assertions based on the output of a render, without having to worry about details like finding the QUnit render element.
render() should instead return the result of the call to renderComponent(). Currently, this is void, but we should add an API to control the rendered output with at least one method: destroy(). This would be useful for the embedding use cases, but also for simplifying tests, since it would allow us to manually destroy the component tree instead of using existing hacks like wrapping it in an {{#if}} and toggling the property.
We should add better DOM interaction functions. Ideally, we would genericize @ember/test-helpers and make it so they can work anywhere, then just use those.
We should rewrite the existing tests to use the new tracked() helper. Currently there are a number of tests that capture the instance of a component and try to manipulate it directly to ensure updates. This is a lot of boilerplate, and not really necessary in many cases.
The text was updated successfully, but these errors were encountered:
Yep, this would be great for a first issue 😄 I would recommend tackling each issue one at a time with separate PRs, so we can review them individually. Happy to help discuss the path for each change, in particular genericizing @ember/test-helpers might be a bit tricky.
First item, we need a strategy here long term, but it's going to be tricky so we are going to wait for the time being.
Second item, we need to discuss this in the Glimmer.js team and make a decision about what we want to do here. Could just return the component instance.
Third item, we're going to move forward with breaking out ember-test-helpers into two packages, a normal node package that exports the test helpers as is, and a thin Ember addon wrapper.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
There are a few things about the testing infrastructure that need to be addressed moving forward:
Currently
render()
andsettled()
return a string containing the HTML output. This is a good way to get started with many types of tests, doesn't give us much flexibility. A better solution would be to incorporate QUnit.dom so that we can make assertions based on the output of a render, without having to worry about details like finding the QUnit render element.render()
should instead return the result of the call torenderComponent()
. Currently, this isvoid
, but we should add an API to control the rendered output with at least one method:destroy()
. This would be useful for the embedding use cases, but also for simplifying tests, since it would allow us to manually destroy the component tree instead of using existing hacks like wrapping it in an{{#if}}
and toggling the property.We should add better DOM interaction functions. Ideally, we would genericize
@ember/test-helpers
and make it so they can work anywhere, then just use those.We should rewrite the existing tests to use the new
tracked()
helper. Currently there are a number of tests that capture the instance of a component and try to manipulate it directly to ensure updates. This is a lot of boilerplate, and not really necessary in many cases.The text was updated successfully, but these errors were encountered: