@@ -127,26 +127,29 @@ describe('OC.Share.ShareDialogView', function() {
127127 describe ( 'Share with link' , function ( ) {
128128 // TODO: test ajax calls
129129 // TODO: test password field visibility (whenever enforced or not)
130- it ( 'update password on focus out ' , function ( ) {
130+ it ( 'update password on enter ' , function ( ) {
131131 $ ( '#allowShareWithLink' ) . val ( 'yes' ) ;
132132
133133 dialog . model . set ( 'linkShare' , {
134134 isLinkShare : true
135135 } ) ;
136136 dialog . render ( ) ;
137137
138- // Enable password, enter password and focusout
138+ // Toggle linkshare
139+ dialog . $el . find ( '.linkCheckbox' ) . click ( ) ;
140+
141+ // Enable password and enter password
139142 dialog . $el . find ( '[name=showPassword]' ) . click ( ) ;
140143 dialog . $el . find ( '.linkPassText' ) . focus ( ) ;
141144 dialog . $el . find ( '.linkPassText' ) . val ( 'foo' ) ;
142- dialog . $el . find ( '.linkPassText' ) . focusout ( ) ;
145+ dialog . $el . find ( '.linkPassText' ) . trigger ( new $ . Event ( 'keyup' , { keyCode : 13 } ) ) ;
143146
144147 expect ( saveLinkShareStub . calledOnce ) . toEqual ( true ) ;
145148 expect ( saveLinkShareStub . firstCall . args [ 0 ] ) . toEqual ( {
146149 password : 'foo'
147150 } ) ;
148151 } ) ;
149- it ( 'update password on enter ' , function ( ) {
152+ it ( 'update password on submit ' , function ( ) {
150153 $ ( '#allowShareWithLink' ) . val ( 'yes' ) ;
151154
152155 dialog . model . set ( 'linkShare' , {
@@ -161,7 +164,7 @@ describe('OC.Share.ShareDialogView', function() {
161164 dialog . $el . find ( '[name=showPassword]' ) . click ( ) ;
162165 dialog . $el . find ( '.linkPassText' ) . focus ( ) ;
163166 dialog . $el . find ( '.linkPassText' ) . val ( 'foo' ) ;
164- dialog . $el . find ( '.linkPassText' ) . trigger ( new $ . Event ( 'keyup' , { keyCode : 13 } ) ) ;
167+ dialog . $el . find ( '.linkPassText + .icon-confirm' ) . click ( ) ;
165168
166169 expect ( saveLinkShareStub . calledOnce ) . toEqual ( true ) ;
167170 expect ( saveLinkShareStub . firstCall . args [ 0 ] ) . toEqual ( {
0 commit comments