This repository was archived by the owner on May 29, 2019. It is now read-only.
File tree 2 files changed +6
-4
lines changed
2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -59,11 +59,12 @@ describe('alert', function () {
59
59
}
60
60
} ) ;
61
61
62
- it ( 'should show close buttons' , function ( ) {
62
+ it ( 'should show close buttons and have the dismissable class ' , function ( ) {
63
63
var alerts = createAlerts ( ) ;
64
64
65
65
for ( var i = 0 , n = alerts . length ; i < n ; i ++ ) {
66
66
expect ( findCloseButton ( i ) . css ( 'display' ) ) . not . toBe ( 'none' ) ;
67
+ expect ( alerts . eq ( i ) ) . toHaveClass ( 'alert-dismissable' ) ;
67
68
}
68
69
} ) ;
69
70
@@ -81,10 +82,11 @@ describe('alert', function () {
81
82
expect ( scope . removeAlert ) . toHaveBeenCalledWith ( 1 ) ;
82
83
} ) ;
83
84
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 ( ) {
85
86
element = $compile ( '<alert>No close</alert>' ) ( scope ) ;
86
87
scope . $digest ( ) ;
87
88
expect ( findCloseButton ( 0 ) ) . toBeHidden ( ) ;
89
+ expect ( element ) . not . toHaveClass ( 'alert-dismissable' ) ;
88
90
} ) ;
89
91
90
92
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 >
3
3
< div ng-transclude > </ div >
4
4
</ div >
You can’t perform that action at this time.
0 commit comments