@@ -48,48 +48,47 @@ describe('PastCommitNode', () => {
48
48
const branches : Git . IBranch [ ] = notMatchingBranches . concat ( matchingBranches ) ;
49
49
const props : IPastCommitNodeProps = {
50
50
model : null ,
51
- pastCommit : {
51
+ commit : {
52
52
commit : '2414721b194453f058079d897d13c4e377f92dc6' ,
53
53
author : 'author' ,
54
54
date : 'date' ,
55
55
commit_msg : 'message' ,
56
56
pre_commit : 'pre_commit'
57
57
} ,
58
58
branches : branches ,
59
- refreshHistory : ( ) => Promise . resolve ( ) ,
60
59
renderMime : null
61
60
} ;
62
61
63
62
test ( 'Includes commit info' , ( ) => {
64
- const pastCommitNode = shallow ( < PastCommitNode { ...props } /> ) ;
65
- expect ( pastCommitNode . text ( ) ) . toMatch ( props . pastCommit . author ) ;
66
- expect ( pastCommitNode . text ( ) ) . toMatch ( props . pastCommit . commit . slice ( 0 , 7 ) ) ;
67
- expect ( pastCommitNode . text ( ) ) . toMatch ( props . pastCommit . date ) ;
68
- expect ( pastCommitNode . text ( ) ) . toMatch ( props . pastCommit . commit_msg ) ;
63
+ const node = shallow ( < PastCommitNode { ...props } /> ) ;
64
+ expect ( node . text ( ) ) . toMatch ( props . commit . author ) ;
65
+ expect ( node . text ( ) ) . toMatch ( props . commit . commit . slice ( 0 , 7 ) ) ;
66
+ expect ( node . text ( ) ) . toMatch ( props . commit . date ) ;
67
+ expect ( node . text ( ) ) . toMatch ( props . commit . commit_msg ) ;
69
68
} ) ;
70
69
71
70
test ( 'Includes only relevent branch info' , ( ) => {
72
- const pastCommitNode = shallow ( < PastCommitNode { ...props } /> ) ;
73
- expect ( pastCommitNode . text ( ) ) . toMatch ( 'name3' ) ;
74
- expect ( pastCommitNode . text ( ) ) . toMatch ( 'name4' ) ;
75
- expect ( pastCommitNode . text ( ) ) . not . toMatch ( 'name1' ) ;
76
- expect ( pastCommitNode . text ( ) ) . not . toMatch ( 'name2' ) ;
71
+ const node = shallow ( < PastCommitNode { ...props } /> ) ;
72
+ expect ( node . text ( ) ) . toMatch ( 'name3' ) ;
73
+ expect ( node . text ( ) ) . toMatch ( 'name4' ) ;
74
+ expect ( node . text ( ) ) . not . toMatch ( 'name1' ) ;
75
+ expect ( node . text ( ) ) . not . toMatch ( 'name2' ) ;
77
76
} ) ;
78
77
79
78
test ( 'Doesnt include details at first' , ( ) => {
80
- const pastCommitNode = shallow ( < PastCommitNode { ...props } /> ) ;
81
- expect ( pastCommitNode . find ( SinglePastCommitInfo ) ) . toHaveLength ( 0 ) ;
79
+ const node = shallow ( < PastCommitNode { ...props } /> ) ;
80
+ expect ( node . find ( SinglePastCommitInfo ) ) . toHaveLength ( 0 ) ;
82
81
} ) ;
83
82
84
83
test ( 'includes details after click' , ( ) => {
85
- const pastCommitNode = shallow ( < PastCommitNode { ...props } /> ) ;
86
- pastCommitNode . simulate ( 'click' ) ;
87
- expect ( pastCommitNode . find ( SinglePastCommitInfo ) ) . toHaveLength ( 1 ) ;
84
+ const node = shallow ( < PastCommitNode { ...props } /> ) ;
85
+ node . simulate ( 'click' ) ;
86
+ expect ( node . find ( SinglePastCommitInfo ) ) . toHaveLength ( 1 ) ;
88
87
} ) ;
89
88
90
89
test ( 'hides details after collapse' , ( ) => {
91
- const pastCommitNode = shallow ( < PastCommitNode { ...props } /> ) ;
92
- pastCommitNode . simulate ( 'click' ) ;
93
- expect ( pastCommitNode . find ( SinglePastCommitInfo ) ) . toHaveLength ( 0 ) ;
90
+ const node = shallow ( < PastCommitNode { ...props } /> ) ;
91
+ node . simulate ( 'click' ) ;
92
+ expect ( node . find ( SinglePastCommitInfo ) ) . toHaveLength ( 0 ) ;
94
93
} ) ;
95
94
} ) ;
0 commit comments