Skip to content

Commit 95239f2

Browse files
committed
Fix broken tests
1 parent e8c6cb3 commit 95239f2

File tree

1 file changed

+19
-20
lines changed

1 file changed

+19
-20
lines changed

tests/test-components/PastCommitNode.spec.tsx

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -48,48 +48,47 @@ describe('PastCommitNode', () => {
4848
const branches: Git.IBranch[] = notMatchingBranches.concat(matchingBranches);
4949
const props: IPastCommitNodeProps = {
5050
model: null,
51-
pastCommit: {
51+
commit: {
5252
commit: '2414721b194453f058079d897d13c4e377f92dc6',
5353
author: 'author',
5454
date: 'date',
5555
commit_msg: 'message',
5656
pre_commit: 'pre_commit'
5757
},
5858
branches: branches,
59-
refreshHistory: () => Promise.resolve(),
6059
renderMime: null
6160
};
6261

6362
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);
6968
});
7069

7170
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');
7776
});
7877

7978
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);
8281
});
8382

8483
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);
8887
});
8988

9089
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);
9493
});
9594
});

0 commit comments

Comments
 (0)