Skip to content

Commit b395a09

Browse files
committed
test: update slide animation tests with new avoidKeyboard param
1 parent aeca020 commit b395a09

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

src/__tests__/useToast.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ describe('test useToast hook', () => {
125125
autoHide: false,
126126
visibilityTime: 20,
127127
topOffset: 120,
128+
avoidKeyboard: true,
128129
bottomOffset: 130,
129130
keyboardOffset: 5,
130131
onShow: jest.fn(),

src/hooks/__tests__/useSlideAnimation.test.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,19 @@ import {
88
useSlideAnimation
99
} from '../useSlideAnimation';
1010

11-
const defaultOffsets = {
11+
const defaultParams = {
1212
topOffset: 40,
1313
bottomOffset: 60,
14-
keyboardOffset: 5
14+
keyboardOffset: 5,
15+
avoidKeyboard: true
1516
};
1617

1718
const setup = () => {
1819
const utils = renderHook(() =>
1920
useSlideAnimation({
2021
position: 'top',
2122
height: 20,
22-
...defaultOffsets
23+
...defaultParams
2324
})
2425
);
2526
return {
@@ -57,7 +58,7 @@ describe('test translateYOutputRangeFor function', () => {
5758
position: 'top',
5859
height: 20,
5960
keyboardHeight: 0,
60-
...defaultOffsets
61+
...defaultParams
6162
})
6263
).toEqual([-40, 40]);
6364
});
@@ -68,7 +69,7 @@ describe('test translateYOutputRangeFor function', () => {
6869
position: 'bottom',
6970
height: 20,
7071
keyboardHeight: 0,
71-
...defaultOffsets
72+
...defaultParams
7273
})
7374
).toEqual([40, -60]);
7475
});
@@ -79,7 +80,7 @@ describe('test translateYOutputRangeFor function', () => {
7980
position: 'bottom',
8081
height: 20,
8182
keyboardHeight: 400,
82-
...defaultOffsets
83+
...defaultParams
8384
})
8485
).toEqual([40, -405]);
8586
});

0 commit comments

Comments
 (0)