diff --git a/tests/global.tests.js b/tests/global.tests.js index ae97e67..1b631bc 100644 --- a/tests/global.tests.js +++ b/tests/global.tests.js @@ -19,58 +19,69 @@ $(document).ready(function () { map_copy = $('#usa_image').clone(); }); -var group_setup = function () { - 'use strict'; +var group_reset = function () { + 'use strict'; + + // start with a clean mapster slate + $('img').mapster('unbind'); + + // always start with a clean map for each group + $('#usa_image').replaceWith(map_copy.clone()); + }, + group_teardown = function () { + 'use strict'; - // start with a clean mapster slate - $('img').mapster('unbind'); + group_reset(); + }, + group_setup = function () { + 'use strict'; - // always start with a clean map for each group - $('#usa_image').replaceWith(map_copy.clone()); + group_reset(); - image = $('#usa_image'); - areas = $('#usa_image_map'); + image = $('#usa_image'); + areas = $('#usa_image_map'); - map_options = { - isSelectable: true, - singleSelect: false, - mapKey: 'state', - mapValue: 'full', - listKey: 'name', - listSelectedAttribute: 'checked', - sortList: 'asc', - showToolTip: true, - toolTipClose: ['area-mouseout'], - areas: [ - { - key: 'TX', - selected: true - }, - { - key: 'AK', - isSelectable: false, - selected: true - }, - { - key: 'WA', - staticState: true - }, - { - key: 'OR', - staticState: false - }, - { - key: 'CA', - toolTip: $( - '
Don\'t mess with Louisiana. Why ? Click here for more info.
' - ) - } - ] + map_options = { + isSelectable: true, + singleSelect: false, + mapKey: 'state', + mapValue: 'full', + listKey: 'name', + listSelectedAttribute: 'checked', + sortList: 'asc', + showToolTip: true, + toolTipClose: ['area-mouseout'], + areas: [ + { + key: 'TX', + selected: true + }, + { + key: 'AK', + isSelectable: false, + selected: true + }, + { + key: 'WA', + staticState: true + }, + { + key: 'OR', + staticState: false + }, + { + key: 'CA', + toolTip: $( + '
Don\'t mess with Louisiana. Why ? Click here for more info.
' + ) + } + ] + }; }; -}; // create a default setup iqtest.configure({ - setup: group_setup + setup: group_setup, + teardown: group_teardown });