@@ -90,24 +90,29 @@ describe('ExternalWebLinks Directive', function() {
90
90
} ) ;
91
91
expect ( topcoderLink ) . to . exist ;
92
92
expect ( topcoderLink . status ) . to . exist . to . equal ( 'PENDING' ) ;
93
+ expect ( element . isolateScope ( ) . url ) . not . to . exist ;
93
94
expect ( toasterSvc . pop ) . to . have . been . calledWith ( 'success' ) . calledOnce ;
94
95
} ) ;
95
96
96
97
it ( 'should NOT add new weblink to linkedAccounts' , function ( ) {
98
+ var urlToAdd = 'https://www.topcoder.com' ;
97
99
element . isolateScope ( ) . userHandle = 'throwError' ;
98
- element . isolateScope ( ) . url = 'https://www.topcoder.com' ;
100
+ element . isolateScope ( ) . url = urlToAdd ;
99
101
element . isolateScope ( ) . addWebLink ( ) ;
100
102
scope . $digest ( ) ;
101
103
expect ( scope . linkedAccounts ) . to . have . length ( 1 ) ;
104
+ expect ( element . isolateScope ( ) . url ) . to . exist . to . equal ( urlToAdd ) ;
102
105
expect ( toasterSvc . pop ) . to . have . been . calledWith ( 'error' ) . calledOnce ;
103
106
} ) ;
104
107
105
108
it ( 'should NOT add new weblink to linkedAccounts' , function ( ) {
109
+ var urlToAdd = 'https://www.topcoder.com' ;
106
110
element . isolateScope ( ) . userHandle = 'alreadyExistsError' ;
107
- element . isolateScope ( ) . url = 'https://www.topcoder.com' ;
111
+ element . isolateScope ( ) . url = urlToAdd ;
108
112
element . isolateScope ( ) . addWebLink ( ) ;
109
113
scope . $digest ( ) ;
110
114
expect ( scope . linkedAccounts ) . to . have . length ( 1 ) ;
115
+ expect ( element . isolateScope ( ) . url ) . to . exist . to . equal ( urlToAdd ) ;
111
116
expect ( toasterSvc . pop ) . to . have . been . calledWith ( 'error' ) . calledOnce ;
112
117
} ) ;
113
118
0 commit comments