Skip to content

Commit d379786

Browse files
committed
refactor: Apply @chinesedfan recommendations
1 parent 13ac053 commit d379786

File tree

1 file changed

+7
-19
lines changed

1 file changed

+7
-19
lines changed

__tests__/tests/components/CommentInput.js

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ import {CommentInput} from 'components';
66

77
describe('<CommentInput />', () => {
88

9-
let defaultProps = {
9+
const defaultProps = {
1010
users: [],
1111
userHasPushPermission: true,
1212
issueLocked: false,
1313
locale: '',
1414
onSubmit: () => {},
1515
};
1616

17-
it("should render 'TextInput' and TouchableOpacity if user can post", () => {
17+
it('should render TextInput and TouchableOpacity if user can post', () => {
1818

1919
const wrapper = shallow(
2020
<CommentInput {...defaultProps}/>
@@ -25,7 +25,7 @@ describe('<CommentInput />', () => {
2525
expect(wrapper.find('Text').length).toEqual(0);
2626
});
2727

28-
it("should not render 'TextInput' and TouchableOpacity if user can post", () => {
28+
it("should not render TextInput and TouchableOpacity if user can't post", () => {
2929

3030
const wrapper = shallow(
3131
<CommentInput
@@ -41,10 +41,7 @@ describe('<CommentInput />', () => {
4141

4242
it('should update the state text if value change', () => {
4343
const wrapper = shallow(
44-
<CommentInput
45-
{...defaultProps}
46-
userHasPushPermission={true}
47-
issueLocked={false}/>
44+
<CommentInput {...defaultProps}/>
4845
);
4946

5047
const input = wrapper.find('TextInput');
@@ -56,10 +53,7 @@ describe('<CommentInput />', () => {
5653

5754
it('should call handleSubmit methods when submitted', () => {
5855
const wrapper = shallow(
59-
<CommentInput
60-
{...defaultProps}
61-
userHasPushPermission={true}
62-
issueLocked={false}/>
56+
<CommentInput {...defaultProps}/>
6357
);
6458

6559
const handleSubmitSpy = jest.spyOn(wrapper.instance(), 'handleSubmit');
@@ -81,10 +75,7 @@ describe('<CommentInput />', () => {
8175

8276
it('should change the content size', () => {
8377
const wrapper = shallow(
84-
<CommentInput
85-
{...defaultProps}
86-
userHasPushPermission={true}
87-
issueLocked={false}/>
78+
<CommentInput {...defaultProps}/>
8879
);
8980

9081
wrapper
@@ -102,10 +93,7 @@ describe('<CommentInput />', () => {
10293

10394
it('should call handleSubmitEditing methods when onSubmitEditing event raised', () => {
10495
const wrapper = shallow(
105-
<CommentInput
106-
{...defaultProps}
107-
userHasPushPermission={true}
108-
issueLocked={false}/>
96+
<CommentInput {...defaultProps}/>
10997
);
11098

11199
const handleSubmitEditingSpy = jest.spyOn(wrapper.instance(), 'handleSubmitEditing');

0 commit comments

Comments
 (0)