File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
spec/javascripts/directives Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -35,18 +35,19 @@ describe('checkchange initialization', function() {
3535
3636 $scope . $digest ( ) ;
3737 var newDate = new Date ( ) ;
38- form . repo_path . $setViewValue ( moment . utc ( [ newDate . getFullYear ( ) , newDate . getMonth ( ) , newDate . getDay ( ) ] ) ) ;
38+ form . repo_path . $setViewValue ( moment . utc ( [ newDate . getFullYear ( ) , newDate . getMonth ( ) , newDate . getDate ( ) ] ) ) ;
3939 expect ( form . repo_path . $pristine ) . toBe ( false ) ;
4040 expect ( form . $pristine ) . toBe ( false ) ;
4141 } ) ;
4242
4343 it ( 'should set the value and form to a pristine state when a date is unchanged' , function ( ) {
4444 var newDate = new Date ( ) ;
45+ var mockDate = moment . utc ( [ newDate . getFullYear ( ) , newDate . getMonth ( ) , newDate . getDate ( ) ] ) . toDate ( ) ;
4546 $scope . repoModel = { repo_path : undefined } ;
46- $scope . modelCopy = { repo_path : moment . utc ( [ newDate . getFullYear ( ) , newDate . getMonth ( ) , newDate . getDay ( ) ] ) . toDate ( ) } ;
47+ $scope . modelCopy = { repo_path : mockDate } ;
4748
4849 $scope . $digest ( ) ;
49- form . repo_path . $setViewValue ( moment . utc ( [ newDate . getFullYear ( ) , newDate . getMonth ( ) , newDate . getDay ( ) ] ) . toDate ( ) ) ;
50+ form . repo_path . $setViewValue ( mockDate ) ;
5051 expect ( form . repo_path . $pristine ) . toBe ( true ) ;
5152 expect ( form . $pristine ) . toBe ( true ) ;
5253 } ) ;
You can’t perform that action at this time.
0 commit comments