This repository was archived by the owner on May 29, 2019. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -59,11 +59,12 @@ describe('alert', function () {
5959 }
6060 } ) ;
6161
62- it ( 'should show close buttons' , function ( ) {
62+ it ( 'should show close buttons and have the dismissable class ' , function ( ) {
6363 var alerts = createAlerts ( ) ;
6464
6565 for ( var i = 0 , n = alerts . length ; i < n ; i ++ ) {
6666 expect ( findCloseButton ( i ) . css ( 'display' ) ) . not . toBe ( 'none' ) ;
67+ expect ( alerts . eq ( i ) ) . toHaveClass ( 'alert-dismissable' ) ;
6768 }
6869 } ) ;
6970
@@ -81,10 +82,11 @@ describe('alert', function () {
8182 expect ( scope . removeAlert ) . toHaveBeenCalledWith ( 1 ) ;
8283 } ) ;
8384
84- it ( 'should not show close buttons if no close callback specified' , function ( ) {
85+ it ( 'should not show close button and have the dismissable class if no close callback specified' , function ( ) {
8586 element = $compile ( '<alert>No close</alert>' ) ( scope ) ;
8687 scope . $digest ( ) ;
8788 expect ( findCloseButton ( 0 ) ) . toBeHidden ( ) ;
89+ expect ( element ) . not . toHaveClass ( 'alert-dismissable' ) ;
8890 } ) ;
8991
9092 it ( 'should be possible to add additional classes for alert' , function ( ) {
Original file line number Diff line number Diff line change 1- < div class =' alert ' ng-class =' " alert-" + ( type || " warning") ' >
2- < button ng-show =' closeable ' type =' button ' class =' close ' ng-click =' close() ' > ×</ button >
1+ < div class =" alert " ng-class =" {' alert-{{ type || ' warning'}}': true, 'alert-dismissable': closeable} " >
2+ < button ng-show =" closeable " type =" button " class =" close " ng-click =" close() " > ×</ button >
33 < div ng-transclude > </ div >
44</ div >
You can’t perform that action at this time.
0 commit comments