Skip to content

Commit 920787a

Browse files
committed
refactor(jqLite): use the toEqualOneOf matcher in jqLite tests
1 parent 5b2fdd8 commit 920787a

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

test/jqLiteSpec.js

+3-12
Original file line numberDiff line numberDiff line change
@@ -1026,22 +1026,13 @@ describe('jqLite', function() {
10261026
'<option>test 2</option>' +
10271027
'</select>').val()).toEqual(['test 1']);
10281028

1029-
// In jQuery >= 3.0 .val() on select[multiple] with no selected options returns an
1030-
// empty array, not null.
1031-
// See https://github.com/jquery/jquery/issues/2562 for more details.
1032-
// jqLite will align with jQuery 3.0 behavior in Angular 1.6.
1033-
var val;
1034-
if (_jqLiteMode || isJQuery2x()) {
1035-
val = null;
1036-
} else {
1037-
val = [];
1038-
}
1039-
1029+
// In jQuery < 3.0 .val() on select[multiple] with no selected options returns an
1030+
// null instead of an empty array.
10401031
expect(jqLite(
10411032
'<select multiple>' +
10421033
'<option>test 1</option>' +
10431034
'<option>test 2</option>' +
1044-
'</select>').val()).toEqual(val);
1035+
'</select>').val()).toEqualOneOf(null, []);
10451036
});
10461037
});
10471038

0 commit comments

Comments
 (0)