Skip to content

Commit 09efb78

Browse files
committed
Add onDeactivate call
1 parent 060e085 commit 09efb78

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

packages/docs-gesture-handler/docs/guides/testing.mdx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ test('updates application state after each gesture step', () => {
111111
const onBegin = jest.fn();
112112
const onActivate = jest.fn();
113113
const onUpdate = jest.fn();
114+
const onDeactivate = jest.fn();
114115
const onFinalize = jest.fn();
115116

116117
const panGesture = renderHook(() =>
@@ -119,6 +120,7 @@ test('updates application state after each gesture step', () => {
119120
onBegin,
120121
onActivate,
121122
onUpdate,
123+
onDeactivate,
122124
onFinalize,
123125
})
124126
).result.current;
@@ -137,6 +139,7 @@ test('updates application state after each gesture step', () => {
137139
);
138140

139141
controller.end();
142+
expect(onDeactivate).toHaveBeenCalledTimes(1);
140143
expect(onFinalize).toHaveBeenCalledWith(
141144
expect.objectContaining({ canceled: false })
142145
);

0 commit comments

Comments
 (0)