Tests: Move commonWidgetTests() to TestHelpers.

This commit is contained in:
Scott González 2012-04-19 13:03:21 -04:00
parent 33e93ef7f0
commit e9d5079b04
20 changed files with 113 additions and 130 deletions

View File

@ -350,7 +350,6 @@ grunt.initConfig({
globals: {
addMonths: true,
asyncTest: true,
commonWidgetTests: true,
container: true,
deepEqual: true,
d1: true,

View File

@ -1,4 +1,4 @@
commonWidgetTests( "accordion", {
TestHelpers.commonWidgetTests( "accordion", {
defaults: {
active: 0,
animate: {},

View File

@ -1,4 +1,4 @@
commonWidgetTests( "accordion", {
TestHelpers.commonWidgetTests( "accordion", {
defaults: {
active: 0,
animate: null,

View File

@ -1,4 +1,4 @@
commonWidgetTests( "autocomplete", {
TestHelpers.commonWidgetTests( "autocomplete", {
defaults: {
appendTo: "body",
autoFocus: false,

View File

@ -1,4 +1,4 @@
commonWidgetTests( "button", {
TestHelpers.commonWidgetTests( "button", {
defaults: {
disabled: null,
icons: {

View File

@ -6,4 +6,4 @@ var datepicker_defaults = {
disabled: false
};
//commonWidgetTests('datepicker', { defaults: datepicker_defaults });
//TestHelpers.commonWidgetTests('datepicker', { defaults: datepicker_defaults });

View File

@ -1,4 +1,4 @@
commonWidgetTests( "dialog", {
TestHelpers.commonWidgetTests( "dialog", {
defaults: {
autoOpen: true,
buttons: {},

View File

@ -1,36 +1,32 @@
/*
* draggable_defaults.js
*/
var draggable_defaults = {
addClasses: true,
appendTo: "parent",
axis: false,
cancel: ":input,option",
connectToSortable: false,
containment: false,
cursor: "auto",
cursorAt: false,
delay: 0,
disabled: false,
distance: 1,
grid: false,
handle: false,
helper: "original",
iframeFix: false,
opacity: false,
refreshPositions: false,
revert: false,
revertDuration: 500,
scroll: true,
scrollSensitivity: 20,
scrollSpeed: 20,
scope: "default",
snap: false,
snapMode: "both",
snapTolerance: 20,
stack: false,
zIndex: false
};
commonWidgetTests('draggable', { defaults: draggable_defaults });
TestHelpers.commonWidgetTests( "draggable", {
defaults: {
addClasses: true,
appendTo: "parent",
axis: false,
cancel: ":input,option",
connectToSortable: false,
containment: false,
cursor: "auto",
cursorAt: false,
delay: 0,
disabled: false,
distance: 1,
grid: false,
handle: false,
helper: "original",
iframeFix: false,
opacity: false,
refreshPositions: false,
revert: false,
revertDuration: 500,
scroll: true,
scrollSensitivity: 20,
scrollSpeed: 20,
scope: "default",
snap: false,
snapMode: "both",
snapTolerance: 20,
stack: false,
zIndex: false
}
});

View File

@ -1,4 +1,4 @@
commonWidgetTests( "droppable", {
TestHelpers.commonWidgetTests( "droppable", {
defaults: {
accept: "*",
activeClass: false,

View File

@ -1,4 +1,4 @@
commonWidgetTests( "menu", {
TestHelpers.commonWidgetTests( "menu", {
defaults: {
disabled: false,
menus: "ul",

View File

@ -1,4 +1,4 @@
commonWidgetTests( "progressbar", {
TestHelpers.commonWidgetTests( "progressbar", {
defaults: {
disabled: false,
value: 0,

View File

@ -1,28 +1,24 @@
/*
* resizable_defaults.js
*/
var resizable_defaults = {
alsoResize: false,
animate: false,
animateDuration: 'slow',
animateEasing: 'swing',
aspectRatio: false,
autoHide: false,
cancel: ':input,option',
containment: false,
delay: 0,
disabled: false,
distance: 1,
ghost: false,
grid: false,
handles: 'e,s,se',
helper: false,
maxHeight: null,
maxWidth: null,
minHeight: 10,
minWidth: 10,
zIndex: 1000
};
commonWidgetTests('resizable', { defaults: resizable_defaults });
TestHelpers.commonWidgetTests('resizable', {
defaults: {
alsoResize: false,
animate: false,
animateDuration: 'slow',
animateEasing: 'swing',
aspectRatio: false,
autoHide: false,
cancel: ':input,option',
containment: false,
delay: 0,
disabled: false,
distance: 1,
ghost: false,
grid: false,
handles: 'e,s,se',
helper: false,
maxHeight: null,
maxWidth: null,
minHeight: 10,
minWidth: 10,
zIndex: 1000
}
});

View File

@ -1,16 +1,12 @@
/*
* selectable_defaults.js
*/
var selectable_defaults = {
appendTo: 'body',
autoRefresh: true,
cancel: ':input,option',
delay: 0,
disabled: false,
distance: 0,
filter: '*',
tolerance: 'touch'
};
commonWidgetTests('selectable', { defaults: selectable_defaults });
TestHelpers.commonWidgetTests('selectable', {
defaults: {
appendTo: 'body',
autoRefresh: true,
cancel: ':input,option',
delay: 0,
disabled: false,
distance: 0,
filter: '*',
tolerance: 'touch'
}
});

View File

@ -1,4 +1,4 @@
commonWidgetTests( "slider", {
TestHelpers.commonWidgetTests( "slider", {
defaults: {
animate: false,
cancel: ':input,option',

View File

@ -1,34 +1,30 @@
/*
* sortable_defaults.js
*/
var sortable_defaults = {
appendTo: "parent",
axis: false,
cancel: ":input,option",
connectWith: false,
containment: false,
cursor: 'auto',
cursorAt: false,
delay: 0,
disabled: false,
distance: 1,
dropOnEmpty: true,
forcePlaceholderSize: false,
forceHelperSize: false,
grid: false,
handle: false,
helper: "original",
items: "> *",
opacity: false,
placeholder: false,
revert: false,
scroll: true,
scrollSensitivity: 20,
scrollSpeed: 20,
scope: "default",
tolerance: "intersect",
zIndex: 1000
};
commonWidgetTests('sortable', { defaults: sortable_defaults });
TestHelpers.commonWidgetTests( "sortable", {
defaults: {
appendTo: "parent",
axis: false,
cancel: ":input,option",
connectWith: false,
containment: false,
cursor: "auto",
cursorAt: false,
delay: 0,
disabled: false,
distance: 1,
dropOnEmpty: true,
forcePlaceholderSize: false,
forceHelperSize: false,
grid: false,
handle: false,
helper: "original",
items: "> *",
opacity: false,
placeholder: false,
revert: false,
scroll: true,
scrollSensitivity: 20,
scrollSpeed: 20,
scope: "default",
tolerance: "intersect",
zIndex: 1000
}
});

View File

@ -1,4 +1,4 @@
commonWidgetTests( "spinner", {
TestHelpers.commonWidgetTests( "spinner", {
defaults: {
culture: null,
disabled: false,

View File

@ -1,4 +1,4 @@
commonWidgetTests( "tabs", {
TestHelpers.commonWidgetTests( "tabs", {
defaults: {
active: null,
collapsible: false,

View File

@ -1,4 +1,4 @@
commonWidgetTests( "tabs", {
TestHelpers.commonWidgetTests( "tabs", {
defaults: {
active: null,
ajaxOptions: null,

View File

@ -56,7 +56,7 @@ function testBasicUsage( widget ) {
});
}
window.commonWidgetTests = function( widget, settings ) {
TestHelpers.commonWidgetTests = function( widget, settings ) {
module( widget + ": common widget" );
testWidgetDefaults( widget, settings.defaults );

View File

@ -1,4 +1,4 @@
commonWidgetTests( "tooltip", {
TestHelpers.commonWidgetTests( "tooltip", {
defaults: {
content: function() {},
disabled: false,