Skip to content

Instantly share code, notes, and snippets.

@toddpi314
Created June 8, 2012 15:31
Show Gist options
  • Save toddpi314/2896175 to your computer and use it in GitHub Desktop.
Save toddpi314/2896175 to your computer and use it in GitHub Desktop.
Rich_Domain_Components_LoadTest
test("Component Load Tests", function() {
var componentTestCount = 10;
var components = []
for (var i = 0; i <= componentTestCount - 1; i++) {
components.push(new DeepElement.ThreeOneFour.Component());
}
var comonentLoader = new DeepElement.ThreeOneFour.Helpers.ComponentLoader(
components);
comonentLoader.load(function() {
var loadedComponents = 0;
for (var i = 0; i <= components.length - 1; i++) {
var component = components[i];
if (component.getLoaded()) loadedComponents++;
}
ok(loadedComponents == componentTestCount, "Problem loading the " + componentTestCount + " test components");
}, function() {
ok(false, "Problem loading the " + componentTestCount + " test components");
});
});​
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment