|
| 1 | +(function(){ |
| 2 | + |
| 3 | + /*global YUITest, CSSLint*/ |
| 4 | + var Assert = YUITest.Assert; |
| 5 | + |
| 6 | + YUITest.TestRunner.add(new YUITest.TestCase({ |
| 7 | + |
| 8 | + name: "Alphabetical order Errors", |
| 9 | + |
| 10 | + "Rules with properties not in alphabetical order should result in a warning": function(){ |
| 11 | + var result = CSSLint.verify("li { z-index: 2; color: red; }", { "order-alphabetical": 1 }); |
| 12 | + Assert.areEqual(1, result.messages.length); |
| 13 | + Assert.areEqual("warning", result.messages[0].type); |
| 14 | + Assert.areEqual("Rule doesn't have all its properties in alphabetical ordered.", result.messages[0].message); |
| 15 | + }, |
| 16 | + |
| 17 | + "Rules with prefixed properties not in alphabetical order (without the prefix) should result in a warning": function(){ |
| 18 | + var result = CSSLint.verify("li { -moz-transition: none; -webkit-box-shadow: none; }", { "order-alphabetical": 1 }); |
| 19 | + Assert.areEqual(1, result.messages.length); |
| 20 | + Assert.areEqual("warning", result.messages[0].type); |
| 21 | + Assert.areEqual("Rule doesn't have all its properties in alphabetical ordered.", result.messages[0].message); |
| 22 | + }, |
| 23 | + |
| 24 | + "Rules with properties in alphabetical order should not result in a warning": function(){ |
| 25 | + var result = CSSLint.verify("li { box-shadow: none; color: red; transition: none; }", { "order-alphabetical": 1 }); |
| 26 | + Assert.areEqual(0, result.messages.length); |
| 27 | + }, |
| 28 | + |
| 29 | + "Rules with prefixed properties in alphabetical order should not result in a warning": function(){ |
| 30 | + var result = CSSLint.verify("li { -webkit-box-shadow: none; color: red; -moz-transition: none; }", { "order-alphabetical": 1 }); |
| 31 | + Assert.areEqual(0, result.messages.length); |
| 32 | + } |
| 33 | + |
| 34 | + })); |
| 35 | + |
| 36 | +})(); |
0 commit comments