@@ -159,20 +159,27 @@ describe("DSL", function() {
159
159
expect ( future . fulfilled ) . toBeTruthy ( ) ;
160
160
}
161
161
it ( 'should find elements on the page and provide jquery api' , function ( ) {
162
- var future = element ( '.reports-detail' ) ;
163
- expect ( future . name ) . toEqual ( "Find element '.reports-detail'" ) ;
162
+ var future = element ( '.reports-detail' ) . text ( ) ;
163
+ expect ( future . name ) . toEqual ( "Element '.reports-detail'.text() " ) ;
164
164
timeTravel ( future ) ;
165
- expect ( future . value . text ( ) ) .
165
+ expect ( future . value ) .
166
166
toEqual ( 'Description : Details...Date created: 01/01/01' ) ;
167
- expect ( future . value . find ( '.desc' ) . text ( ) ) .
168
- toEqual ( 'Description : Details...' ) ;
167
+ // expect(future.value.find('.desc').text()).
168
+ // toEqual('Description : Details...');
169
169
} ) ;
170
170
it ( 'should find elements with angular syntax' , function ( ) {
171
- var future = element ( '{{report.description}}' ) ;
172
- expect ( future . name ) . toEqual ( "Find element '{{report.description}}'" ) ;
171
+ var future = element ( '{{report.description}}' ) . text ( ) ;
172
+ expect ( future . name ) . toEqual ( "Element '{{report.description}}'.text() " ) ;
173
173
timeTravel ( future ) ;
174
- expect ( future . value . text ( ) ) . toEqual ( 'Details...' ) ;
175
- expect ( future . value . attr ( 'ng:bind' ) ) . toEqual ( 'report.description' ) ;
174
+ expect ( future . value ) . toEqual ( 'Details...' ) ;
175
+ // expect(future.value.attr('ng:bind')).toEqual('report.description');
176
+ } ) ;
177
+ it ( 'should be able to click elements' , function ( ) {
178
+ var future = element ( '.link-class' ) . click ( ) ;
179
+ expect ( future . name ) . toEqual ( "Element '.link-class'.click()" ) ;
180
+ executeFuture ( future , html , function ( value ) { future . fulfill ( value ) ; } ) ;
181
+ expect ( future . fulfilled ) . toBeTruthy ( ) ;
182
+ // TODO(rajat): look for some side effect from click happening?
176
183
} ) ;
177
184
} ) ;
178
185
} ) ;
0 commit comments