Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 686a5ba

Browse files
committed
format
1 parent 7abbac4 commit 686a5ba

File tree

1 file changed

+19
-12
lines changed

1 file changed

+19
-12
lines changed

‎src/__tests__/events.js‎

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -155,10 +155,12 @@ eventTypes.forEach(({type, events, elementType, init}) => {
155155
const ref = React.createRef()
156156
const spy = jest.fn()
157157

158-
await render(React.createElement(elementType, {
159-
[propName]: spy,
160-
ref,
161-
}))
158+
await render(
159+
React.createElement(elementType, {
160+
[propName]: spy,
161+
ref,
162+
}),
163+
)
162164

163165
await fireEvent[eventName](ref.current, init)
164166
expect(spy).toHaveBeenCalledTimes(1)
@@ -216,21 +218,26 @@ test('calling `fireEvent` directly works too', async () => {
216218
const {
217219
container: {firstChild: button},
218220
} = await render(<button onClick={handleEvent} />)
219-
await fireEvent(button, new Event('MouseEvent', {
220-
bubbles: true,
221-
cancelable: true,
222-
button: 0,
223-
}))
221+
await fireEvent(
222+
button,
223+
new Event('MouseEvent', {
224+
bubbles: true,
225+
cancelable: true,
226+
button: 0,
227+
}),
228+
)
224229
})
225230

226231
test('blur/focus bubbles in react', async () => {
227232
const handleBlur = jest.fn()
228233
const handleBubbledBlur = jest.fn()
229234
const handleFocus = jest.fn()
230235
const handleBubbledFocus = jest.fn()
231-
const {container} = await render(<div onBlur={handleBubbledBlur} onFocus={handleBubbledFocus}>
232-
<button onBlur={handleBlur} onFocus={handleFocus} />
233-
</div>)
236+
const {container} = await render(
237+
<div onBlur={handleBubbledBlur} onFocus={handleBubbledFocus}>
238+
<button onBlur={handleBlur} onFocus={handleFocus} />
239+
</div>,
240+
)
234241
const button = container.firstChild.firstChild
235242

236243
await fireEvent.focus(button)

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /