-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Alexej Yaroshevich
committed
Jun 24, 2015
1 parent
8c72753
commit e299015
Showing
1 changed file
with
76 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
describe('compact object', function () { | ||
|
||
describe('for border-radius properties', function () { | ||
|
||
it('should compact them with 1 value', function () { | ||
SC.compact({ | ||
'border-top-left-radius': '9px', | ||
'border-top-right-radius': '9px', | ||
'border-bottom-right-radius': '9px', | ||
'border-bottom-left-radius': '9px', | ||
}).should.eql({ | ||
'border-radius': '9px', | ||
}); | ||
}); | ||
|
||
it('should compact them partially', function () { | ||
SC.compact({ | ||
'border-top-left-radius': '9px', | ||
'border-bottom-left-radius': '9px', | ||
}).should.eql({ | ||
'border-radius': '9px none none 9px', | ||
}); | ||
}); | ||
|
||
it('should compact them with 2 different values', function () { | ||
SC.compact({ | ||
'border-top-left-radius': '9px', | ||
'border-top-right-radius': '12px', | ||
'border-bottom-right-radius': '9px', | ||
'border-bottom-left-radius': '12px', | ||
}).should.eql({ | ||
'border-radius': '9px 12px', | ||
}); | ||
}); | ||
|
||
it('should compact them with 3 different values', function () { | ||
SC.compact({ | ||
'border-top-right-radius': '5px', | ||
'border-bottom-right-radius': '10px', | ||
'border-bottom-left-radius': '5px', | ||
}).should.eql({ | ||
'border-radius': 'none 5px 10px', | ||
}); | ||
}); | ||
|
||
}); | ||
|
||
describe('simplification of the same value', function () { | ||
|
||
it('should simplify border-width value', function () { | ||
SC.compact({ | ||
'border-width': '2px 2px 2px', | ||
}).should.eql({ | ||
'border-width': '2px', | ||
}); | ||
}); | ||
|
||
it('should simplify more complex border-width to 2 values', function () { | ||
SC.compact({ | ||
'border-width': '0px 5px 0px 5px', | ||
}).should.eql({ | ||
'border-width': '0px 5px', | ||
}); | ||
}); | ||
|
||
it('should strip the last border-radius value to 3 values', function () { | ||
SC.compact({ | ||
'border-radius': '0px 5px 10px 5px', | ||
}).should.eql({ | ||
'border-radius': '0px 5px 10px', | ||
}); | ||
}); | ||
|
||
}); | ||
|
||
}); |
e299015
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍