@@ -9,7 +9,7 @@ describe('timepicker directive', function() {
99 $rootScope . time = newTime ( 14 , 40 , 25 ) ;
1010 $templateCache = _$templateCache_ ;
1111
12- element = $compile ( '<uib-timepicker ng-model="time"></uib-timepicker >' ) ( $rootScope ) ;
12+ element = $compile ( '<div uib-timepicker ng-model="time"></div >' ) ( $rootScope ) ;
1313 $rootScope . $digest ( ) ;
1414
1515 modelCtrl = element . controller ( 'ngModel' ) ;
@@ -130,7 +130,7 @@ describe('timepicker directive', function() {
130130
131131 it ( 'has `selected` current time when model is initially cleared' , function ( ) {
132132 $rootScope . time = null ;
133- element = $compile ( '<uib-timepicker ng-model="time"></uib-timepicker >' ) ( $rootScope ) ;
133+ element = $compile ( '<div uib-timepicker ng-model="time"></div >' ) ( $rootScope ) ;
134134 $rootScope . $digest ( ) ;
135135
136136 expect ( $rootScope . time ) . toBe ( null ) ;
@@ -385,7 +385,7 @@ describe('timepicker directive', function() {
385385 } ) ;
386386
387387 it ( 'changes only the time part when minutes change' , function ( ) {
388- element = $compile ( '<uib-timepicker ng-model="time" minute-step="15"></uib-timepicker >' ) ( $rootScope ) ;
388+ element = $compile ( '<div uib-timepicker ng-model="time" minute-step="15"></div >' ) ( $rootScope ) ;
389389 $rootScope . time = newTime ( 0 , 0 , 0 ) ;
390390 $rootScope . $digest ( ) ;
391391
@@ -648,7 +648,7 @@ describe('timepicker directive', function() {
648648 $rootScope . mstep = 30 ;
649649 $rootScope . sstep = 30 ;
650650 $rootScope . time = newTime ( 14 , 0 , 0 ) ;
651- element = $compile ( '<uib-timepicker ng-model="time" hour-step="hstep" minute-step="mstep" second-step="sstep"></uib-timepicker >' ) ( $rootScope ) ;
651+ element = $compile ( '<div uib-timepicker ng-model="time" hour-step="hstep" minute-step="mstep" second-step="sstep"></div >' ) ( $rootScope ) ;
652652 $rootScope . $digest ( ) ;
653653 } ) ;
654654
@@ -840,7 +840,7 @@ describe('timepicker directive', function() {
840840 beforeEach ( function ( ) {
841841 $rootScope . displaysSeconds = false ;
842842 $rootScope . time = newTime ( 14 , 40 , 35 ) ;
843- element = $compile ( '<uib-timepicker ng-model="time" show-seconds="displaysSeconds"></uib-timepicker >' ) ( $rootScope ) ;
843+ element = $compile ( '<div uib-timepicker ng-model="time" show-seconds="displaysSeconds"></div >' ) ( $rootScope ) ;
844844 $rootScope . $digest ( ) ;
845845 } ) ;
846846
@@ -914,7 +914,7 @@ describe('timepicker directive', function() {
914914 beforeEach ( function ( ) {
915915 $rootScope . meridian = false ;
916916 $rootScope . time = newTime ( 14 , 10 , 20 ) ;
917- element = $compile ( '<uib-timepicker ng-model="time" show-meridian="meridian"></uib-timepicker >' ) ( $rootScope ) ;
917+ element = $compile ( '<div uib-timepicker ng-model="time" show-meridian="meridian"></div >' ) ( $rootScope ) ;
918918 $rootScope . $digest ( ) ;
919919 } ) ;
920920
@@ -946,7 +946,7 @@ describe('timepicker directive', function() {
946946
947947 it ( 'handles correctly initially empty model on parent element' , function ( ) {
948948 $rootScope . time = null ;
949- element = $compile ( '<span ng-model="time"><uib-timepicker show-meridian="meridian"></uib-timepicker ></span>' ) ( $rootScope ) ;
949+ element = $compile ( '<span ng-model="time"><div uib-timepicker show-meridian="meridian"></div ></span>' ) ( $rootScope ) ;
950950 $rootScope . $digest ( ) ;
951951
952952 expect ( $rootScope . time ) . toBe ( null ) ;
@@ -956,7 +956,7 @@ describe('timepicker directive', function() {
956956 describe ( '`meridians` attribute' , function ( ) {
957957 beforeEach ( inject ( function ( ) {
958958 $rootScope . meridiansArray = [ 'am' , 'pm' ] ;
959- element = $compile ( '<uib-timepicker ng-model="time" meridians="meridiansArray"></uib-timepicker >' ) ( $rootScope ) ;
959+ element = $compile ( '<div uib-timepicker ng-model="time" meridians="meridiansArray"></div >' ) ( $rootScope ) ;
960960 $rootScope . $digest ( ) ;
961961 } ) ) ;
962962
@@ -974,7 +974,7 @@ describe('timepicker directive', function() {
974974 describe ( '`readonly-input` attribute' , function ( ) {
975975 beforeEach ( inject ( function ( ) {
976976 $rootScope . meridiansArray = [ 'am' , 'pm' ] ;
977- element = $compile ( '<uib-timepicker ng-model="time" readonly-input="true"></uib-timepicker >' ) ( $rootScope ) ;
977+ element = $compile ( '<div uib-timepicker ng-model="time" readonly-input="true"></div >' ) ( $rootScope ) ;
978978 $rootScope . $digest ( ) ;
979979 } ) ) ;
980980
@@ -993,7 +993,7 @@ describe('timepicker directive', function() {
993993 }
994994
995995 it ( 'should pad the hours by default' , function ( ) {
996- element = $compile ( '<uib-timepicker ng-model="time"></uib-timepicker >' ) ( $rootScope ) ;
996+ element = $compile ( '<div uib-timepicker ng-model="time"></div >' ) ( $rootScope ) ;
997997 $rootScope . $digest ( ) ;
998998
999999 var inputs = element . find ( 'input' ) ;
@@ -1005,7 +1005,7 @@ describe('timepicker directive', function() {
10051005 } ) ;
10061006
10071007 it ( 'should not pad the hours' , function ( ) {
1008- element = $compile ( '<uib-timepicker ng-model="time" pad-hours="false"></uib-timepicker >' ) ( $rootScope ) ;
1008+ element = $compile ( '<div uib-timepicker ng-model="time" pad-hours="false"></div >' ) ( $rootScope ) ;
10091009 $rootScope . $digest ( ) ;
10101010
10111011 var inputs = element . find ( 'input' ) ;
@@ -1025,7 +1025,7 @@ describe('timepicker directive', function() {
10251025 uibTimepickerConfig . minuteStep = 10 ;
10261026 uibTimepickerConfig . secondStep = 10 ;
10271027 uibTimepickerConfig . showMeridian = false ;
1028- element = $compile ( '<uib-timepicker ng-model="time"></uib-timepicker >' ) ( $rootScope ) ;
1028+ element = $compile ( '<div uib-timepicker ng-model="time"></div >' ) ( $rootScope ) ;
10291029 $rootScope . $digest ( ) ;
10301030 } ) ) ;
10311031
@@ -1086,7 +1086,7 @@ describe('timepicker directive', function() {
10861086 angular . extend ( originalConfig , uibTimepickerConfig ) ;
10871087 uibTimepickerConfig . meridians = [ 'π.μ.' , 'μ.μ.' ] ;
10881088 uibTimepickerConfig . showMeridian = true ;
1089- element = $compile ( '<uib-timepicker ng-model="time"></uib-timepicker >' ) ( $rootScope ) ;
1089+ element = $compile ( '<div uib-timepicker ng-model="time"></div >' ) ( $rootScope ) ;
10901090 $rootScope . $digest ( ) ;
10911091 } ) ) ;
10921092 afterEach ( inject ( function ( uibTimepickerConfig ) {
@@ -1116,7 +1116,7 @@ describe('timepicker directive', function() {
11161116 $templateCache . put ( newTemplateUrl , '<div>baz</div>' ) ;
11171117 uibTimepickerConfig . templateUrl = newTemplateUrl ;
11181118
1119- element = $compile ( '<uib-timepicker ng-model="time"></uib-timepicker >' ) ( $rootScope ) ;
1119+ element = $compile ( '<div uib-timepicker ng-model="time"></div >' ) ( $rootScope ) ;
11201120 $rootScope . $digest ( ) ;
11211121 } ) ) ;
11221122 afterEach ( inject ( function ( uibTimepickerConfig ) {
@@ -1126,7 +1126,7 @@ describe('timepicker directive', function() {
11261126
11271127 it ( 'should use a custom template' , function ( ) {
11281128 expect ( element [ 0 ] . tagName . toLowerCase ( ) ) . toBe ( 'div' ) ;
1129- expect ( element . html ( ) ) . toBe ( 'baz' ) ;
1129+ expect ( element . html ( ) ) . toBe ( '<div> baz</div> ' ) ;
11301130 } ) ;
11311131 } ) ;
11321132
@@ -1328,7 +1328,7 @@ describe('timepicker directive', function() {
13281328
13291329 it ( 'handles 12/24H mode change' , function ( ) {
13301330 $rootScope . meridian = true ;
1331- element = $compile ( '<uib-timepicker ng-model="time" show-meridian="meridian"></uib-timepicker >' ) ( $rootScope ) ;
1331+ element = $compile ( '<div uib-timepicker ng-model="time" show-meridian="meridian"></div >' ) ( $rootScope ) ;
13321332 $rootScope . $digest ( ) ;
13331333
13341334 var el = getHoursInputEl ( ) ;
@@ -1346,14 +1346,14 @@ describe('timepicker directive', function() {
13461346 } ) ;
13471347
13481348 it ( 'should have a default tabindex of 0' , function ( ) {
1349- element = $compile ( '<uib-timepicker ng-model="time"></uib-timepicker >' ) ( $rootScope ) ;
1349+ element = $compile ( '<div uib-timepicker ng-model="time"></div >' ) ( $rootScope ) ;
13501350 $rootScope . $digest ( ) ;
13511351
13521352 expect ( element . isolateScope ( ) . tabindex ) . toBe ( 0 ) ;
13531353 } ) ;
13541354
13551355 it ( 'should have the correct tabindex' , function ( ) {
1356- element = $compile ( '<uib-timepicker ng-model="time" tabindex="5"></uib-timepicker >' ) ( $rootScope ) ;
1356+ element = $compile ( '<div uib-timepicker ng-model="time" tabindex="5"></div >' ) ( $rootScope ) ;
13571357 $rootScope . $digest ( ) ;
13581358
13591359 expect ( element . attr ( 'tabindex' ) ) . toBe ( undefined ) ;
@@ -1363,7 +1363,7 @@ describe('timepicker directive', function() {
13631363
13641364 describe ( 'when model is not a Date' , function ( ) {
13651365 beforeEach ( inject ( function ( ) {
1366- element = $compile ( '<uib-timepicker ng-model="time"></uib-timepicker >' ) ( $rootScope ) ;
1366+ element = $compile ( '<div uib-timepicker ng-model="time"></div >' ) ( $rootScope ) ;
13671367 } ) ) ;
13681368
13691369 it ( 'should not be invalid when the model is null' , function ( ) {
@@ -1415,7 +1415,7 @@ describe('timepicker directive', function() {
14151415 describe ( 'use with `ng-required` directive' , function ( ) {
14161416 beforeEach ( inject ( function ( ) {
14171417 $rootScope . time = null ;
1418- element = $compile ( '<uib-timepicker ng-model="time" ng-required="true"></uib-timepicker >' ) ( $rootScope ) ;
1418+ element = $compile ( '<div uib-timepicker ng-model="time" ng-required="true"></div >' ) ( $rootScope ) ;
14191419 $rootScope . $digest ( ) ;
14201420 } ) ) ;
14211421
@@ -1434,7 +1434,7 @@ describe('timepicker directive', function() {
14341434 beforeEach ( inject ( function ( ) {
14351435 $rootScope . changeHandler = jasmine . createSpy ( 'changeHandler' ) ;
14361436 $rootScope . time = new Date ( ) ;
1437- element = $compile ( '<uib-timepicker ng-model="time" ng-change="changeHandler()"></uib-timepicker >' ) ( $rootScope ) ;
1437+ element = $compile ( '<div uib-timepicker ng-model="time" ng-change="changeHandler()"></div >' ) ( $rootScope ) ;
14381438 $rootScope . $digest ( ) ;
14391439 } ) ) ;
14401440
@@ -1465,7 +1465,7 @@ describe('timepicker directive', function() {
14651465 describe ( 'when used with min' , function ( ) {
14661466 var changeInputValueTo ;
14671467 beforeEach ( inject ( function ( $sniffer ) {
1468- element = $compile ( '<uib-timepicker ng-model="time" min="min"></uib-timepicker >' ) ( $rootScope ) ;
1468+ element = $compile ( '<div uib-timepicker ng-model="time" min="min"></div >' ) ( $rootScope ) ;
14691469 $rootScope . $digest ( ) ;
14701470 changeInputValueTo = function ( inputEl , value ) {
14711471 inputEl . val ( value ) ;
@@ -1792,7 +1792,7 @@ describe('timepicker directive', function() {
17921792 describe ( 'when used with max' , function ( ) {
17931793 var changeInputValueTo ;
17941794 beforeEach ( inject ( function ( $sniffer ) {
1795- element = $compile ( '<uib-timepicker ng-model="time" max="max"></uib-timepicker >' ) ( $rootScope ) ;
1795+ element = $compile ( '<div uib-timepicker ng-model="time" max="max"></div >' ) ( $rootScope ) ;
17961796 $rootScope . $digest ( ) ;
17971797 changeInputValueTo = function ( inputEl , value ) {
17981798 inputEl . val ( value ) ;
@@ -2121,16 +2121,16 @@ describe('timepicker directive', function() {
21212121 it ( 'should allow custom templates' , function ( ) {
21222122 $templateCache . put ( 'foo/bar.html' , '<div>baz</div>' ) ;
21232123
2124- element = $compile ( '<uib-timepicker ng-model="time" template-url="foo/bar.html"></uib-timepicker >' ) ( $rootScope ) ;
2124+ element = $compile ( '<div uib-timepicker ng-model="time" template-url="foo/bar.html"></div >' ) ( $rootScope ) ;
21252125 $rootScope . $digest ( ) ;
21262126 expect ( element [ 0 ] . tagName . toLowerCase ( ) ) . toBe ( 'div' ) ;
2127- expect ( element . html ( ) ) . toBe ( 'baz' ) ;
2127+ expect ( element . html ( ) ) . toBe ( '<div> baz</div> ' ) ;
21282128 } ) ;
21292129
21302130 it ( 'should expose the controller on the view' , function ( ) {
21312131 $templateCache . put ( 'uib/template/timepicker/timepicker.html' , '<div><div>{{timepicker.text}}</div></div>' ) ;
21322132
2133- element = $compile ( '<uib-timepicker ng-model="time"></uib-timepicker >' ) ( $rootScope ) ;
2133+ element = $compile ( '<div uib-timepicker ng-model="time"></div >' ) ( $rootScope ) ;
21342134 $rootScope . $digest ( ) ;
21352135
21362136 var ctrl = element . controller ( 'uibTimepicker' ) ;
@@ -2139,14 +2139,14 @@ describe('timepicker directive', function() {
21392139 ctrl . text = 'foo' ;
21402140 $rootScope . $digest ( ) ;
21412141
2142- expect ( element . html ( ) ) . toBe ( '<div class="ng-binding">foo</div>' ) ;
2142+ expect ( element . html ( ) ) . toBe ( '<div><div class="ng-binding">foo</div> </div>' ) ;
21432143 } ) ;
21442144 } ) ;
21452145
21462146 describe ( 'ngDisabled' , function ( ) {
21472147 it ( 'prevents modifying date via controls when true' , function ( ) {
21482148 $rootScope . disabled = false ;
2149- element = $compile ( '<uib-timepicker ng-model="time" ng-disabled="disabled"></uib-timepicker ' ) ( $rootScope ) ;
2149+ element = $compile ( '<div uib-timepicker ng-model="time" ng-disabled="disabled"></div> ' ) ( $rootScope ) ;
21502150 $rootScope . $digest ( ) ;
21512151
21522152 var inputs = element . find ( 'input' ) ;
@@ -2250,7 +2250,7 @@ describe('timepicker directive', function() {
22502250 var $scope ;
22512251 beforeEach ( inject ( function ( ) {
22522252 $scope = $rootScope . $new ( ) ;
2253- element = $compile ( '<uib-timepicker ng-model="time"></uib-timepicker >' ) ( $scope ) ;
2253+ element = $compile ( '<div uib-timepicker ng-model="time"></div >' ) ( $scope ) ;
22542254 $rootScope . $digest ( ) ;
22552255 } ) ) ;
22562256
0 commit comments