kriszyp/xstyle

Can't get any tests to work...many missing files, etc.

ca0v opened this issue · 6 comments

ca0v commented

Using

  • put-selector 0.3.6 (not 0.3.2)
  • dojo 1.11.0-pre
  • dijit 1.11.0-pre

Errors

  • standalone.html: missing font-awesome.css and many errors
  • testPut.html: put.js does not exist
  • tutorial.html: dozens of errors
  • try-it.html: converter.js not found
  • testCore.html: blank form
  • testHtml5Elements.html: looking for expression, base, elemental, utils in xstyle/test/core which I was able to fix only to discover that testHtml5Elements.css imports a non-existent ext.css

The xstyle design is a beautiful thing but critical functionality seems broken and these tests are not helping to dissuade me.

Clearly I need to go through and clean up the testing area. This directory has seen a lot of experimental tests that have not been maintained, and I have been working on (slowly) moving xstyle's testing to use intern. And of course, as you can see there is definitely a lot of experimentation that has happened. Currently the intern tests should be passing, but I haven't maintained the tests outside of the intern tests. Indeed I will work on moving these tests to intern or deleting them. If you need any help with setting up the intern tests, let me know. I have been using intern in sibling package mode, which differs from the typical child package mode.

ca0v commented

Switching to the https://github.com/SitePen/xstyle repository allowed me to study working tests enough to get module() working.

I believe I should start with dgrid to get oriented with intern, but yes, I would like help setting up xstyle tests.

ca0v commented

I've become comfortable with the intern and have written some simple xstyle tests. I would really like a pointer to your intern tests for xstyle. I'm presently trying to understand the implications of this comment:

Note, that simply using the plugin loader will not load xstyle,
and trigger parsing of the stylesheet, so you will not be able to use the extensions,
unless you have specifically included the xstyle module as well.

I was hoping as long as xstyle/main is loaded we could load a stylesheet via the plugin and it would trigger parsing. How is this accomplished? elemental.update() seems to do the trick.

You should be able to use xstyle/main as the css loader plugin, if you want to ensure the parsing and extensions are enabled. So rather than 'xstyle/css!stylesheet.css', use 'xstyle/main!stylesheet.css'.

ca0v commented

Okay, so when loading xstyled css after the document is ready it's necessary use the xstyle/main! plugin? I've found that if xstyle/main is already loaded it doesn't work. Here's code which delays loading the xstyled css and further delays creation of a node to be xstyled:

//require(['xstyle/main']); //  uncomment and the page will not be xstyled
setTimeout(function() {
    require(['xstyle/core/elemental', 'xstyle/main!./css/query-builder.css'], function (elemental) {
        setTimeout(function() {
            var node = put(body, "div.query-builder-widget.landscape-tiny", "form 2");
            elemental.update(node);
        }, 2000);
    });
}, 2000);

I guess elemental.update() is the postCreate() or startup() of xstyle controls.

I am having a difficult time reproducing this exact issue. I am seeing an issue, but it is related to double loading and rendering, which I will fix.

I would describe elemental.update as more analagous to the parser.parse(node) of xstyle, I think.