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

[GLIMMER2] Moves unbound tests #13137

Merged
merged 1 commit into from
Mar 26, 2016

Conversation

chadhietala
Copy link
Contributor

@chadhietala chadhietala commented Mar 20, 2016

This moves the unbound tests to the new test infra and implements the unbound helper.

/cc #13127

this.assertText('BORK BORK');
}

['@htmlbars sexpr form does not update on parent re-render']() {
Copy link
Contributor Author

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Combination of

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');
});

@chadhietala chadhietala force-pushed the glim-glam-unbound branch 3 times, most recently from 5169fd1 to 63f48fd Compare March 20, 2016 18:04
@@ -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') {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Opps will remove.


moduleFor('Helpers test: {{unbound}}', class extends RenderingTest {

['@htmlbars it should not update the value if the parent view doesn\'t rerender']() {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@chadhietala
Copy link
Contributor Author

Tests that were removed are:

Container lookup tests 1 2

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.

@chadhietala
Copy link
Contributor Author

@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() {
Copy link
Member

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() {
Copy link
Member

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

@chancancode
Copy link
Member

@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

@chancancode
Copy link
Member

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. rerender)

@chancancode chancancode reopened this Mar 22, 2016
@chancancode
Copy link
Member

(Oops)

@chadhietala
Copy link
Contributor Author

I think CI just needs to be restarted. This fell victim to the left-pad debacle.

@homu
Copy link
Contributor

homu commented Mar 23, 2016

☔ The latest upstream changes (presumably #13160) made this pull request unmergeable. Please resolve the merge conflicts.

@chadhietala chadhietala force-pushed the glim-glam-unbound branch 2 times, most recently from 3f5badf to 10f875d Compare March 23, 2016 17:30
['@test it should not update the value if the parent view doesn\'t rerender']() {
this.render(`{{unbound foo}} {{unbound bar}}`, {
foo: 'BORK',
barBinding: 'foo'
Copy link
Member

Choose a reason for hiding this comment

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

Can ✂️, I think?

@chancancode
Copy link
Member

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.

This moves the unbound tests to the new test infra and integrates
`unbound` to Glimmer.
@chancancode chancancode merged commit a62c820 into emberjs:master Mar 26, 2016
@chadhietala chadhietala deleted the glim-glam-unbound branch March 26, 2016 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants