This repository was archived by the owner on Jul 19, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 5 files changed +6
-20
lines changed Expand file tree Collapse file tree 5 files changed +6
-20
lines changed Original file line number Diff line number Diff line change 1
- jest . unmock ( '../public/scripts/bundle .js' ) ;
1
+ jest . unmock ( '../public/scripts/example .js' ) ;
2
2
3
3
var React = require ( 'react' ) ;
4
4
var ReactDOM = require ( 'react-dom' ) ;
@@ -21,12 +21,11 @@ describe('TestCommentBoxComponent', () => {
21
21
expect ( ReactTestUtils . isCompositeComponent ( commentBox ) ) . toBeTruthy ( ) ;
22
22
} ) ;
23
23
24
- /* it('class should equal commentBox', () => {
24
+ it ( 'class should equal commentBox' , ( ) => {
25
25
expect ( boxNode . className ) . toEqual ( 'commentBox' ) ;
26
- });*/
26
+ } ) ;
27
27
28
28
it ( 'initial state data should be empty' , ( ) => {
29
- console . log ( '!!!!!!' , commentBox )
30
29
expect ( commentBox . getInitialState ( ) ) . toBeDefined ( ) ;
31
30
const commentBoxData = commentBox . getInitialState ( ) . data ;
32
31
expect ( commentBoxData ) . toBeDefined ( ) ;
Original file line number Diff line number Diff line change 23
23
"id" : 1464988717637 ,
24
24
"author" : " evil" ,
25
25
"text" : " <a href=\" javascript:alert(1)\" >alert(1)</a>"
26
- },
27
- {
28
- "id" : 1491402159891 ,
29
- "author" : " fghgh" ,
30
- "text" : " gfhgfh"
31
- },
32
- {
33
- "id" : 1491402930256 ,
34
- "author" : " cvcvb" ,
35
- "text" : " zbzv"
36
26
}
37
- ]
27
+ ]
Original file line number Diff line number Diff line change 11
11
"babel-preset-react" : " ^6.5.0" ,
12
12
"body-parser" : " ^1.4.3" ,
13
13
"express" : " ^4.4.5" ,
14
- "jQuery" : " ^1.7.4" ,
15
14
"jest-cli" : " ^13.0.0" ,
16
15
"jquery" : " ^3.2.1" ,
17
16
"react" : " ^15.1.0" ,
17
+ "react-addons-test-utils" : " ^15.4.2" ,
18
18
"react-dom" : " ^15.1.0"
19
19
},
20
20
"devDependencies" : {
Original file line number Diff line number Diff line change 10
10
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
11
11
*/
12
12
var React = require ( 'react' ) ;
13
+ var $ = require ( 'jquery' ) ;
13
14
14
15
var Comment = React . createClass ( {
15
16
rawMarkup : function ( ) {
@@ -145,4 +146,3 @@ var CommentForm = React.createClass({
145
146
module . exports = {
146
147
CommentBox : CommentBox
147
148
}
148
-
Original file line number Diff line number Diff line change 1
- /**
2
- * Created by lewa on 24/06/2016.
3
- */
4
1
var CommentBox = require ( './example.js' ) . CommentBox ;
5
2
6
3
ReactDOM . render (
You can’t perform that action at this time.
0 commit comments