From d0ad03eb14d116e34377874c4f2561a0e95b40dd Mon Sep 17 00:00:00 2001 From: gabalafou Date: Thu, 12 Sep 2024 04:55:10 -0400 Subject: [PATCH] Increase Playwright timeouts, robustify YAML editor interaction (#422) * Increase timeout to build existing env for Playwright test * Also increase default timeout * make Playwright yaml interaction more robust --- src/features/yamlEditor/components/editor.tsx | 3 ++- test/playwright/test_ux.py | 19 ++++++++++++------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/features/yamlEditor/components/editor.tsx b/src/features/yamlEditor/components/editor.tsx index 202770bb..45998819 100644 --- a/src/features/yamlEditor/components/editor.tsx +++ b/src/features/yamlEditor/components/editor.tsx @@ -27,7 +27,7 @@ export const CodeEditor = ({ code, onChangeEditor }: ICodeEditor) => { const convertToJSON = (e: string) => { try { setIsError(false); - onChangeEditor(parse(e)); + onChangeEditor(parse(e) || {}); } catch (e) { setIsError(true); } @@ -52,6 +52,7 @@ export const CodeEditor = ({ code, onChangeEditor }: ICodeEditor) => { theme={isGrayscaleStyleType ? undefined : greenAccentTheme} extensions={[StreamLanguage.define(yamlLanguage)]} onChange={e => convertToJSON(e)} + data-testid="yaml-editor" />