@@ -85,25 +85,42 @@ QUnit.test( "ARIA", function( assert ) {
85
85
} ) ;
86
86
87
87
QUnit . test ( "aria-modal" , function ( assert ) {
88
- assert . expect ( 3 ) ;
88
+ assert . expect ( 12 ) ;
89
89
90
- var element = $ ( "<div>" ) . dialog ( "options" , " modal" , true ) ,
90
+ var element = $ ( "<div>" ) . dialog ( { modal : true } ) ,
91
91
wrapper = element . dialog ( "widget" ) ;
92
- assert . equal ( wrapper . attr ( "aria-modal" ) , "true" , "aria-modal attribute set to true" ) ;
92
+ assert . equal ( wrapper . attr ( "aria-modal" ) , "true" , "modal option set to true, aria-modal attribute added" ) ;
93
+ element . dialog ( "option" , "modal" , false ) ;
94
+ assert . ok ( ! wrapper . attr ( "aria-modal" ) , "modal option set to false, aria-modal attribute not added" ) ;
95
+ element . dialog ( "option" , "modal" , null ) ;
96
+ assert . ok ( ! wrapper . attr ( "aria-modal" ) , "modal option not set, aria-modal attribute not added" ) ;
97
+ element . dialog ( "option" , "modal" , true ) ;
98
+ assert . equal ( wrapper . attr ( "aria-modal" ) , "true" , "modal option set to true, aria-modal attribute added" ) ;
93
99
element . remove ( ) ;
94
100
95
- var element = $ ( "<div>" ) . dialog ( "options" , " modal" , false ) ,
101
+ var element = $ ( "<div>" ) . dialog ( { modal : false } ) ,
96
102
wrapper = element . dialog ( "widget" ) ;
97
- assert . equal ( wrapper . attr ( "aria-modal" ) , "false" , "aria-modal attribute set to false" ) ;
103
+ assert . ok ( ! wrapper . attr ( "aria-modal" ) , "modal option set to false, aria-modal attribute not added" ) ;
104
+ element . dialog ( "option" , "modal" , true ) ;
105
+ assert . equal ( wrapper . attr ( "aria-modal" ) , "true" , "modal option set to true, aria-modal attribute added" ) ;
106
+ element . dialog ( "option" , "modal" , null ) ;
107
+ assert . ok ( ! wrapper . attr ( "aria-modal" ) , "modal option not set, aria-modal attribute not added" ) ;
108
+ element . dialog ( "option" , "modal" , false ) ;
109
+ assert . ok ( ! wrapper . attr ( "aria-modal" ) , "modal option set to false, aria-modal attribute not added" ) ;
98
110
element . remove ( ) ;
99
111
100
- var element = $ ( "<div>" ) . dialog ( "options" , "modal" , null ) ,
112
+ var element = $ ( "<div>" ) . dialog ( ) ,
101
113
wrapper = element . dialog ( "widget" ) ;
102
- assert . equal ( wrapper . attr ( "aria-modal" ) , null , "no aria-modal attribute added" ) ;
114
+ assert . ok ( ! wrapper . attr ( "aria-modal" ) , "modal option not set, aria-modal attribute not added" ) ;
115
+ element . dialog ( "option" , "modal" , true ) ;
116
+ assert . equal ( wrapper . attr ( "aria-modal" ) , "true" , "modal option set to true, aria-modal attribute added" ) ;
117
+ element . dialog ( "option" , "modal" , false ) ;
118
+ assert . ok ( ! wrapper . attr ( "aria-modal" ) , "modal option set to false, aria-modal attribute not added" ) ;
119
+ element . dialog ( "option" , "modal" , null ) ;
120
+ assert . equal ( wrapper . attr ( "aria-modal" ) , null , "modal option not set, aria-modal attribute not added" ) ;
103
121
element . remove ( ) ;
104
122
} ) ;
105
123
106
-
107
124
QUnit . test ( "widget method" , function ( assert ) {
108
125
assert . expect ( 1 ) ;
109
126
var dialog = $ ( "<div>" ) . appendTo ( "#qunit-fixture" ) . dialog ( ) ;
0 commit comments