| */
public class ValidateRuntimeConditionalNodeTest extends BaseGssTest {
public void testValidRuntimeConditional() {
// given
CssTree cssTree = parseAndBuildTree(lines(
"@if (eval('com.foo.BAR')) {",
" .foo {",
" padding: 5px;",
" }",
" @if (is('ie9')) {",
" .foo {",
" padding: 55px;",
" }",
" }",
"}",
"@elseif (eval('com.foo.bar()')) {",
" @if (eval('com.foo.FOO')) {",
" .foo {",
" padding: 15px;",
" }",
" }",
" @else{",
" .foo {",
" padding: 15px;",
" }",
" }",
"}",
"@if (is('ie6')) {",
" .foo {",
" padding: 25px;",
" }",
"}",
"@elseif (eval('com.foo.BAR')) {",
" .foo {",
" padding: 35px;",
" }",
"}"));
ErrorManager errorManager = mock(ErrorManager.class);
boolean lenient = false;
ValidateRuntimeConditionalNode visitor = new ValidateRuntimeConditionalNode(
cssTree.getMutatingVisitController(), errorManager, lenient);
// when
visitor.runPass();
// then
|