-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
[Glimmer2] Port {{yield}} test to ember-glimmer. #13213
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
Conversation
|
I have a bit more work to do here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace by line #28
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✔️ should yield to block, when the yield is embedded in a each helper
eb6c66d to
5c3d7e7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replaced by #7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✔️ can yield to block
5c3d7e7 to
88706df
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replaced by #196
428c69d to
2ea60b2
Compare
|
@chancancode this is ready for you, mate. |
2ea60b2 to
70c4e30
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems to me that parentView is not yet implemented yet in glimmer2?
I could be totally wrong and I just need to figure out what the hell I'm doing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be implemented. There may be bugs, though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"virtual view" is no longer terminology in Ember. yield should not introduce a view perhaps?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/outer context/original context/
|
Meta-comment: if you decided not to do the full INUR for a given test, can you write a comment in the test explaining why? |
|
Thanks for the review @wycats I will get these addressed. |
2d4e703 to
422016a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you drop the divs and just do just assert HelloHelloHelloHelloHello?
|
I pulled a lot of the DOM out of the test cases. I'm totally willing to put that back if we feel that would be valuable. @krisselden |
c5adb23 to
13b10ad
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might want to do something like
this.assertComponentElement(this.nthChild(0).firstChild, { tagName: 'div', attrs: {class: 'yielding' } });
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@chadhietala the nthChild method seems to be more of a nthSibling method.
The DOM that this test produces is
<div id='ember342'>
<div id='ember344'>
<div class='yielding'></div>
</div>
</div>Hence the your assertion suggestion will not work.
Is there a need for a help to asset deep into a DOM tree?
I have updated to the test to be simpler. Here
|
Just that one nit, otherwise LGTM. |
13b10ad to
41d5595
Compare
|
@wycats @chadhietala This is ready for review. @chadhietala am I doing the a full INUR on the test that need the full treatment. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can add a simple curly to the block to make sure it updates:
this.registerComponent('yield-comp', { template: '<div>[In layout] {{yield}}</div>' });
// I
this.render('{{#yield-comp}}[In block: {{foo}}]{{/yield-comp}}', { foo: "foo" });
this.assertText('[In layout] [In block: foo]');
// N
this.assertStableRerender();
// U
this.runTask(() => set(this.context, 'foo', 'bar');
this.assertText('[In layout] [In block: bar]');
// R
this.runTask(() => set(this.context, 'foo', 'foo');
this.assertText('[In layout] [In block: foo]');41d5595 to
2e8b89a
Compare
|
@chancancode @chadhietala @krisselden I have update the first few tests to do a full INUR by adding some curlies at @chancancode promoting. Also I removed all jQuery crap. The parentView test is the only test not doing a full INUR. Also I think we need more testing for the yield helper ie |
|
Thanks @kiwiupover 🎉 🎉 🎉 🎉 🎉 |
No description provided.