From 24a926a125f7c3fec96d3235ffe611c7eae62a01 Mon Sep 17 00:00:00 2001 From: Petr Jasek Date: Thu, 19 Dec 2024 09:28:31 +0100 Subject: [PATCH] fix UI crash when using time popup STT-40 --- client/components/UI/Button.tsx | 3 ++ .../UI/Form/TimeInput/TimeInputPopup.tsx | 3 ++ client/components/UI/Form/TimeInput/index.tsx | 1 + client/components/UI/IconButton.tsx | 4 +++ client/validators/events.ts | 4 +-- e2e/cypress/e2e/events/event_all_day.cy.ts | 28 +++++++++++++++++-- e2e/docker-compose.yml | 6 ++-- 7 files changed, 42 insertions(+), 7 deletions(-) diff --git a/client/components/UI/Button.tsx b/client/components/UI/Button.tsx index e8d84d6c4..d013b279f 100644 --- a/client/components/UI/Button.tsx +++ b/client/components/UI/Button.tsx @@ -28,6 +28,7 @@ interface IButtonProps { children?: React.ReactNode; pullRight?: boolean; empty?: boolean; + testId?: string; } const Button = ({ @@ -53,6 +54,7 @@ const Button = ({ refNode, onKeyDown, children, + testId, ...props }: IButtonProps) => { const handeKeyDown = (event) => { @@ -92,6 +94,7 @@ const Button = ({ onKeyDown={enterKeyIsClick ? handeKeyDown : onKeyDown} autoFocus={autoFocus} ref={refNode} + data-test-id={testId} {...props} > {icon && } diff --git a/client/components/UI/Form/TimeInput/TimeInputPopup.tsx b/client/components/UI/Form/TimeInput/TimeInputPopup.tsx index 876c5ca66..4dec41efe 100644 --- a/client/components/UI/Form/TimeInput/TimeInputPopup.tsx +++ b/client/components/UI/Form/TimeInput/TimeInputPopup.tsx @@ -180,6 +180,7 @@ export class TimeInputPopup extends React.Component { size="small" pullRight onClick={() => this.handleClear()} + testId="time-popup-clear" />