Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

fix(ngMessageFormat): ensure bindings are valid for Protractor #11644

Closed
wants to merge 1 commit into from

Conversation

petebacondarwin
Copy link
Contributor

Yes, yes, I know. This PR requires unit tests, etc, etc.
Just pushing here for @chirayuk to take care of. Thanks @chirayuk !

@petebacondarwin
Copy link
Contributor Author

To recreate the issue we just need to have an ICU plural message interpolation, the run a protractor spec that tries to find an element by a binding....

      {{ app.filteredRestaurants.length, plural,
        =0 {No restaurants found!}
        =1 {Only one restaurant found!}
        other {# restaurants found.}
      }}
    var userNameDisplay = element(by.binding('app.user.name'));

The call to by.binding('...') triggers a call in angular.js of testability.findBindings which tries to find the expression in the binding name:

if (bindingName.indexOf(expression) != -1) {

But without this fix we have a binding that consists of an array with on undefined item.

@chirayuk
Copy link
Contributor

Thanks. I'll work on this PR in the next hour or so!

@chirayuk
Copy link
Contributor

I'm waiting for Travis status. However, I think this one is good to merge once it's confirmed to pass on Travis. See #11649 which has the changes to the test files and some symbol renaming protection. (Please merge that one if I go to bed before I'm able to merge this.)

netman92 pushed a commit to netman92/angular.js that referenced this pull request Aug 8, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants