/
githubmirror
/
ionic
Обзор
Документация
Войти
/
githubmirror
/
ionic
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
core/src/utils/keyboard/test/keyboard-controller.spec.ts
24 строки
846 B
Liam DeBeasi
fix(footer, tab-bar): wait for resize before re-showing (#27417)
16 май 2023, 22:41
Не верифицирован
16 май 2023, 22:41
70d9854
Код
Авторство
О чём код?
import { createKeyboardController } from '../keyboard-controller'; describe('Keyboard Controller', () => { it('should update isKeyboardVisible', async () => { const keyboardCtrl = await createKeyboardController(); window.dispatchEvent(new Event('keyboardWillShow')); expect(keyboardCtrl.isKeyboardVisible()).toBe(true); window.dispatchEvent(new Event('keyboardWillHide')); expect(keyboardCtrl.isKeyboardVisible()).toBe(false); }); it('should run the callback', async () => { const callbackMock = jest.fn(); await createKeyboardController(callbackMock); window.dispatchEvent(new Event('keyboardWillShow')); expect(callbackMock).toHaveBeenCalledWith(true, undefined); window.dispatchEvent(new Event('keyboardWillHide')); expect(callbackMock).toHaveBeenCalledWith(false, undefined); }); });