Skip to content

Commit 3dd9238

Browse files
committed
fix: code style
1 parent 50985c2 commit 3dd9238

File tree

1 file changed

+10
-19
lines changed

1 file changed

+10
-19
lines changed

tests/props.test.js

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import React from 'react';
21
import { mount } from 'enzyme';
2+
import React from 'react';
33
import List from '../src';
44

55
describe('Props', () => {
@@ -11,30 +11,20 @@ describe('Props', () => {
1111
}
1212

1313
const wrapper = mount(
14-
<List data={[{ id: 903 }, { id: 1128 }]} itemKey={item => item.id}>
14+
<List data={[{ id: 903 }, { id: 1128 }]} itemKey={(item) => item.id}>
1515
{({ id }) => <ItemComponent>{id}</ItemComponent>}
1616
</List>,
1717
);
1818

19-
expect(
20-
wrapper
21-
.find('Item')
22-
.at(0)
23-
.key(),
24-
).toBe('903');
19+
expect(wrapper.find('Item').at(0).key()).toBe('903');
2520

26-
expect(
27-
wrapper
28-
.find('Item')
29-
.at(1)
30-
.key(),
31-
).toBe('1128');
21+
expect(wrapper.find('Item').at(1).key()).toBe('1128');
3222
});
3323

3424
it('prefixCls', () => {
3525
const wrapper = mount(
36-
<List data={[0]} itemKey={id => id} prefixCls="prefix">
37-
{id => <div>{id}</div>}
26+
<List data={[0]} itemKey={(id) => id} prefixCls="prefix">
27+
{(id) => <div>{id}</div>}
3828
</List>,
3929
);
4030

@@ -44,10 +34,11 @@ describe('Props', () => {
4434
it('offsetX in renderFn', () => {
4535
let scrollLeft;
4636
mount(
47-
<List data={[0]} itemKey={id => id} prefixCls="prefix">
48-
{(id, _, { offsetX }) => {
37+
<List data={[0]} itemKey={(id) => id} prefixCls="prefix">
38+
{(id, _, { offsetX }) => {
4939
scrollLeft = offsetX;
50-
return <div>{id}</div>}}
40+
return <div>{id}</div>;
41+
}}
5142
</List>,
5243
);
5344

0 commit comments

Comments
 (0)