From 794954afe5e450933b49b12d43bb660bd6337e68 Mon Sep 17 00:00:00 2001 From: Tasos Bekos Date: Wed, 5 Feb 2014 15:47:15 +0100 Subject: [PATCH] fix(alert): add `alert-dismissable` class Closes #1745 --- src/alert/test/alert.spec.js | 6 ++++-- template/alert/alert.html | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/alert/test/alert.spec.js b/src/alert/test/alert.spec.js index bfca85b298..5f7e220e3a 100644 --- a/src/alert/test/alert.spec.js +++ b/src/alert/test/alert.spec.js @@ -59,11 +59,12 @@ describe('alert', function () { } }); - it('should show close buttons', function () { + it('should show close buttons and have the dismissable class', function () { var alerts = createAlerts(); for (var i = 0, n = alerts.length; i < n; i++) { expect(findCloseButton(i).css('display')).not.toBe('none'); + expect(alerts.eq(i)).toHaveClass('alert-dismissable'); } }); @@ -81,10 +82,11 @@ describe('alert', function () { expect(scope.removeAlert).toHaveBeenCalledWith(1); }); - it('should not show close buttons if no close callback specified', function () { + it('should not show close button and have the dismissable class if no close callback specified', function () { element = $compile('No close')(scope); scope.$digest(); expect(findCloseButton(0)).toBeHidden(); + expect(element).not.toHaveClass('alert-dismissable'); }); it('should be possible to add additional classes for alert', function () { diff --git a/template/alert/alert.html b/template/alert/alert.html index 957d6ec444..bb43e01c04 100644 --- a/template/alert/alert.html +++ b/template/alert/alert.html @@ -1,4 +1,4 @@ -
- +
+