]> source.dussan.org Git - jquery-ui.git/commitdiff
Dialog: Added tests for isOpen method.
authorScott González <scott.gonzalez@gmail.com>
Fri, 15 Aug 2008 15:07:09 +0000 (15:07 +0000)
committerScott González <scott.gonzalez@gmail.com>
Fri, 15 Aug 2008 15:07:09 +0000 (15:07 +0000)
tests/dialog.js

index 5cd1f1250913b2b5abd4d5c428fe825fafb91e92..89560f7791309d4df7680ae5382b8d4ad38258cb 100644 (file)
@@ -23,7 +23,7 @@ var defaults = {
        position: 'center',\r
        resizable: true,\r
        stack: true,\r
-       title: null,\r
+       title: '',\r
        width: 300\r
 };\r
 \r
@@ -396,6 +396,21 @@ test("width", function() {
 \r
 module("dialog: Methods");\r
 \r
+test("isOpen", function() {\r
+       expect(4);\r
+       el = $('<div/>').dialog();\r
+       equals(el.dialog('isOpen'), true, "dialog is open after init");\r
+       el.dialog('close');\r
+       equals(el.dialog('isOpen'), false, "dialog is closed");\r
+       el.remove();\r
+       \r
+       el = $('<div/>').dialog({autoOpen: false});\r
+       equals(el.dialog('isOpen'), false, "dialog is closed after init");\r
+       el.dialog('open');\r
+       equals(el.dialog('isOpen'), true, "dialog is open");\r
+       el.remove();\r
+});\r
+\r
 module("dialog: Callbacks");\r
 \r
 test("open", function() {\r