Repository navigation
Reading/Editing/Octaning “Testing” section - #594
Conversation
|
I don't know how to properly separate two PRs at once, so the first five commits here come from my other current PR. Nevertheless, I'm using this space to take some notes on the testing pages:
The link to the Dependency Injection guide is handy, but it's not quite clear why, if
|
|
Next, the testing sections present a few difficulties for octanization:
|
I actually think the example there is still valid. In a I'd write the example component as: import Component from '@glimmer/component';
export default class PrettyColor extends Component {
get style() {
return `color: ${this.args.name}`;
}
}); |
I think it still needs to be updated, octane does not remove the need for controllers at all. However, since the controllers section in the sidebar is removed, perhaps we should just remove the controller testing section from the sidebar for now as well. That way we can bring both back together, when they are ready. |
|
@rwjblue and @efx, any thoughts on adding a bit more explanation to
|
|
OK, I think we need a rebase now (to drop out the commits that were also in #588). Does that make sense? Also, happy to help with that if you'd like... |
The asynchronous helpers were formatted `<li>helper-name<ul><li>description…`, but the markdown was not rendering correctly. The synchronous helpers were formatted `<li>helper-name: description…`. This unifies the style.
Co-Authored-By: muziejus <[email protected]>
Co-Authored-By: muziejus <[email protected]>
Co-Authored-By: muziejus <[email protected]>
Co-Authored-By: muziejus <[email protected]>
Co-Authored-By: muziejus <[email protected]>
Co-Authored-By: muziejus <[email protected]>
Co-Authored-By: muziejus <[email protected]>
Co-Authored-By: muziejus <[email protected]>
Co-Authored-By: muziejus <[email protected]>
12a4590 to
cb0e971
Compare
|
@muziejus I think discussing how we introduce the owner API is a good idea. I had a similar problem with how the current guides talked about services: #300 (comment) |
|
@efx Good point about not duplicating definitions, as I sort of do that in my proposal, copy and pasting from the dependency injection page's discussion of Could the glossary help here? Similarly, something like: In the example below, we import the `setupTest` function from `ember-qunit` and call it with the `hooks` object to setup the test context. This provides us with the `this.owner` property. As the [API docs note]:
> When Ember's [Dependency Injection] system creates an [ApplicationInstance], it exposes a `this.owner` property that serves as the "owner" for objects that are instantiated during testing. We can access the `ApplicationInstance` with the `this.owner.lookup` to "look up" (i.e. instantiate and / or retrieve) objects. Similarly, we can register...Might be good, since it marks that we're relying on a different document for the quoted material. That may be friendlier than just a link. |
rwjblue
left a comment
There was a problem hiding this comment.
A few things;
- The service stubbing example should assume the service has marked
currentLocationas@tracked, and therefore doesn't need@computed - The "Testing Computed Properties" section should be refactored to be about testing tracked properties, OR we should scale down the "Testing Computed Properties" section and add a larger "Testing Tracked Properties". For now I think the first option is "easier" and I made inline suggestions to that effect...
This is looking really nice, thank you for working on it!
|
@muziejus big 👍 from me to your revision. Honestly don't think we even need to quote the API documentation as it is linked. I also want to say we should continue any wording tweaks outside of this PR because the grand work you're doing here should be be merged once the technical review notes are done. |
Co-Authored-By: muziejus <[email protected]>
Co-Authored-By: muziejus <[email protected]>
Co-Authored-By: muziejus <[email protected]>
Co-Authored-By: muziejus <[email protected]>
Co-Authored-By: muziejus <[email protected]>
Co-Authored-By: muziejus <[email protected]>
Co-Authored-By: muziejus <[email protected]>
Co-Authored-By: muziejus <[email protected]>
Co-Authored-By: muziejus <[email protected]>
Co-Authored-By: muziejus <[email protected]>
Co-Authored-By: muziejus <[email protected]>
Co-Authored-By: muziejus <[email protected]>
Co-Authored-By: muziejus <[email protected]>
Co-Authored-By: muziejus <[email protected]>
Co-Authored-By: muziejus <[email protected]>
Co-Authored-By: muziejus <[email protected]>
Co-Authored-By: muziejus <[email protected]>
Co-Authored-By: muziejus <[email protected]>
Co-Authored-By: muziejus <[email protected]>
Co-Authored-By: muziejus <[email protected]>
|
@efx Thanks. You're right… I think once the code is somewhat stable I can have a stab at the language in separate PRs to work on better comprehension. As a relative noob, I think I have a couple insights into sniffing out where things get too confusing too quickly! |
Working on #588