@@ -100,7 +100,9 @@ describe("DSL", function() {
100
100
"repeater '.epic' collect '.game-name'" ,
101
101
[ 'Red Dead Redemption' , 'Uncharted' ] ) ;
102
102
} ) ;
103
- it ( 'should collect normal attributes' , function ( ) { } ) ;
103
+ it ( 'should collect normal attributes' , function ( ) {
104
+ //TODO(shyamseshadri) : Left as an exercise to the user
105
+ } ) ;
104
106
} ) ;
105
107
106
108
describe ( 'element' , function ( ) {
@@ -118,24 +120,25 @@ describe("DSL", function() {
118
120
'</div>' +
119
121
'</div>' ;
120
122
} ) ;
123
+ function timeTravel ( future ) {
124
+ executeFuture ( future , html , function ( value ) { future . fulfill ( value ) ; } ) ;
125
+ expect ( future . fulfilled ) . toBeTruthy ( ) ;
126
+ }
121
127
it ( 'should find elements on the page and provide jquery api' , function ( ) {
122
128
var future = element ( '.reports-detail' ) ;
123
129
expect ( future . name ) . toEqual ( "Find element '.reports-detail'" ) ;
124
- executeFuture ( future , html , function ( value ) { future . fulfill ( value ) ; } ) ;
125
- expect ( future . fulfilled ) . toBeTruthy ( ) ;
130
+ timeTravel ( future ) ;
126
131
expect ( future . value . text ( ) ) .
127
132
toEqual ( 'Description : Details...Date created: 01/01/01' ) ;
128
133
expect ( future . value . find ( '.desc' ) . text ( ) ) .
129
134
toEqual ( 'Description : Details...' ) ;
130
135
} ) ;
131
- it ( 'should know how to find ng:bind elements on page' , function ( ) {
132
- var future = element ( '.reports-detail' ) ;
133
- expect ( future . name ) . toEqual ( "Find element '.reports-detail'" ) ;
134
- executeFuture ( future , html , function ( value ) { future . fulfill ( value ) ; } ) ;
135
- expect ( future . fulfilled ) . toBeTruthy ( ) ;
136
- expect ( future . value . boundTo ( 'report.description' ) ) . toEqual ( 'Details...' ) ;
137
- expect ( future . value . boundTo ( 'report.creationDate' ) ) . toEqual ( '01/01/01' ) ;
138
- expect ( future . value . boundTo ( 'doesnotexist' ) ) . not . toBeDefined ( ) ;
136
+ it ( 'should find elements with angular syntax' , function ( ) {
137
+ var future = element ( '{{report.description}}' ) ;
138
+ expect ( future . name ) . toEqual ( "Find element '{{report.description}}'" ) ;
139
+ timeTravel ( future ) ;
140
+ expect ( future . value . text ( ) ) . toEqual ( 'Details...' ) ;
141
+ expect ( future . value . attr ( 'ng:bind' ) ) . toEqual ( 'report.description' ) ;
139
142
} ) ;
140
143
} ) ;
141
144
} ) ;
0 commit comments