From ae9e7c1a4c5109848d9e5537e279983ca168164a Mon Sep 17 00:00:00 2001 From: KaustubhKumar05 Date: Mon, 22 Jul 2024 11:25:36 +0530 Subject: [PATCH 1/2] fix: move testid to buttons --- .../src/Prebuilt/components/AudioVideoToggle.tsx | 14 ++++---------- .../IconButtonWithOptions.tsx | 10 +++++++++- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/packages/roomkit-react/src/Prebuilt/components/AudioVideoToggle.tsx b/packages/roomkit-react/src/Prebuilt/components/AudioVideoToggle.tsx index acbbb3a20b..299da3cd4a 100644 --- a/packages/roomkit-react/src/Prebuilt/components/AudioVideoToggle.tsx +++ b/packages/roomkit-react/src/Prebuilt/components/AudioVideoToggle.tsx @@ -310,10 +310,9 @@ export const AudioVideoToggle = ({ hideOptions = false }: { hideOptions?: boolea disabled={!toggleAudio} hideOptions={hideOptions || !hasAudioDevices} onDisabledClick={toggleAudio} + testid={!isLocalAudioEnabled ? 'audio_off_btn' : 'audio_on_btn'} tooltipMessage={`Turn ${isLocalAudioEnabled ? 'off' : 'on'} audio (${isMacOS ? '⌘' : 'ctrl'} + d)`} - icon={ - !isLocalAudioEnabled ? : - } + icon={!isLocalAudioEnabled ? : } active={isLocalAudioEnabled} onClick={toggleAudio} key="toggleAudio" @@ -353,13 +352,8 @@ export const AudioVideoToggle = ({ hideOptions = false }: { hideOptions?: boolea hideOptions={hideOptions || !hasVideoDevices} onDisabledClick={toggleVideo} tooltipMessage={`Turn ${isLocalVideoEnabled ? 'off' : 'on'} video (${isMacOS ? '⌘' : 'ctrl'} + e)`} - icon={ - !isLocalVideoEnabled ? ( - - ) : ( - - ) - } + testid={!isLocalVideoEnabled ? 'video_off_btn' : 'video_on_btn'} + icon={!isLocalVideoEnabled ? : } key="toggleVideo" active={isLocalVideoEnabled} onClick={toggleVideo} diff --git a/packages/roomkit-react/src/Prebuilt/components/IconButtonWithOptions/IconButtonWithOptions.tsx b/packages/roomkit-react/src/Prebuilt/components/IconButtonWithOptions/IconButtonWithOptions.tsx index e475aaf19b..288167edea 100644 --- a/packages/roomkit-react/src/Prebuilt/components/IconButtonWithOptions/IconButtonWithOptions.tsx +++ b/packages/roomkit-react/src/Prebuilt/components/IconButtonWithOptions/IconButtonWithOptions.tsx @@ -90,6 +90,7 @@ export const IconButtonWithOptions = ({ onDisabledClick = () => { return; }, + testid = '', tooltipMessage = '', icon, children, @@ -103,6 +104,7 @@ export const IconButtonWithOptions = ({ onDisabledClick: () => void; icon: React.ReactNode; children: React.ReactNode; + testid?: string; hideOptions?: boolean; active: boolean; disabled?: boolean; @@ -111,7 +113,13 @@ export const IconButtonWithOptions = ({ const commonProps = { disabled, active }; return ( - + {icon} From 595672c8ca2e595fe820fdb18eef9ce701a5c39d Mon Sep 17 00:00:00 2001 From: KaustubhKumar05 Date: Mon, 22 Jul 2024 16:22:07 +0530 Subject: [PATCH 2/2] fix: rename button ids --- .../src/Prebuilt/components/AudioVideoToggle.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/roomkit-react/src/Prebuilt/components/AudioVideoToggle.tsx b/packages/roomkit-react/src/Prebuilt/components/AudioVideoToggle.tsx index 299da3cd4a..7beece4dc9 100644 --- a/packages/roomkit-react/src/Prebuilt/components/AudioVideoToggle.tsx +++ b/packages/roomkit-react/src/Prebuilt/components/AudioVideoToggle.tsx @@ -310,7 +310,7 @@ export const AudioVideoToggle = ({ hideOptions = false }: { hideOptions?: boolea disabled={!toggleAudio} hideOptions={hideOptions || !hasAudioDevices} onDisabledClick={toggleAudio} - testid={!isLocalAudioEnabled ? 'audio_off_btn' : 'audio_on_btn'} + testid="audio_toggle_btn" tooltipMessage={`Turn ${isLocalAudioEnabled ? 'off' : 'on'} audio (${isMacOS ? '⌘' : 'ctrl'} + d)`} icon={!isLocalAudioEnabled ? : } active={isLocalAudioEnabled} @@ -352,7 +352,7 @@ export const AudioVideoToggle = ({ hideOptions = false }: { hideOptions?: boolea hideOptions={hideOptions || !hasVideoDevices} onDisabledClick={toggleVideo} tooltipMessage={`Turn ${isLocalVideoEnabled ? 'off' : 'on'} video (${isMacOS ? '⌘' : 'ctrl'} + e)`} - testid={!isLocalVideoEnabled ? 'video_off_btn' : 'video_on_btn'} + testid="video_toggle_btn" icon={!isLocalVideoEnabled ? : } key="toggleVideo" active={isLocalVideoEnabled}