This repository was archived by the owner on May 29, 2019. It is now read-only.
File tree 1 file changed +31
-0
lines changed
1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -1128,4 +1128,35 @@ describe('$uibTooltipProvider', function() {
1128
1128
} ) ) ;
1129
1129
} ) ;
1130
1130
} ) ;
1131
+
1132
+ describe ( 'placementClassPrefix' , function ( ) {
1133
+ beforeEach ( module ( 'ui.bootstrap.tooltip' , function ( $uibTooltipProvider ) {
1134
+ $uibTooltipProvider . options ( { placementClassPrefix : 'uib-' } ) ;
1135
+ } ) ) ;
1136
+
1137
+ // load the template
1138
+ beforeEach ( module ( 'uib/template/tooltip/tooltip-popup.html' ) ) ;
1139
+
1140
+ it ( 'should add the classes' , inject ( function ( $rootScope , $compile , $timeout ) {
1141
+ elmBody = angular . element (
1142
+ '<div><span uib-tooltip="tooltip text" tooltip-placement="top-right"></span></div>'
1143
+ ) ;
1144
+
1145
+ scope = $rootScope ;
1146
+ $compile ( elmBody ) ( scope ) ;
1147
+ scope . $digest ( ) ;
1148
+ elm = elmBody . find ( 'span' ) ;
1149
+ elmScope = elm . scope ( ) ;
1150
+ tooltipScope = elmScope . $$childTail ;
1151
+
1152
+ expect ( elmBody . children ( ) . length ) . toBe ( 1 ) ;
1153
+
1154
+ trigger ( elm , 'mouseenter' ) ;
1155
+ $timeout . flush ( ) ;
1156
+
1157
+ var tooltipElm = elmBody . find ( '.tooltip' ) ;
1158
+ expect ( tooltipElm . hasClass ( 'top' ) ) . toBe ( true ) ;
1159
+ expect ( tooltipElm . hasClass ( 'uib-top-right' ) ) . toBe ( true ) ;
1160
+ } ) ) ;
1161
+ } ) ;
1131
1162
} ) ;
You can’t perform that action at this time.
0 commit comments