From 24d30cc9dff752a43fecc01b33dce782d7e80a53 Mon Sep 17 00:00:00 2001 From: conzett Date: Tue, 22 Nov 2011 20:47:18 -0500 Subject: [PATCH] Add tests to check if tabpanel elements are hidden after click --- javascripts/tests/tests.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/javascripts/tests/tests.js b/javascripts/tests/tests.js index 1ef9dbf..7565c3f 100644 --- a/javascripts/tests/tests.js +++ b/javascripts/tests/tests.js @@ -196,7 +196,7 @@ $(document).ready(function () { if(index != 1){ equals($(this).attr('aria-selected'), 'false', - 'Expect tab at position ' + index + ' to have aria-selected set to false after clicking tab at position 1'); + 'Expect tab at position ' + index + ' to have aria-selected set to false after clicking tab at position 1'); }else{ equals($(this).attr('aria-selected'), 'true', @@ -208,11 +208,18 @@ $(document).ready(function () { if(index != 1){ equals($(this).attr('aria-hidden'), 'true', - 'Expect tabpanel at position ' + index + ' to have aria-hidden set to true after clicking tab at position 1'); + 'Expect tabpanel at position ' + index + ' to have aria-hidden set to true after clicking tab at position 1'); + + ok($(this).is(':hidden'), + 'Expect tabpanel at position ' + index + ' to be hidden'); + }else{ equals($(this).attr('aria-hidden'), 'false', - 'Expect tabpanel at position ' + index + ' to have aria-hidden set to true since we clicked its tab'); + 'Expect tabpanel at position ' + index + ' to have aria-hidden set to true since we clicked its tab'); + + ok($(this).not(':hidden'), + 'Expect tabpanel at position ' + index + ' to not be hidden'); } });