File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3434 "eslint" : " ^0.24.1" ,
3535 "eslint-plugin-react" : " ^2.7.0" ,
3636 "expect" : " ^1.8.0" ,
37- "jsdom" : " ^6.3.0" ,
3837 "mocha" : " ^2.2.5" ,
3938 "mocha-babel" : " ^3.0.0" ,
4039 "react-hot-loader" : " ^1.3.0" ,
4342 "webpack-dev-server" : " ^1.10.1"
4443 },
4544 "dependencies" : {
46- "jsdom" : " ^6.5.0 " ,
45+ "jsdom" : " ^6.5.1 " ,
4746 "react" : " ^0.13.3"
4847 }
4948}
Original file line number Diff line number Diff line change @@ -30,6 +30,12 @@ class Test {
3030 return this
3131 }
3232
33+ element ( callback ) {
34+ let element = this . getFirst ( this . helpers . elements )
35+ if ( this . helpers ) callback . call ( this , element )
36+ return this
37+ }
38+
3339 test ( callback ) {
3440 var params = this . params ( )
3541 callback . call ( params , params )
@@ -44,6 +50,12 @@ class Test {
4450 return this
4551 }
4652
53+ //private
54+
55+ getFirst ( object ) {
56+ for ( let element in object ) return object [ element ]
57+ }
58+
4759 //Built in middleware
4860
4961 find ( data ) {
Original file line number Diff line number Diff line change 1+ import Test from '../src/legit-tests'
2+ import { Find } from '../src/middleware'
3+ import { expect } from 'chai' ;
4+
5+ import TestComponent from './component'
6+ import TinyComponent from './tiny-component'
7+
8+ describe ( '.element' , ( ) => {
9+
10+ it ( 'should find box' , ( ) => {
11+ Test ( < TestComponent /> )
12+ . find ( '.box' )
13+ . element ( box => {
14+ expect ( box . props . children ) . to . be . equal ( 'found me!' )
15+ } )
16+ } ) ;
17+ } ) ;
You can’t perform that action at this time.
0 commit comments