Fix for bug #493 including unit tests to prove.

Run npm install and visit test/jquery.gridster-amd.html in browser.
This commit is contained in:
Glen Pike
2015-03-03 00:46:11 +00:00
parent 314037471f
commit c0a2bde09c
13 changed files with 166 additions and 27 deletions

28
test/testsuite.js Normal file
View File

@ -0,0 +1,28 @@
/* global require */
"use strict";
define([
'QUnit',
'jquery',
'gridster'
], function(QUnit, $, gridster) {
QUnit.module("Gridster AMD", {
setup: function () {
},
teardown: function () {
}
});
QUnit.test('window.$ should be undefined.', function() {
equal(typeof window.$, 'undefined', 'window.$ should be undefined');
equal(typeof window.jQuery, 'undefined', 'window.jQuery should be undefined');
});
QUnit.test('gridster should be initialized.', function() {
$('.wrapper ul').gridster();
equal($(".wrapper").hasClass('ready'), true, 'Gridster should initialized wrapper.');
equal($(".wrapper ul li").length, $(".gs-w").length, 'grid elements get a .gs-w class');
});
}
);