-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
[GLIMMER2] Moves unbound tests #13137
Conversation
this.assertText('BORK BORK'); | ||
} | ||
|
||
['@htmlbars sexpr form does not update on parent re-render']() { |
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.
Is it just me or is it weird that sexprs and syntax act differently when the parent re-renders?
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.
Combination of
ember.js/packages/ember-htmlbars/tests/helpers/unbound_test.js
Lines 179 to 196 in bf067f7
QUnit.test('it should render the current value of a property on the context', function() { | |
equal(view.$().text(), 'BORK', 'should render the current value of a property'); | |
}); | |
QUnit.test('it should not re-render if the property changes', function() { | |
run(function() { | |
view.set('context.foo', 'oof'); | |
}); | |
equal(view.$().text(), 'BORK', 'should not re-render if the property changes'); | |
}); | |
QUnit.test('it should not re-render if the parent view rerenders', function() { | |
run(function() { | |
view.set('context.foo', 'oof'); | |
view.rerender(); | |
}); | |
equal(view.$().text(), 'BORK', 'should not re-render if the parent view rerenders'); | |
}); |
5169fd1
to
63f48fd
Compare
@@ -50,6 +50,8 @@ export default class extends Environment { | |||
return new DynamicComponentSyntax({ args, templates }); | |||
} else if (key === 'outlet') { | |||
return new OutletSyntax({ args }); | |||
} else if (key === 'partial') { |
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.
Opps will remove.
63f48fd
to
0d53945
Compare
|
||
moduleFor('Helpers test: {{unbound}}', class extends RenderingTest { | ||
|
||
['@htmlbars it should not update the value if the parent view doesn\'t rerender']() { |
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.
Tests that were removed are: Property With Attributes <--- Maybe bring this one back. This checks for property on an object where as another test just for property on the context. |
0d53945
to
fe038d2
Compare
@chancancode These are probably G2G given we are ok with the tests that were removed. |
} | ||
}); | ||
|
||
QUnit.test('it should render the current value of a property on the context', function() { |
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 not update the value if the parent view doesn't rerender
equal(view.$().text(), 'XXXXX X XX XXXX', 'only unbound bound options changed'); | ||
}); | ||
|
||
QUnit.test('should be able to render an bound helper invocation mixed with static values', function() { |
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 be able to render an bound helper invocation mixed with static values
@chadhietala mostly looks good to me, left some feedback as line comments. I don't love the way the latter, more complicated tests are factored, the setup required are quite distracting and it took me a long time to understand what they do. It's not your fault though, and I think we don't have to worry about those now. Hopefully when everything settles someone will have the appetite to refactor these one day :P |
I'm a bit worried about the inconsistent semantics because our new implementation does not "naturally" have those problems, so I'll ask around in #core to figure out what we actually need to implement (w.r.t. |
(Oops) |
b521870
to
621feb1
Compare
I think CI just needs to be restarted. This fell victim to the |
☔ The latest upstream changes (presumably #13160) made this pull request unmergeable. Please resolve the merge conflicts. |
3f5badf
to
10f875d
Compare
['@test it should not update the value if the parent view doesn\'t rerender']() { | ||
this.render(`{{unbound foo}} {{unbound bar}}`, { | ||
foo: 'BORK', | ||
barBinding: 'foo' |
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 ✂️, I think?
Looks great to me! There are a few minor things but they don't really need to block merging. However, I do want to hear from @rwjblue about the owner test before merging. |
10f875d
to
8154718
Compare
This moves the unbound tests to the new test infra and integrates `unbound` to Glimmer.
8154718
to
940492d
Compare
This moves the unbound tests to the new test infra and implements the
unbound
helper./cc #13127