Webstorm with JsTestDriver gets element.textContent wrong.

Using Windows 7 x64  & Webstorm 8 trial + the TFS plugin and using JsTestDriver for unit tests.

Running server & captureing Chrome in the IDE - one test fails because an element texContent is incorrect.

Running the server and Chrome outside of the IDE the test passes.

In the setup, html is injected,
...
        var req, body, body_content;
        req = new XMLHttpRequest();
        req.open("GET", "http://localhost:9876/test/SomeFile.html", false); // synchronous
        req.send(null);

        // body element with children
        body_content = req.responseText.match(/<body[\s\S]*<\/body>/);
        body = document.documentElement.getElementsByTagName("body")[0];
        // body tag itself is ignored, only its children will be inserted
        body.innerHTML = body_content;

...

In the test.
The html is like "<option value='Test1/ localhost'>Test1/ localhost</option><option value='Test2/ localhost'>Test2/ localhost</option>"

        someScript.SetUpStuff(["Test1/ localhost", "Test2/ localhost"]);
        var selectList = document.getElementById("someElement");
        assertEquals(2, selectList.options.length);
        assertEquals("Test1/ localhost", selectList.options[0].value);
        assertEquals("Test1", selectList.options[0].textContent);
...

So what kind of DOM is Webstorm IDE using that get tesxContent Wrong?

  ...

Please sign in to leave a comment.