Skip to content

Commit 257be9d

Browse files
committed
Fixes lint issues on test files
1 parent e8b5f92 commit 257be9d

2 files changed

Lines changed: 9 additions & 6 deletions

File tree

src/__tests__/component.test.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,19 +46,18 @@ describe('<SizeMe />', () => {
4646

4747
it('should update the sizeme component when a new configuration is provided', () => {
4848
const wrapper = shallow(<SizeMe {...sizeMeConfig}>{noop}</SizeMe>)
49-
const newSizeMeConfig = Object.assign({}, sizeMeConfig, {
49+
const newSizeMeConfig = {
50+
...sizeMeConfig,
5051
monitorHeight: false,
51-
})
52-
wrapper.setProps(
53-
Object.assign({ children: noop }, sizeMeConfig, newSizeMeConfig),
54-
)
52+
}
53+
wrapper.setProps({ ...sizeMeConfig, ...newSizeMeConfig })
5554
expect(withSizeMock).toHaveBeenCalledTimes(2)
5655
expect(withSizeMock).lastCalledWith(newSizeMeConfig)
5756
})
5857

5958
it('should not update the sizeme component when a new configuration is provided', () => {
6059
const wrapper = shallow(<SizeMe render={noop} {...sizeMeConfig} />)
61-
wrapper.setProps(Object.assign({ render: () => 'NEW!' }, sizeMeConfig))
60+
wrapper.setProps({ render: () => 'NEW!', ...sizeMeConfig })
6261
expect(withSizeMock).toHaveBeenCalledTimes(1)
6362
})
6463
})

src/__tests__/with-size.test.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
/* eslint-disable no-underscore-dangle */
44
/* eslint-disable global-require */
55
/* eslint-disable import/no-extraneous-dependencies */
6+
/* eslint-disable react/jsx-one-expression-per-line */
67

78
import React from 'react'
89
import enzyme, { mount } from 'enzyme'
@@ -130,15 +131,18 @@ describe('withSize', () => {
130131
// eslint-disable-next-line react/no-unused-state
131132
size: null,
132133
}
134+
133135
onSize = size =>
134136
this.setState({
135137
// eslint-disable-next-line react/no-unused-state
136138
size,
137139
})
140+
138141
render() {
139142
return <SizeAwareComponent onSize={this.onSize} />
140143
}
141144
}
145+
142146
const mounted = mount(<SizeCallbackWrapper />)
143147

144148
// Get the callback for size changes.

0 commit comments

Comments
 (0)