diff --git a/js/Storyline.js b/js/Storyline.js index 3bc3252..5fb4563 100644 --- a/js/Storyline.js +++ b/js/Storyline.js @@ -111,6 +111,14 @@ var CategoryGroupings = {}; $('.category-group-holder input[type=checkbox], .category-group-holder label') .unbind('click') .click(CategoryGroupings.highlight_child_levels); + + $('.delete-category-group-holder') + .unbind('click') + .click(function() { + if (confirm('Are you sure?')) { + $(this).parents('.category-group-holder').remove(); + } + }); }(jQuery)) } diff --git a/test/selenium/TestCategoryGroupings.html b/test/selenium/TestCategoryGroupings.html new file mode 100644 index 0000000..ffb2ad7 --- /dev/null +++ b/test/selenium/TestCategoryGroupings.html @@ -0,0 +1,87 @@ + + + +
+ + +TestCategoryGroupings | ||
open | +/wp-admin | ++ |
clickAndWait | +link=ComicPress | ++ |
click | +comicpress-tab-Category_Groups | ++ |
storeXpathCount | +//div[@id="category-groups-holder"]/div | +current_count | +
click | +add-new-category-group | ++ |
storeEval | +storedVars['current_count']++ | ++ |
waitForElementPresent | +//div[@id="category-groups-holder"]/div[${current_count}] | ++ |
storeXpathCount | +//div[@id="category-groups-holder"]/div | +new_count | +
assertEval | +${current_count} | +${new_count} | +
assertValue | +//div[@id="category-groups-holder"]/div[${new_count}]//input[contains(@name, "[name]")] | +group | +
click | +//div[@id="category-groups-holder"]/div[${new_count}]//a[@class="delete-category-group-holder"] | ++ |
assertConfirmation | +Are you sure? | ++ |
storeXpathCount | +//div[@id="category-groups-holder"]/div | +new_count | +
assertEval | +${current_count} - 1 | +${new_count} | +