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

Commit bed92aa

Browse files
committed
fixup! fix(input): fix step validation for input[number]/input[range]
1 parent 7039395 commit bed92aa

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

test/ng/directive/inputSpec.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -2731,7 +2731,8 @@ describe('input', function() {
27312731
expect(inputElm).toBeValid();
27322732
expect($rootScope.value).toBe(8);
27332733

2734-
$rootScope.$apply('min = 10; step = 20; value = 30');
2734+
$rootScope.$apply('min = 10; step = 20');
2735+
helper.changeInputValueTo('30');
27352736
expect(inputElm.val()).toBe('30');
27362737
expect(inputElm).toBeValid();
27372738
expect($rootScope.value).toBe(30);
@@ -2748,7 +2749,8 @@ describe('input', function() {
27482749
expect($rootScope.value).toBe(30);
27492750

27502751
// 0.3 - 0.2 === 0.09999999999999998
2751-
$rootScope.$apply('min = 0.2; step = 0.09999999999999998; value = 0.3');
2752+
$rootScope.$apply('min = 0.2; step = (0.3 - 0.2)');
2753+
helper.changeInputValueTo('0.3');
27522754
expect(inputElm.val()).toBe('0.3');
27532755
expect(inputElm).toBeInvalid();
27542756
expect(ngModel.$error.step).toBe(true);

0 commit comments

Comments
 (0)