@@ -1917,6 +1917,71 @@ describe('input', function() {
1917
1917
} ) ;
1918
1918
1919
1919
1920
+ it ( 'should parse exponential notation' , function ( ) {
1921
+ var inputElm = helper . compileInput ( '<input type="number" name="alias" ng-model="value" />' ) ;
1922
+
1923
+ // #.###e+##
1924
+ $rootScope . form . alias . $setViewValue ( "1.23214124123412412e+26" ) ;
1925
+ expect ( inputElm ) . toBeValid ( ) ;
1926
+ expect ( $rootScope . value ) . toBe ( 1.23214124123412412e+26 ) ;
1927
+
1928
+ // #.###e##
1929
+ $rootScope . form . alias . $setViewValue ( "1.23214124123412412e26" ) ;
1930
+ expect ( inputElm ) . toBeValid ( ) ;
1931
+ expect ( $rootScope . value ) . toBe ( 1.23214124123412412e26 ) ;
1932
+
1933
+ // #.###e-##
1934
+ $rootScope . form . alias . $setViewValue ( "1.23214124123412412e-26" ) ;
1935
+ expect ( inputElm ) . toBeValid ( ) ;
1936
+ expect ( $rootScope . value ) . toBe ( 1.23214124123412412e-26 ) ;
1937
+
1938
+ // ####e+##
1939
+ $rootScope . form . alias . $setViewValue ( "123214124123412412e+26" ) ;
1940
+ expect ( inputElm ) . toBeValid ( ) ;
1941
+ expect ( $rootScope . value ) . toBe ( 123214124123412412e26 ) ;
1942
+
1943
+ // ####e##
1944
+ $rootScope . form . alias . $setViewValue ( "123214124123412412e26" ) ;
1945
+ expect ( inputElm ) . toBeValid ( ) ;
1946
+ expect ( $rootScope . value ) . toBe ( 123214124123412412e26 ) ;
1947
+
1948
+ // ####e-##
1949
+ $rootScope . form . alias . $setViewValue ( "123214124123412412e-26" ) ;
1950
+ expect ( inputElm ) . toBeValid ( ) ;
1951
+ expect ( $rootScope . value ) . toBe ( 123214124123412412e-26 ) ;
1952
+
1953
+ // #.###E+##
1954
+ $rootScope . form . alias . $setViewValue ( "1.23214124123412412E+26" ) ;
1955
+ expect ( inputElm ) . toBeValid ( ) ;
1956
+ expect ( $rootScope . value ) . toBe ( 1.23214124123412412e+26 ) ;
1957
+
1958
+ // #.###E##
1959
+ $rootScope . form . alias . $setViewValue ( "1.23214124123412412E26" ) ;
1960
+ expect ( inputElm ) . toBeValid ( ) ;
1961
+ expect ( $rootScope . value ) . toBe ( 1.23214124123412412e26 ) ;
1962
+
1963
+ // #.###E-##
1964
+ $rootScope . form . alias . $setViewValue ( "1.23214124123412412E-26" ) ;
1965
+ expect ( inputElm ) . toBeValid ( ) ;
1966
+ expect ( $rootScope . value ) . toBe ( 1.23214124123412412e-26 ) ;
1967
+
1968
+ // ####E+##
1969
+ $rootScope . form . alias . $setViewValue ( "123214124123412412E+26" ) ;
1970
+ expect ( inputElm ) . toBeValid ( ) ;
1971
+ expect ( $rootScope . value ) . toBe ( 123214124123412412e26 ) ;
1972
+
1973
+ // ####E##
1974
+ $rootScope . form . alias . $setViewValue ( "123214124123412412E26" ) ;
1975
+ expect ( inputElm ) . toBeValid ( ) ;
1976
+ expect ( $rootScope . value ) . toBe ( 123214124123412412e26 ) ;
1977
+
1978
+ // ####E-##
1979
+ $rootScope . form . alias . $setViewValue ( "123214124123412412E-26" ) ;
1980
+ expect ( inputElm ) . toBeValid ( ) ;
1981
+ expect ( $rootScope . value ) . toBe ( 123214124123412412e-26 ) ;
1982
+ } ) ;
1983
+
1984
+
1920
1985
describe ( 'min' , function ( ) {
1921
1986
1922
1987
it ( 'should validate' , function ( ) {
0 commit comments