@@ -844,6 +844,30 @@ const tests = [
844
844
input : ":global(.a:not(:global .b, :global .c)) {}" ,
845
845
error : / A : g l o b a l i s n o t a l l o w e d i n s i d e o f a : g l o b a l / ,
846
846
} ,
847
+ {
848
+ name : "consider & statements as pure" ,
849
+ input : ".foo { &:hover { a_value: some-value; } }" ,
850
+ options : { mode : "pure" } ,
851
+ expected : ":local(.foo) { &:hover { a_value: some-value; } }" ,
852
+ } ,
853
+ {
854
+ name : "consider selector & statements as pure" ,
855
+ input : ".foo { html &:hover { a_value: some-value; } }" ,
856
+ options : { mode : "pure" } ,
857
+ expected : ":local(.foo) { html &:hover { a_value: some-value; } }" ,
858
+ } ,
859
+ {
860
+ name : "consider selector & statements as pure" ,
861
+ input : ".foo { &:global(.bar) { a_value: some-value; } }" ,
862
+ options : { mode : "pure" } ,
863
+ expected : ":local(.foo) { &.bar { a_value: some-value; } }" ,
864
+ } ,
865
+ {
866
+ name : "throw on nested & selectors without a local selector" ,
867
+ input : ":global(.foo) { &:hover { a_value: some-value; } }" ,
868
+ options : { mode : "pure" } ,
869
+ error : / i s n o t p u r e / ,
870
+ } ,
847
871
/*
848
872
Bug in postcss-selector-parser
849
873
{
0 commit comments