2
0

fix(editor): 🐛 Variables button in text editor

This commit is contained in:
Baptiste Arnaud
2022-03-10 09:41:06 +01:00
parent 4767cdc542
commit 36838f05d3
3 changed files with 7 additions and 1 deletions

View File

@ -144,6 +144,7 @@ export const TextBubbleEditor = ({ initialValue, onClose }: Props) => {
rounded="md" rounded="md"
bgColor="white" bgColor="white"
w="250px" w="250px"
zIndex={10}
> >
<VariableSearchInput <VariableSearchInput
onSelectVariable={handleVariableSelected} onSelectVariable={handleVariableSelected}

View File

@ -60,7 +60,7 @@ export const VariableSearchInput = ({
useEffect(() => { useEffect(() => {
const variable = variables.find((v) => v.name === debouncedInputValue) const variable = variables.find((v) => v.name === debouncedInputValue)
onSelectVariable(variable) if (variable) onSelectVariable(variable)
// eslint-disable-next-line react-hooks/exhaustive-deps // eslint-disable-next-line react-hooks/exhaustive-deps
}, [debouncedInputValue]) }, [debouncedInputValue])

View File

@ -49,6 +49,11 @@ test.describe('Text bubble step', () => {
}) })
await page.click('[data-testid="link-button"]') await page.click('[data-testid="link-button"]')
await page.press('div[role="textbox"]', 'Shift+Enter')
await page.click('button >> text=Variables')
await page.fill('[data-testid="variables-input"]', 'test')
await page.click('text=Create "test"')
await page.click('text=Preview') await page.click('text=Preview')
await expect( await expect(
typebotViewer(page).locator('span.slate-bold >> nth=0') typebotViewer(page).locator('span.slate-bold >> nth=0')