package com.chrisfolger.needsmoredojo.testutil;

import com.intellij.lang.ASTNode;
import com.intellij.lang.javascript.psi.JSElement;
import com.intellij.lang.javascript.psi.JSExpression;
import com.intellij.lang.javascript.psi.JSLiteralExpression;
import com.intellij.lang.javascript.psi.impl.JSElementImpl;
import com.intellij.lang.javascript.psi.impl.JSExpressionImpl;
import com.intellij.psi.PsiElement;

import static org.mockito.Mockito.mock;

public class BasicPsiElements
{
    public static JSLiteralExpression Null()
    {
        return new MockJSLiteralExpression("null");
    }

    public static JSElement elementFromText(final String text)
    {
        return new JSElementImpl(mock(ASTNode.class)) {
            @Override
            public String getText()
            {
                return text;
            }
        };
    }

    public static MockJSElement comma()
    {
        return new MockJSElement(",");
    }

    public static JSExpression expressionFromText(final String text)
    {
        return new JSExpressionImpl(mock(ASTNode.class)) {
            @Override
            public String getText()
            {
                return text;
            }
        };
    }
}

@@ -927,32 +927,124 @@
 nt(%22,%22);%0A    %7D%0A%0A
+    public static MockJSElement space()%0A    %7B%0A        return new MockJSElement(%22 %22);%0A    %7D%0A%0A
     public stati

add space to basic psi elements