|
39 | 39 | Assert.areEqual("Broken box model: using width with padding.", result.messages[0].message); |
40 | 40 | }, |
41 | 41 |
|
| 42 | + "Using width when padding is zero should not result in a warning": function(){ |
| 43 | + var result = CSSLint.verify(".foo { width: 100px; padding: 0; }", { "box-model": 1 }); |
| 44 | + Assert.areEqual(0, result.messages.length); |
| 45 | + }, |
| 46 | + |
42 | 47 | "Using width and padding-left should result in a warning": function(){ |
43 | 48 | var result = CSSLint.verify(".foo { width: 100px; padding-left: 10px; }", { "box-model": 1 }); |
44 | 49 | Assert.areEqual(1, result.messages.length); |
45 | 50 | Assert.areEqual("warning", result.messages[0].type); |
46 | 51 | Assert.areEqual("Broken box model: using width with padding-left.", result.messages[0].message); |
47 | 52 | }, |
48 | 53 |
|
| 54 | + "Using width when padding-left is zero should not result in a warning": function(){ |
| 55 | + var result = CSSLint.verify(".foo { width: 100px; padding-left: 0; }", { "box-model": 1 }); |
| 56 | + Assert.areEqual(0, result.messages.length); |
| 57 | + }, |
| 58 | + |
49 | 59 | "Using width and padding-right should result in a warning": function(){ |
50 | 60 | var result = CSSLint.verify(".foo { width: 100px; padding-right: 10px; }", { "box-model": 1 }); |
51 | 61 | Assert.areEqual(1, result.messages.length); |
52 | 62 | Assert.areEqual("warning", result.messages[0].type); |
53 | 63 | Assert.areEqual("Broken box model: using width with padding-right.", result.messages[0].message); |
54 | 64 | }, |
| 65 | + |
| 66 | + "Using width when padding-right is zero should not result in a warning": function(){ |
| 67 | + var result = CSSLint.verify(".foo { width: 100px; padding-right: 0; }", { "box-model": 1 }); |
| 68 | + Assert.areEqual(0, result.messages.length); |
| 69 | + }, |
55 | 70 |
|
56 | | - "Using width and padding-top should result in a warning": function(){ |
| 71 | + "Using width and padding-top should not result in a warning": function(){ |
57 | 72 | var result = CSSLint.verify(".foo { width: 100px; padding-top: 10px; }", { "box-model": 1 }); |
58 | | - Assert.areEqual(1, result.messages.length); |
59 | | - Assert.areEqual("warning", result.messages[0].type); |
60 | | - Assert.areEqual("Broken box model: using width with padding-top.", result.messages[0].message); |
| 73 | + Assert.areEqual(0, result.messages.length); |
61 | 74 | }, |
62 | 75 |
|
63 | | - "Using width and padding-bottom should result in a warning": function(){ |
| 76 | + "Using width and padding-bottom should not result in a warning": function(){ |
64 | 77 | var result = CSSLint.verify(".foo { width: 100px; padding-bottom: 10px; }", { "box-model": 1 }); |
65 | | - Assert.areEqual(1, result.messages.length); |
66 | | - Assert.areEqual("warning", result.messages[0].type); |
67 | | - Assert.areEqual("Broken box model: using width with padding-bottom.", result.messages[0].message); |
| 78 | + Assert.areEqual(0, result.messages.length); |
68 | 79 | }, |
69 | 80 |
|
70 | 81 | "Using width and border should result in a warning": function(){ |
|
81 | 92 | Assert.areEqual("Broken box model: using width with border-left.", result.messages[0].message); |
82 | 93 | }, |
83 | 94 |
|
| 95 | + "Using width when border-left is zero should not result in a warning": function(){ |
| 96 | + var result = CSSLint.verify(".foo { width: 100px; border-left: 0; }", { "box-model": 1 }); |
| 97 | + Assert.areEqual(0, result.messages.length); |
| 98 | + }, |
| 99 | + |
84 | 100 | "Using width and border-right should result in a warning": function(){ |
85 | 101 | var result = CSSLint.verify(".foo { width: 100px; border-right: 10px; }", { "box-model": 1 }); |
86 | 102 | Assert.areEqual(1, result.messages.length); |
87 | 103 | Assert.areEqual("warning", result.messages[0].type); |
88 | 104 | Assert.areEqual("Broken box model: using width with border-right.", result.messages[0].message); |
89 | 105 | }, |
90 | 106 |
|
91 | | - "Using width and border-top should result in a warning": function(){ |
| 107 | + "Using width when border-right is zero should not result in a warning": function(){ |
| 108 | + var result = CSSLint.verify(".foo { width: 100px; border-right: 0; }", { "box-model": 1 }); |
| 109 | + Assert.areEqual(0, result.messages.length); |
| 110 | + }, |
| 111 | + |
| 112 | + "Using width and border-top should not result in a warning": function(){ |
92 | 113 | var result = CSSLint.verify(".foo { width: 100px; border-top: 10px; }", { "box-model": 1 }); |
93 | | - Assert.areEqual(1, result.messages.length); |
94 | | - Assert.areEqual("warning", result.messages[0].type); |
95 | | - Assert.areEqual("Broken box model: using width with border-top.", result.messages[0].message); |
| 114 | + Assert.areEqual(0, result.messages.length); |
96 | 115 | }, |
97 | 116 |
|
98 | | - "Using width and border-bottom should result in a warning": function(){ |
| 117 | + "Using width and border-bottom should not result in a warning": function(){ |
99 | 118 | var result = CSSLint.verify(".foo { width: 100px; border-bottom: 10px; }", { "box-model": 1 }); |
100 | | - Assert.areEqual(1, result.messages.length); |
101 | | - Assert.areEqual("warning", result.messages[0].type); |
102 | | - Assert.areEqual("Broken box model: using width with border-bottom.", result.messages[0].message); |
| 119 | + Assert.areEqual(0, result.messages.length); |
103 | 120 | }, |
104 | 121 |
|
105 | 122 | "Using height and padding should result in a warning": function(){ |
|
109 | 126 | Assert.areEqual("Broken box model: using height with padding.", result.messages[0].message); |
110 | 127 | }, |
111 | 128 |
|
112 | | - "Using height and padding-left should result in a warning": function(){ |
| 129 | + "Using height when padding is zero should not result in a warning": function(){ |
| 130 | + var result = CSSLint.verify(".foo { height: 100px; padding: 0; }", { "box-model": 1 }); |
| 131 | + Assert.areEqual(0, result.messages.length); |
| 132 | + }, |
| 133 | + |
| 134 | + "Using height and padding-left should not result in a warning": function(){ |
113 | 135 | var result = CSSLint.verify(".foo { height: 100px; padding-left: 10px; }", { "box-model": 1 }); |
114 | | - Assert.areEqual(1, result.messages.length); |
115 | | - Assert.areEqual("warning", result.messages[0].type); |
116 | | - Assert.areEqual("Broken box model: using height with padding-left.", result.messages[0].message); |
| 136 | + Assert.areEqual(0, result.messages.length); |
117 | 137 | }, |
118 | 138 |
|
119 | | - "Using height and padding-right should result in a warning": function(){ |
| 139 | + "Using height and padding-right should not result in a warning": function(){ |
120 | 140 | var result = CSSLint.verify(".foo { height: 100px; padding-right: 10px; }", { "box-model": 1 }); |
121 | | - Assert.areEqual(1, result.messages.length); |
122 | | - Assert.areEqual("warning", result.messages[0].type); |
123 | | - Assert.areEqual("Broken box model: using height with padding-right.", result.messages[0].message); |
| 141 | + Assert.areEqual(0, result.messages.length); |
124 | 142 | }, |
125 | 143 |
|
126 | 144 | "Using height and padding-top should result in a warning": function(){ |
|
130 | 148 | Assert.areEqual("Broken box model: using height with padding-top.", result.messages[0].message); |
131 | 149 | }, |
132 | 150 |
|
| 151 | + "Using height when padding-top is zero should not result in a warning": function(){ |
| 152 | + var result = CSSLint.verify(".foo { height: 100px; padding-top: 0; }", { "box-model": 1 }); |
| 153 | + Assert.areEqual(0, result.messages.length); |
| 154 | + }, |
| 155 | + |
133 | 156 | "Using height and padding-bottom should result in a warning": function(){ |
134 | 157 | var result = CSSLint.verify(".foo { height: 100px; padding-bottom: 10px; }", { "box-model": 1 }); |
135 | 158 | Assert.areEqual(1, result.messages.length); |
136 | 159 | Assert.areEqual("warning", result.messages[0].type); |
137 | 160 | Assert.areEqual("Broken box model: using height with padding-bottom.", result.messages[0].message); |
138 | 161 | }, |
139 | 162 |
|
| 163 | + "Using height when padding-bottom is zero should not result in a warning": function(){ |
| 164 | + var result = CSSLint.verify(".foo { height: 100px; padding-bottom: 0; }", { "box-model": 1 }); |
| 165 | + Assert.areEqual(0, result.messages.length); |
| 166 | + }, |
| 167 | + |
140 | 168 | "Using height and border should result in a warning": function(){ |
141 | 169 | var result = CSSLint.verify(".foo { height: 100px; border: 10px; }", { "box-model": 1 }); |
142 | 170 | Assert.areEqual(1, result.messages.length); |
143 | 171 | Assert.areEqual("warning", result.messages[0].type); |
144 | 172 | Assert.areEqual("Broken box model: using height with border.", result.messages[0].message); |
145 | 173 | }, |
146 | 174 |
|
147 | | - "Using height and border-left should result in a warning": function(){ |
| 175 | + "Using height and border-left should not result in a warning": function(){ |
148 | 176 | var result = CSSLint.verify(".foo { height: 100px; border-left: 10px; }", { "box-model": 1 }); |
149 | | - Assert.areEqual(1, result.messages.length); |
150 | | - Assert.areEqual("warning", result.messages[0].type); |
151 | | - Assert.areEqual("Broken box model: using height with border-left.", result.messages[0].message); |
| 177 | + Assert.areEqual(0, result.messages.length); |
152 | 178 | }, |
153 | 179 |
|
154 | | - "Using height and border-right should result in a warning": function(){ |
| 180 | + "Using height and border-right should not result in a warning": function(){ |
155 | 181 | var result = CSSLint.verify(".foo { height: 100px; border-right: 10px; }", { "box-model": 1 }); |
156 | | - Assert.areEqual(1, result.messages.length); |
157 | | - Assert.areEqual("warning", result.messages[0].type); |
158 | | - Assert.areEqual("Broken box model: using height with border-right.", result.messages[0].message); |
| 182 | + Assert.areEqual(0, result.messages.length); |
159 | 183 | }, |
160 | 184 |
|
161 | 185 | "Using height and border-top should result in a warning": function(){ |
|
165 | 189 | Assert.areEqual("Broken box model: using height with border-top.", result.messages[0].message); |
166 | 190 | }, |
167 | 191 |
|
| 192 | + "Using height when border-top is zero should not result in a warning": function(){ |
| 193 | + var result = CSSLint.verify(".foo { height: 100px; border-top: 0; }", { "box-model": 1 }); |
| 194 | + Assert.areEqual(0, result.messages.length); |
| 195 | + }, |
| 196 | + |
168 | 197 | "Using height and border-bottom should result in a warning": function(){ |
169 | 198 | var result = CSSLint.verify(".foo { height: 100px; border-bottom: 10px; }", { "box-model": 1 }); |
170 | 199 | Assert.areEqual(1, result.messages.length); |
171 | 200 | Assert.areEqual("warning", result.messages[0].type); |
172 | 201 | Assert.areEqual("Broken box model: using height with border-bottom.", result.messages[0].message); |
| 202 | + }, |
| 203 | + |
| 204 | + "Using height when border-bottom is zero should not result in a warning": function(){ |
| 205 | + var result = CSSLint.verify(".foo { height: 100px; border-bottom: 0; }", { "box-model": 1 }); |
| 206 | + Assert.areEqual(0, result.messages.length); |
173 | 207 | } |
174 | 208 |
|
175 | 209 | })); |
|
0 commit comments