Skip to content

Commit

Permalink
chore: fix test group does not teardown when complete
Browse files Browse the repository at this point in the history
  • Loading branch information
techfg committed Apr 30, 2024
1 parent a36f3d9 commit b53b04d
Showing 1 changed file with 56 additions and 45 deletions.
101 changes: 56 additions & 45 deletions tests/global.tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: $(
'<div>Don\'t mess with Louisiana. Why ? <a href = "http://dontmesswithtexas.org/" target="_blank" > Click here </a> for more info. </div> '
)
}
]
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: $(
'<div>Don\'t mess with Louisiana. Why ? <a href = "http://dontmesswithtexas.org/" target="_blank" > Click here </a> for more info. </div> '
)
}
]
};
};
};

// create a default setup

iqtest.configure({
setup: group_setup
setup: group_setup,
teardown: group_teardown
});

0 comments on commit b53b04d

Please sign in to comment.