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

Commit b147033

Browse files
committed
fix(by.exactRepeater): should split by "="
Closes #2335
1 parent 11a9c12 commit b147033

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

lib/clientsidescripts.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ functions.findBindings = function(binding, exactMatch, using, rootSelector) {
107107
function repeaterMatch(ngRepeat, repeater, exact) {
108108
if (exact) {
109109
return ngRepeat.split(' track by ')[0].split(' as ')[0].split('|')[0].
110-
trim() == repeater;
110+
split('=')[0].trim() == repeater;
111111
} else {
112112
return ngRepeat.indexOf(repeater) != -1;
113113
}
@@ -166,7 +166,7 @@ functions.findBindings = function(binding, exactMatch, using, rootSelector) {
166166
function repeaterMatch(ngRepeat, repeater, exact) {
167167
if (exact) {
168168
return ngRepeat.split(' track by ')[0].split(' as ')[0].split('|')[0].
169-
trim() == repeater;
169+
split('=')[0].trim() == repeater;
170170
} else {
171171
return ngRepeat.indexOf(repeater) != -1;
172172
}
@@ -222,7 +222,7 @@ functions.findRepeaterElement = function(repeater, exact, index, binding, using,
222222
function repeaterMatch(ngRepeat, repeater, exact) {
223223
if (exact) {
224224
return ngRepeat.split(' track by ')[0].split(' as ')[0].split('|')[0].
225-
trim() == repeater;
225+
split('=')[0].trim() == repeater;
226226
} else {
227227
return ngRepeat.indexOf(repeater) != -1;
228228
}
@@ -329,7 +329,7 @@ functions.findRepeaterColumn = function(repeater, exact, binding, using, rootSel
329329
function repeaterMatch(ngRepeat, repeater, exact) {
330330
if (exact) {
331331
return ngRepeat.split(' track by ')[0].split(' as ')[0].split('|')[0].
332-
trim() == repeater;
332+
split('=')[0].trim() == repeater;
333333
} else {
334334
return ngRepeat.indexOf(repeater) != -1;
335335
}

spec/basic/locators_spec.js

+4
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,10 @@ describe('locators', function() {
184184
var partialRowMatch = element(
185185
by.repeater('baz in days').row(0));
186186
expect(partialRowMatch.getText()).toEqual('T');
187+
188+
var partialRowMatch = element(
189+
by.repeater('baz in tDays').row(0));
190+
expect(partialRowMatch.getText()).toEqual('T');
187191
});
188192

189193
it('should return all rows when unmodified', function() {

testapp/repeater/repeater.html

+3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
<ul><li ng-repeat="baz in days | filter:'T'">
77
<span>{{baz.initial}}</span>
88
</li></ul>
9+
<ul><li ng-repeat="baz in tDays = (days | filter:'T')">
10+
<span>{{baz.initial}}</span>
11+
</li></ul>
912
<ul><li data-ng-repeat="day in days">
1013
<span>{{day.initial}}</span>
1114
</li></ul>

0 commit comments

Comments
 (0)