-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: remove hardcoded intervals from the test
- Loading branch information
1 parent
ca40573
commit 868d1ac
Showing
8 changed files
with
588 additions
and
539 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
534 changes: 534 additions & 0 deletions
534
src/components/TextInput/BaseTextInput/implementation/index.tsx
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import type {ForwardedRef} from 'react'; | ||
import React, {forwardRef, useEffect} from 'react'; | ||
import {DeviceEventEmitter} from 'react-native'; | ||
import BaseTextInput from './implementation'; | ||
import type {BaseTextInputProps, BaseTextInputRef} from './types'; | ||
|
||
function BaseTextInputE2E(props: BaseTextInputProps, ref: ForwardedRef<BaseTextInputRef>) { | ||
useEffect(() => { | ||
const testId = props.testID; | ||
if (!testId) { | ||
return; | ||
} | ||
console.debug(`[E2E] BaseTextInput: text-input with testID: ${testId} changed text to ${props.value}`); | ||
|
||
DeviceEventEmitter.emit('onChangeText', {testID: testId, value: props.value}); | ||
}, [props.value, props.testID]); | ||
|
||
return ( | ||
<BaseTextInput | ||
ref={ref} | ||
{...props} | ||
/> | ||
); | ||
} | ||
|
||
export default forwardRef(BaseTextInputE2E); |
Oops, something went wrong.