@@ -122,15 +122,13 @@ describe("core.dom tests", () => {
122122 expect ( el . style . marginTop ) . toBe ( "4em" ) ;
123123 expect ( el . style . display ) . toBe ( "none" ) ;
124124 expect ( el . getAttribute ( "style" ) . indexOf ( "display" ) >= - 1 ) . toBeTruthy ( ) ;
125- expect ( el . hasAttribute ( "hidden" ) ) . toBe ( true ) ;
126125
127126 dom . show ( el ) ;
128127
129128 expect ( el . style . borderTop ) . toBe ( "2em" ) ;
130129 expect ( el . style . marginTop ) . toBe ( "4em" ) ;
131130 expect ( el . style . display ) . toBeFalsy ( ) ;
132131 expect ( el . getAttribute ( "style" ) . indexOf ( "display" ) === - 1 ) . toBeTruthy ( ) ;
133- expect ( el . hasAttribute ( "hidden" ) ) . toBe ( false ) ;
134132
135133 el . style . display = "inline" ;
136134 dom . hide ( el ) ;
@@ -139,14 +137,26 @@ describe("core.dom tests", () => {
139137 expect ( el . style . marginTop ) . toBe ( "4em" ) ;
140138 expect ( el . style . display ) . toBe ( "none" ) ;
141139 expect ( el . getAttribute ( "style" ) . indexOf ( "display" ) >= - 1 ) . toBeTruthy ( ) ;
142- expect ( el . hasAttribute ( "hidden" ) ) . toBe ( true ) ;
143140
144141 dom . show ( el ) ;
145142
146143 expect ( el . style . borderTop ) . toBe ( "2em" ) ;
147144 expect ( el . style . marginTop ) . toBe ( "4em" ) ;
148145 expect ( el . style . display ) . toBe ( "inline" ) ;
149146 expect ( el . getAttribute ( "style" ) . indexOf ( "display" ) >= - 1 ) . toBeTruthy ( ) ;
147+
148+ done ( ) ;
149+ } ) ;
150+
151+ it ( "most not set the hidden attribute" , ( done ) => {
152+ // dom.hide must not set the hidden attribute due to,
153+ // https://stackoverflow.com/a/28340579/1337474
154+ // otherwise hidden input elements might not be able to be
155+ // submitted in Chrome and Safari.
156+
157+ const el = document . createElement ( "div" ) ;
158+ dom . hide ( el ) ;
159+
150160 expect ( el . hasAttribute ( "hidden" ) ) . toBe ( false ) ;
151161
152162 done ( ) ;
0 commit comments