Skip to content

Commit bafc8a4

Browse files
committedMar 17, 2025
refactor(sanity): remove implicit test id on LazyTextInput (#8921)
1 parent ee72551 commit bafc8a4

File tree

6 files changed

+12
-2
lines changed

6 files changed

+12
-2
lines changed
 

‎packages/sanity/src/core/components/inputs/DateInputs/DateTimeInput.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ export const DateTimeInput = forwardRef(function DateTimeInput(
126126
return (
127127
<LazyTextInput
128128
ref={ref}
129+
data-testid="date-input"
129130
{...rest}
130131
readOnly={disableInput || readOnly}
131132
value={inputValue}

‎packages/sanity/src/core/components/inputs/DateInputs/LazyTextInput.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ export const LazyTextInput = forwardRef(function LazyTextInput(
6464
return (
6565
<TextInput
6666
{...rest}
67-
data-testid="date-input"
6867
ref={forwardedRef}
6968
value={inputValue === undefined ? value : inputValue}
7069
onChange={handleChange}

‎packages/sanity/src/core/components/inputs/DateInputs/calendar/YearInput.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ export const YearInput = (
2121

2222
return (
2323
<LazyTextInput
24+
data-testid="date-input"
2425
{...restProps}
2526
fontSize={1}
2627
onChange={handleChange}

‎packages/sanity/src/core/releases/tool/detail/ReleaseTypePicker.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,7 @@ export function ReleaseTypePicker(props: {release: NotArchivedRelease}): React.J
213213
</Card>
214214
)}
215215
<LazyTextInput
216+
data-testid="date-input"
216217
value={
217218
intendedPublishAtTimezoneAdjusted
218219
? format(intendedPublishAtTimezoneAdjusted, dateInputFormat)

‎packages/sanity/src/core/scheduledPublishing/components/dateInputs/base/DateTimeInput.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ export const DateTimeInput = forwardRef(function DateTimeInput(
100100

101101
return (
102102
<LazyTextInput
103+
data-testid="date-input"
103104
ref={inputRef}
104105
{...rest}
105106
value={inputValue}

‎packages/sanity/src/core/scheduledPublishing/components/dateInputs/base/calendar/YearInput.tsx

+8-1
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,12 @@ export const YearInput = ({onChange, ...props}: Props) => {
1818
[onChange],
1919
)
2020

21-
return <LazyTextInput {...props} onChange={handleChange} inputMode="numeric" />
21+
return (
22+
<LazyTextInput
23+
data-testid="date-input"
24+
{...props}
25+
onChange={handleChange}
26+
inputMode="numeric"
27+
/>
28+
)
2229
}

0 commit comments

Comments
 (0)
Please sign in to comment.