@@ -430,7 +434,7 @@ function InstallStep({
Do not close this tab. The Operator will connect to Qovery shortly once its installation completes. You'll be
- redirected to the cluster profile settings once the operator is installed.
+ redirected to the cluster profile settings once the Operator is installed.
diff --git a/libs/shared/ui/src/lib/components/inputs/input-search/input-search.spec.tsx b/libs/shared/ui/src/lib/components/inputs/input-search/input-search.spec.tsx
index 7842511ca8c..c2c92bfa3ff 100644
--- a/libs/shared/ui/src/lib/components/inputs/input-search/input-search.spec.tsx
+++ b/libs/shared/ui/src/lib/components/inputs/input-search/input-search.spec.tsx
@@ -1,4 +1,6 @@
-import { fireEvent, render, screen } from '__tests__/utils/setup-jest'
+import { render, screen } from '__tests__/utils/setup-jest'
+import { useState } from 'react'
+import { act, renderWithProviders } from '@qovery/shared/util-tests'
import InputSearch, { type InputSearchProps } from './input-search'
let props: InputSearchProps
@@ -10,13 +12,13 @@ describe('InputSearch', () => {
})
it('should set the text value when the input event is emitted', async () => {
- render()
+ const { userEvent } = renderWithProviders()
const input = screen.getByRole('textbox')
- fireEvent.change(input, { target: { value: 'some new text value' } })
+ await userEvent.type(input, 'some new text value')
- expect(input as HTMLInputElement).toHaveValue('some new text value')
+ expect(input).toHaveValue('some new text value')
})
it('follows default value changes', () => {
@@ -39,13 +41,18 @@ describe('InputSearch', () => {
expect(screen.getByRole('button', { name: 'Clear search' })).toBeInTheDocument()
})
- it('keeps the typed value while focused', () => {
- const { rerender } = render()
+ it('keeps the typed value while focused', async () => {
+ let setDefaultValue: (value: string) => void = () => undefined
+ function InputSearchWithExternalValue() {
+ const [defaultValue, setValue] = useState('lo')
+ setDefaultValue = setValue
+ return
+ }
+ const { userEvent } = renderWithProviders()
const input = screen.getByRole('textbox')
- input.focus()
- fireEvent.change(input, { target: { value: 'loki' } })
- rerender()
+ await userEvent.type(input, 'ki')
+ act(() => setDefaultValue('lok'))
expect(input).toHaveValue('loki')
})