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

Two way address bar #257

Merged
merged 6 commits into from
Oct 28, 2015
Merged

Two way address bar #257

merged 6 commits into from
Oct 28, 2015

Conversation

Gaurav0
Copy link
Contributor

@Gaurav0 Gaurav0 commented Oct 28, 2015

This updates PR #248 with tests that pass reliably in PhantomJS

@joostdevries @rwjblue @alexspeller @stefanpenner Please review.

pangratz and others added 3 commits October 27, 2015 17:05
This change makes the address bar for the demo app functional, so
entering a new URL and pressing enter triggers a transition to that URL
in the demo app.

change(event) {
this.sendAction("urlChanged", event.target.value);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Just to be sure, this will be fired when a new URL is entered and the element is blurred, right? In the previous commit, the action is only fired, when enter is pressed...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure. But it seems that in testing, fillIn never fires the enter event, whatever you do.

http://stackoverflow.com/questions/28586314/trigger-an-inputs-action-from-an-acceptance-test#comment45530171_28596428

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@pangratz Yes, blurring now makes the page switch.

@pangratz
Copy link
Contributor

Apart from my comment, this looks good! Thanks for fixing my failing tests @Gaurav0 😄

I guess waiting for the iframe to be loaded could eventually be refactored using Ember.Test.registerWaiter, but this is out of the scope for this PR.

iframe_window = outputPane();
iframe_window.click(iframe_window.find(aboutLink)).then(resolve);

done();
Copy link
Contributor

Choose a reason for hiding this comment

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

resolve(); should remove the need for done / async

@Gaurav0
Copy link
Contributor Author

Gaurav0 commented Oct 28, 2015

@joostdevries @rwjblue @alexspeller @stefanpenner @pangratz All comments addressed. Please let me know if ok to merge.

@joostdevries
Copy link
Member

lgtm 👍

Gaurav0 added a commit that referenced this pull request Oct 28, 2015
@Gaurav0 Gaurav0 merged commit 98dbf21 into ember-cli:master Oct 28, 2015
@Gaurav0 Gaurav0 deleted the two_way_address_bar branch October 28, 2015 20:01
@pangratz
Copy link
Contributor

wohoo, party! 🎉

},

afterEach: function() {
window.messagesWaiting = 0;
if (this._waiter) {
Copy link
Contributor

Choose a reason for hiding this comment

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

The idea was for the app code to do the waiting code, as it understands the async more closely.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The problem with that is that one app sends the communication and a different app receives it. This isn't really "async", the main app just receives a communication and doesn't know when to stop and wait for it. The iframe app can't communicate to the main app except through this channel.

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe an event on willTransition should be send in the demo app as well. I will try to look into this tomorrow...

@joostdevries
Copy link
Member

@stefanpenner @Gaurav0 I think this is a huge step forward. A next iteration on this would ideally restart the app with the provided route as initial state (so you can more effectively debug model hook issues). cc @rwjblue

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