@@ -127,26 +127,28 @@ 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 } ) ;
148- } ) ;
149- it ( 'update password on enter' , function ( ) {
151+ } ) ; it ( 'update password on submit' , function ( ) {
150152 $ ( '#allowShareWithLink' ) . val ( 'yes' ) ;
151153
152154 dialog . model . set ( 'linkShare' , {
@@ -161,7 +163,7 @@ describe('OC.Share.ShareDialogView', function() {
161163 dialog . $el . find ( '[name=showPassword]' ) . click ( ) ;
162164 dialog . $el . find ( '.linkPassText' ) . focus ( ) ;
163165 dialog . $el . find ( '.linkPassText' ) . val ( 'foo' ) ;
164- dialog . $el . find ( '.linkPassText' ) . trigger ( new $ . Event ( 'keyup' , { keyCode : 13 } ) ) ;
166+ dialog . $el . find ( '.linkPassText + .icon-confirm' ) . click ( ) ;
165167
166168 expect ( saveLinkShareStub . calledOnce ) . toEqual ( true ) ;
167169 expect ( saveLinkShareStub . firstCall . args [ 0 ] ) . toEqual ( {
0 commit comments