Skip to content

A Application-ready mechanism #13

@ElectricMaxxx

Description

@ElectricMaxxx

In my work with the DOM Testing a get an other issue with testing applications in this testing framework:

if I init my application for example by this:

  setup(function(){
   var Option = {container:"Filebrowser"}; 
   FB.init(Option);
  });

(it a mocha notification for tdd)
Igot the problem, that the application isnt ready. This means all HTML stuff that will be loaded by the application isnt available, allthoug i started testing after loading the complete HTML stuff. This isnt the a problem of document.readyState. This is a problem of the differnt loading-times of the application itself.

I solved this by using a ready event inside of the application and it works:

    test("Default Container with id=FB created",function(){
      FB.ready(function(){
        assert.that("",has.tag("Filebrowser"));
      });
    });

But is that a good way of testing? Could we get these things into the testing framework, maybe by settings?

Otherwise i can set some timeout with mocha, but this isn`t a good way to, I think.
Nobody could tell me, when the application is completly ready with thier dom building stuff.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions