Skip to content

Commit b7e7ffb

Browse files
committed
test file for negative text-indent rule
1 parent d28268b commit b7e7ffb

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

tests/rules/text-indent.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
(function(){
2+
3+
/*global YUITest, CSSLint*/
4+
var Assert = YUITest.Assert;
5+
6+
YUITest.TestRunner.add(new YUITest.TestCase({
7+
8+
name: "text-indent Rule Errors",
9+
10+
"-100px text-indent should result in a warning": function(){
11+
var result = CSSLint.verify(".foo{text-indent: -100px;}", {"text-indent": 1 });
12+
Assert.areEqual(1, result.messages.length);
13+
Assert.areEqual("warning", result.messages[0].type);
14+
Assert.areEqual("Negative text-indent doesn't work well with RTL. If you use text-indent for image replacement explicitly set text-direction for that item to ltr.", result.messages[0].message);
15+
},
16+
17+
"-98px text-indent should not result in a warning": function(){
18+
var result = CSSLint.verify(".foo{text-indent: -98px;} ", {"text-indent": 1 });
19+
Assert.areEqual(0, result.messages.length);
20+
},
21+
22+
"5px text-indent should not result in a warning": function(){
23+
var result = CSSLint.verify(".foo{text-indent: 5px;}", {"text-indent": 1 });
24+
Assert.areEqual(0, result.messages.length);
25+
}
26+
}));
27+
28+
})();

0 commit comments

Comments
 (0)