Skip to content

Commit 7071a3a

Browse files
committed
Fix bug with border where it wasn't testing all directions.
1 parent f6ef2df commit 7071a3a

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

jquery.expect.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -561,21 +561,21 @@
561561
case 'border-left':
562562
case 'border-bottom':
563563
got = borderQuad(obj, prop, val);
564-
passing = got.passing
564+
passing = got.passing;
565565
got = got.got;
566566
break;
567567

568568
case 'border':
569-
var passing = true
570-
, got = $.map(['top', 'right', 'left', 'bottom'], function (style, i) {
571-
var ret = borderQuad(obj, prop + '-top', val);
572-
if (!ret.passing) passing = false;
573-
return ret.got;
574-
});
569+
passing = true;
570+
got = $.map(['top', 'right', 'left', 'bottom'], function (dir) {
571+
var ret = borderQuad(obj, prop + '-' + dir, val);
572+
if (!ret.passing) passing = false;
573+
return ret.got;
574+
});
575575

576576
// Array unique.
577577
got = $.map(got, function (g, i) {
578-
return $.inArray(g, got) == i ? g : null;
578+
return $.inArray(g, got) === i ? g : null;
579579
}).join(' ');
580580

581581
break;
@@ -591,7 +591,7 @@
591591
}
592592

593593
this.obj.each(function (_, el) {
594-
check($(el))
594+
check($(el));
595595
});
596596

597597
return this;

test/test.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,6 @@ describe('$expect', function () {
276276
}, 'expected .half-pad to have its border-top style equal to dashed but got 2px dashed #FF0000');
277277

278278
$expect('.half-pad').to.have.css('border-top', '2px dashed red')
279-
$expect('.half-pad').to.have.css('border', '2px dashed red')
280279
$expect('.padder').to.have.css('border', '1px solid red')
281280

282281
err(function () {

0 commit comments

Comments
 (0)