Skip to content
This repository was archived by the owner on May 29, 2019. It is now read-only.

Commit a3d53d8

Browse files
buberddspkozlowski-opensource
authored andcommitted
fix(progress): class names update
Closes #1241
1 parent 42475fd commit a3d53d8

File tree

2 files changed

+36
-36
lines changed

2 files changed

+36
-36
lines changed

src/progressbar/test/progressbar.spec.js

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ describe('progressbar directive with no binding', function () {
1313
expect(element.hasClass('progress')).toBe(true);
1414
});
1515

16-
it('contains one child element with "bar" css class', function() {
16+
it('contains one child element with "progress-bar" css class', function() {
1717
expect(element.children().length).toBe(1);
18-
expect(element.children().eq(0).hasClass('bar')).toBe(true);
18+
expect(element.children().eq(0).hasClass('progress-bar')).toBe(true);
1919
});
2020

21-
it('has a "bar" element with expected width', function() {
21+
it('has a "progress-bar" element with expected width', function() {
2222
expect(element.children().eq(0).css('width')).toBe('22%');
2323
});
2424
});
@@ -39,12 +39,12 @@ describe('progressbar directive with data-binding', function () {
3939
expect(element.hasClass('progress')).toBe(true);
4040
});
4141

42-
it('contains one child element with "bar" css class', function() {
42+
it('contains one child element with "progress-bar" css class', function() {
4343
expect(element.children().length).toBe(1);
44-
expect(element.children().eq(0).hasClass('bar')).toBe(true);
44+
expect(element.children().eq(0).hasClass('progress-bar')).toBe(true);
4545
});
4646

47-
it('has a "bar" element with expected width', function() {
47+
it('has a "progress-bar" element with expected width', function() {
4848
expect(element.children().eq(0).css('width')).toBe('33%');
4949
});
5050

@@ -53,7 +53,7 @@ describe('progressbar directive with data-binding', function () {
5353
$rootScope.$digest();
5454
expect(element.children().length).toBe(1);
5555
expect(element.children().eq(0).css('width')).toBe('55%');
56-
expect(element.children().eq(0).hasClass('bar')).toBe(true);
56+
expect(element.children().eq(0).hasClass('progress-bar')).toBe(true);
5757

5858
$rootScope.percent += 11;
5959
$rootScope.$digest();
@@ -76,8 +76,8 @@ describe('progressbar directive with data-binding', function () {
7676

7777
var barElement = element.children().eq(0);
7878
expect(barElement.css('width')).toBe('45%');
79-
expect(barElement.hasClass('bar')).toBe(true);
80-
expect(barElement.hasClass('bar-warning')).toBe(true);
79+
expect(barElement.hasClass('progress-bar')).toBe(true);
80+
expect(barElement.hasClass('progress-bar-warning')).toBe(true);
8181
});
8282

8383
});
@@ -98,11 +98,11 @@ describe('stacked progressbar directive', function () {
9898
expect(element.hasClass('progress')).toBe(true);
9999
});
100100

101-
it('contains tree child elements with "bar" css class each', function() {
101+
it('contains tree child elements with "progress-bar" css class each', function() {
102102
expect(element.children().length).toBe(3);
103-
expect(element.children().eq(0).hasClass('bar')).toBe(true);
104-
expect(element.children().eq(1).hasClass('bar')).toBe(true);
105-
expect(element.children().eq(2).hasClass('bar')).toBe(true);
103+
expect(element.children().eq(0).hasClass('progress-bar')).toBe(true);
104+
expect(element.children().eq(1).hasClass('progress-bar')).toBe(true);
105+
expect(element.children().eq(2).hasClass('progress-bar')).toBe(true);
106106
});
107107

108108
it('has a elements with expected width', function() {
@@ -144,18 +144,18 @@ describe('stacked progressbar directive', function () {
144144

145145
barElement = element.children().eq(0);
146146
expect(barElement.css('width')).toBe('12%');
147-
expect(barElement.hasClass('bar')).toBe(true);
148-
expect(barElement.hasClass('bar-danger')).toBe(false);
147+
expect(barElement.hasClass('progress-bar')).toBe(true);
148+
expect(barElement.hasClass('progress-bar-danger')).toBe(false);
149149

150150
barElement = element.children().eq(1);
151151
expect(barElement.css('width')).toBe('29%');
152-
expect(barElement.hasClass('bar')).toBe(true);
153-
expect(barElement.hasClass('bar-danger')).toBe(true);
152+
expect(barElement.hasClass('progress-bar')).toBe(true);
153+
expect(barElement.hasClass('progress-bar-danger')).toBe(true);
154154

155155
barElement = element.children().eq(2);
156156
expect(barElement.css('width')).toBe('33%');
157-
expect(barElement.hasClass('bar')).toBe(true);
158-
expect(barElement.hasClass('bar-danger')).toBe(false);
157+
expect(barElement.hasClass('progress-bar')).toBe(true);
158+
expect(barElement.hasClass('progress-bar-danger')).toBe(false);
159159
});
160160

161161
it('can handle mixed objects with custom classes', function() {
@@ -174,23 +174,23 @@ describe('stacked progressbar directive', function () {
174174

175175
barElement = element.children().eq(0);
176176
expect(barElement.css('width')).toBe('15%');
177-
expect(barElement.hasClass('bar-info')).toBe(true);
177+
expect(barElement.hasClass('progress-bar-info')).toBe(true);
178178

179179
barElement = element.children().eq(1);
180180
expect(barElement.css('width')).toBe('11%');
181-
expect(barElement.hasClass('bar-info')).toBe(false);
181+
expect(barElement.hasClass('progress-bar-info')).toBe(false);
182182

183183
barElement = element.children().eq(2);
184184
expect(barElement.css('width')).toBe('9%');
185-
expect(barElement.hasClass('bar-danger')).toBe(true);
185+
expect(barElement.hasClass('progress-bar-danger')).toBe(true);
186186

187187
barElement = element.children().eq(3);
188188
expect(barElement.css('width')).toBe('22%');
189-
expect(barElement.hasClass('bar-warning')).toBe(true);
189+
expect(barElement.hasClass('progress-bar-warning')).toBe(true);
190190

191191
barElement = element.children().eq(4);
192192
expect(barElement.css('width')).toBe('5%');
193-
expect(barElement.hasClass('bar-warning')).toBe(false);
193+
expect(barElement.hasClass('progress-bar-warning')).toBe(false);
194194
});
195195

196196
});
@@ -256,10 +256,10 @@ describe('stacked progressbar directive with auto-types', function () {
256256
expect(element.hasClass('progress')).toBe(true);
257257
});
258258

259-
it('contains tree child elements with "bar" css class each', function() {
259+
it('contains tree child elements with "progress-bar" css class each', function() {
260260
expect(element.children().length).toBe(5);
261261
for (var i = 0; i < 5; i++) {
262-
expect(element.children().eq(i).hasClass('bar')).toBe(true);
262+
expect(element.children().eq(i).hasClass('progress-bar')).toBe(true);
263263
}
264264
});
265265

@@ -275,7 +275,7 @@ describe('stacked progressbar directive with auto-types', function () {
275275
var stackedTypes = config.stackedTypes;
276276

277277
for (var i = 0; i < stackedTypes.length; i++) {
278-
expect(element.children().eq(i).hasClass('bar-' + stackedTypes[i])).toBe(true);
278+
expect(element.children().eq(i).hasClass('progress-bar-' + stackedTypes[i])).toBe(true);
279279
}
280280
});
281281

@@ -290,8 +290,8 @@ describe('stacked progressbar directive with auto-types', function () {
290290

291291
var bar = element.children().eq(1);
292292
expect(bar.css('width')).toBe('18%');
293-
expect(bar.hasClass('bar-' + stackedTypes[1])).toBe(false);
294-
expect(bar.hasClass('bar-something')).toBe(true);
293+
expect(bar.hasClass('progress-bar-' + stackedTypes[1])).toBe(false);
294+
expect(bar.hasClass('progress-bar-something')).toBe(true);
295295
});
296296

297297

@@ -306,8 +306,8 @@ describe('stacked progressbar directive with auto-types', function () {
306306

307307
var bar = element.children().eq(1);
308308
expect(bar.css('width')).toBe('18%');
309-
expect(bar.hasClass('bar-' + stackedTypes[1])).toBe(false);
310-
expect(bar.hasClass('bar-something')).toBe(true);
309+
expect(bar.hasClass('progress-bar-' + stackedTypes[1])).toBe(false);
310+
expect(bar.hasClass('progress-bar-something')).toBe(true);
311311
});
312312

313313
it('can bypass default configuration for stacked classes from attribute', function() {
@@ -316,11 +316,11 @@ describe('stacked progressbar directive with auto-types', function () {
316316

317317
var stackedTypes = config.stackedTypes;
318318

319-
expect(element.children().eq(0).hasClass('bar-danger')).toBe(true);
320-
expect(element.children().eq(0).hasClass('bar-' + stackedTypes[0])).toBe(false);
319+
expect(element.children().eq(0).hasClass('progress-bar-danger')).toBe(true);
320+
expect(element.children().eq(0).hasClass('progress-bar-' + stackedTypes[0])).toBe(false);
321321

322-
expect(element.children().eq(1).hasClass('bar-warning')).toBe(true);
323-
expect(element.children().eq(2).hasClass('bar-success')).toBe(true);
322+
expect(element.children().eq(1).hasClass('progress-bar-warning')).toBe(true);
323+
expect(element.children().eq(2).hasClass('progress-bar-success')).toBe(true);
324324
});
325325

326326
});

template/progressbar/bar.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<div class="bar" ng-class='type && "bar-" + type'></div>
1+
<div class="progress-bar" ng-class='type && "progress-bar-" + type'></div>

0 commit comments

Comments
 (0)