Wait for page load during test

This commit is contained in:
krzystof 2015-10-30 12:58:31 +00:00
parent b76a53a1af
commit 058cd82df0

View File

@ -44,15 +44,16 @@ var packageName; // there seems to be no official way of finding out the name o
var plugins = ['affix', 'alert', 'button', 'carousel', 'collapse', 'dropdown', 'modal', 'popover', 'scrollspy', 'tab', 'tooltip'];
// test plugins
plugins.forEach(function (plugin) {
document.addEventListener('DOMContentLoaded', function() {
// test plugins
plugins.forEach(function (plugin) {
Tinytest.add('Plugin - ' + plugin, function (test) {
test.instanceOf($(document.body)[plugin], Function, 'instantiated correctly');
});
});
});
// visual check
plugins.forEach(function (plugin) {
// visual check
plugins.forEach(function (plugin) {
Tinytest.addAsync('Visual check - ' + plugin, function (test, done) {
var bootstrapDropZone = document.createElement('div');
@ -73,10 +74,10 @@ plugins.forEach(function (plugin) {
});
});
});
Tinytest.addAsync('Visual check - Material Design', function (test, done) {
Tinytest.addAsync('Visual check - Material Design', function (test, done) {
var bootstrapDropZone = document.createElement('div');
document.body.appendChild(bootstrapDropZone);
@ -100,4 +101,6 @@ Tinytest.addAsync('Visual check - Material Design', function (test, done) {
done();
});
});
});