@@ -48,4 +48,91 @@ describe('options/vendor-prefix-align', function() {
4848
4949 assert . equal ( comb . processString ( input ) , expected ) ;
5050 } ) ;
51+
52+ // Helper to check the detection
53+ function should_detect ( options , a , b ) {
54+ comb . detect ( options ) ;
55+ assert . equal (
56+ JSON . stringify ( comb . processString ( a ) ) ,
57+ JSON . stringify ( b )
58+ ) ;
59+ }
60+
61+ it ( 'Shouldn not detect anything if there are no prefixed groups' , function ( ) {
62+ should_detect (
63+ [ 'vendor-prefix-align' ] ,
64+ 'a{ color: red }a{ -webkit-transform: translateZ(0) }' ,
65+ { }
66+ ) ;
67+ } ) ;
68+
69+ it ( 'Shouldn detect vendor-prefix-align as false in properties' , function ( ) {
70+ should_detect (
71+ [ 'vendor-prefix-align' ] ,
72+ fs . readFileSync ( './test/vendor-prefix-align/property-align.css' , 'utf8' ) ,
73+ {
74+ 'vendor-prefix-align' : false
75+ }
76+ ) ;
77+ } ) ;
78+
79+ it ( 'Shouldn detect vendor-prefix-align as true in properties' , function ( ) {
80+ should_detect (
81+ [ 'vendor-prefix-align' ] ,
82+ fs . readFileSync ( './test/vendor-prefix-align/property-align.expected.css' , 'utf8' ) ,
83+ {
84+ 'vendor-prefix-align' : true
85+ }
86+ ) ;
87+ } ) ;
88+
89+ it ( 'Shouldn detect vendor-prefix-align as false in values' , function ( ) {
90+ should_detect (
91+ [ 'vendor-prefix-align' ] ,
92+ fs . readFileSync ( './test/vendor-prefix-align/value-align.css' , 'utf8' ) ,
93+ {
94+ 'vendor-prefix-align' : false
95+ }
96+ ) ;
97+ } ) ;
98+
99+ it ( 'Shouldn detect vendor-prefix-align as true in values' , function ( ) {
100+ should_detect (
101+ [ 'vendor-prefix-align' ] ,
102+ fs . readFileSync ( './test/vendor-prefix-align/value-align.expected.css' , 'utf8' ) ,
103+ {
104+ 'vendor-prefix-align' : true
105+ }
106+ ) ;
107+ } ) ;
108+
109+ it ( 'Shouldn detect vendor-prefix-align as true, test 1' , function ( ) {
110+ should_detect (
111+ [ 'vendor-prefix-align' ] ,
112+ fs . readFileSync ( './test/vendor-prefix-align/already-aligned.css' , 'utf8' ) ,
113+ {
114+ 'vendor-prefix-align' : true
115+ }
116+ ) ;
117+ } ) ;
118+
119+ it ( 'Shouldn detect vendor-prefix-align as true, test 2' , function ( ) {
120+ should_detect (
121+ [ 'vendor-prefix-align' ] ,
122+ fs . readFileSync ( './test/vendor-prefix-align/complex.expected.css' , 'utf8' ) ,
123+ {
124+ 'vendor-prefix-align' : true
125+ }
126+ ) ;
127+ } ) ;
128+
129+ it ( 'Shouldn detect vendor-prefix-align as false' , function ( ) {
130+ should_detect (
131+ [ 'vendor-prefix-align' ] ,
132+ fs . readFileSync ( './test/vendor-prefix-align/complex.css' , 'utf8' ) ,
133+ {
134+ 'vendor-prefix-align' : false
135+ }
136+ ) ;
137+ } ) ;
51138} ) ;
0 commit comments