Skip to content
This repository has been archived by the owner on Jul 29, 2024. It is now read-only.

Commit

Permalink
fix(by.exactRepeater): should split by "="
Browse files Browse the repository at this point in the history
Closes #2335
  • Loading branch information
sjelin committed Jul 13, 2015
1 parent 11a9c12 commit b147033
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/clientsidescripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ functions.findBindings = function(binding, exactMatch, using, rootSelector) {
function repeaterMatch(ngRepeat, repeater, exact) {
if (exact) {
return ngRepeat.split(' track by ')[0].split(' as ')[0].split('|')[0].
trim() == repeater;
split('=')[0].trim() == repeater;
} else {
return ngRepeat.indexOf(repeater) != -1;
}
Expand Down Expand Up @@ -166,7 +166,7 @@ functions.findBindings = function(binding, exactMatch, using, rootSelector) {
function repeaterMatch(ngRepeat, repeater, exact) {
if (exact) {
return ngRepeat.split(' track by ')[0].split(' as ')[0].split('|')[0].
trim() == repeater;
split('=')[0].trim() == repeater;
} else {
return ngRepeat.indexOf(repeater) != -1;
}
Expand Down Expand Up @@ -222,7 +222,7 @@ functions.findRepeaterElement = function(repeater, exact, index, binding, using,
function repeaterMatch(ngRepeat, repeater, exact) {
if (exact) {
return ngRepeat.split(' track by ')[0].split(' as ')[0].split('|')[0].
trim() == repeater;
split('=')[0].trim() == repeater;
} else {
return ngRepeat.indexOf(repeater) != -1;
}
Expand Down Expand Up @@ -329,7 +329,7 @@ functions.findRepeaterColumn = function(repeater, exact, binding, using, rootSel
function repeaterMatch(ngRepeat, repeater, exact) {
if (exact) {
return ngRepeat.split(' track by ')[0].split(' as ')[0].split('|')[0].
trim() == repeater;
split('=')[0].trim() == repeater;
} else {
return ngRepeat.indexOf(repeater) != -1;
}
Expand Down
4 changes: 4 additions & 0 deletions spec/basic/locators_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,10 @@ describe('locators', function() {
var partialRowMatch = element(
by.repeater('baz in days').row(0));
expect(partialRowMatch.getText()).toEqual('T');

var partialRowMatch = element(
by.repeater('baz in tDays').row(0));
expect(partialRowMatch.getText()).toEqual('T');
});

it('should return all rows when unmodified', function() {
Expand Down
3 changes: 3 additions & 0 deletions testapp/repeater/repeater.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
<ul><li ng-repeat="baz in days | filter:'T'">
<span>{{baz.initial}}</span>
</li></ul>
<ul><li ng-repeat="baz in tDays = (days | filter:'T')">
<span>{{baz.initial}}</span>
</li></ul>
<ul><li data-ng-repeat="day in days">
<span>{{day.initial}}</span>
</li></ul>
Expand Down

0 comments on commit b147033

Please sign in to comment.