From d4570b60aecdeae4ce8dedb63c511f359e9760cb Mon Sep 17 00:00:00 2001 From: Lei Nelissen Date: Mon, 28 Nov 2022 22:56:22 +0100 Subject: [PATCH] fix: screenshotting logic --- ios/FintunesUITests/FintunesUITests.swift | 4 ++-- src/components/Input.tsx | 13 ++++--------- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/ios/FintunesUITests/FintunesUITests.swift b/ios/FintunesUITests/FintunesUITests.swift index 7b19579..4fe4407 100644 --- a/ios/FintunesUITests/FintunesUITests.swift +++ b/ios/FintunesUITests/FintunesUITests.swift @@ -33,8 +33,8 @@ class FintunesUITests: XCTestCase { app.otherElements["all-albums"].tap(); snapshot("05AlbumsScreen"); app.buttons["search-tab"].tap(); - app.textFields["search-input"].tap(); - app.textFields["search-input"].typeText("bicep"); + app.otherElements["search-input-container"].tap(); + app.textFields["search-input-textinput"].typeText("bicep") snapshot("03SearchScreen"); if app.otherElements["search-result-a644f8d23821601d2feb86ddae5e64f4"].waitForExistence(timeout: 5) { app.otherElements["search-result-a644f8d23821601d2feb86ddae5e64f4"].tap(); diff --git a/src/components/Input.tsx b/src/components/Input.tsx index c8446a8..a4c4b74 100644 --- a/src/components/Input.tsx +++ b/src/components/Input.tsx @@ -5,7 +5,7 @@ import useDefaultStyles from './Colors'; import { Gap } from './Utility'; export interface InputProps extends TextInputProps { - icon?: React.ReactNode + icon?: React.ReactNode; } const Container = styled.Pressable` @@ -21,26 +21,21 @@ const Container = styled.Pressable` })} `; -const InputWrapper = styled.TextInput` - margin: 0; - padding: 0; -`; - -function Input({ icon = null, style, ...rest }: InputProps) { +function Input({ icon = null, style, testID, ...rest }: InputProps) { const defaultStyles = useDefaultStyles(); const inputRef = useRef(null); const handlePress = useCallback(() => inputRef.current?.focus(), []); return ( - + {icon && ( <> {icon} )} - + ); }