test: rewrite flow editor tests with playwright

This commit is contained in:
Rıdvan Akca
2023-08-14 22:03:45 +03:00
parent a5b31da3cc
commit 9752e2c4d2
4 changed files with 248 additions and 4 deletions

View File

@@ -60,11 +60,13 @@ const PowerInput = (props: PowerInputProps) => {
const [showVariableSuggestions, setShowVariableSuggestions] =
React.useState(false);
const disappearSuggestionsOnShift = (event: React.KeyboardEvent<HTMLInputElement>) => {
const disappearSuggestionsOnShift = (
event: React.KeyboardEvent<HTMLInputElement>
) => {
if (event.code === 'Tab') {
setShowVariableSuggestions(false);
}
}
};
const stepsWithVariables = React.useMemo(() => {
return processStepWithExecutions(priorStepsWithExecutions);
@@ -112,7 +114,10 @@ const PowerInput = (props: PowerInputProps) => {
}}
>
{/* ref-able single child for ClickAwayListener */}
<ChildrenWrapper style={{ width: '100%' }} data-test="power-input">
<ChildrenWrapper
style={{ width: '100%' }}
data-test={`${name}-power-input`}
>
<FakeInput disabled={disabled}>
<InputLabelWrapper>
<InputLabel
@@ -140,7 +145,10 @@ const PowerInput = (props: PowerInputProps) => {
/>
</FakeInput>
{/* ghost placer for the variables popover */}
<div ref={editorRef} style={{ position: 'absolute', right: 16, left: 16 }} />
<div
ref={editorRef}
style={{ position: 'absolute', right: 16, left: 16 }}
/>
<Popper
open={showVariableSuggestions}