Skip to content

Commit e0f6137

Browse files
committed
Update tests
1 parent 95239f2 commit e0f6137

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

tests/test-components/CommitBox.spec.tsx

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import * as React from 'react';
22
import 'jest';
33
import { shallow } from 'enzyme';
44
import { CommitBox } from '../../src/components/CommitBox';
5-
import { commitButtonDisabledClass } from '../../src/style/CommitBox';
65

76
describe('CommitBox', () => {
87
describe('#constructor()', () => {
@@ -99,8 +98,8 @@ describe('CommitBox', () => {
9998
};
10099
const component = shallow(<CommitBox {...props} />);
101100
const node = component.find('input[type="button"]').first();
102-
const idx = node.prop('className').indexOf(commitButtonDisabledClass);
103-
expect(idx >= 0).toEqual(true);
101+
const prop = node.prop('disabled');
102+
expect(prop).toEqual(true);
104103
});
105104

106105
it('should apply a class to disable the commit button when files have changes to commit, but the user has not entered a commit message summary', () => {
@@ -110,8 +109,8 @@ describe('CommitBox', () => {
110109
};
111110
const component = shallow(<CommitBox {...props} />);
112111
const node = component.find('input[type="button"]').first();
113-
const idx = node.prop('className').indexOf(commitButtonDisabledClass);
114-
expect(idx >= 0).toEqual(true);
112+
const prop = node.prop('disabled');
113+
expect(prop).toEqual(true);
115114
});
116115

117116
it('should not apply a class to disable the commit button when files have changes to commit and the user has entered a commit message summary', () => {
@@ -125,8 +124,8 @@ describe('CommitBox', () => {
125124
});
126125

127126
const node = component.find('input[type="button"]').first();
128-
const idx = node.prop('className').indexOf(commitButtonDisabledClass);
129-
expect(idx >= 0).toEqual(false);
127+
const prop = node.prop('disabled');
128+
expect(prop).toEqual(false);
130129
});
131130
});
132131
});

tests/test-components/PastCommitNode.spec.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ describe('PastCommitNode', () => {
8989
test('hides details after collapse', () => {
9090
const node = shallow(<PastCommitNode {...props} />);
9191
node.simulate('click');
92+
expect(node.find(SinglePastCommitInfo)).toHaveLength(1);
93+
node.simulate('click');
9294
expect(node.find(SinglePastCommitInfo)).toHaveLength(0);
9395
});
9496
});

0 commit comments

Comments
 (0)