Add further testid tags

This commit is contained in:
Michael Kaye
2023-08-30 16:01:28 +01:00
parent f471a34c50
commit b546f711d0
3 changed files with 7 additions and 2 deletions

View File

@@ -408,7 +408,7 @@ export function InCallView({
/> />
); );
} }
buttons.push(<SettingsButton key="4" onPress={openSettings} />); buttons.push(<SettingsButton key="4" onPress={openSettings} data-testid="incall_settings" />);
} }
buttons.push( buttons.push(

View File

@@ -124,6 +124,7 @@ export const SettingsModal = (props: Props) => {
const audioTab = ( const audioTab = (
<TabItem <TabItem
key="audio" key="audio"
data-testid="settings_audio"
title={ title={
<> <>
<AudioIcon width={16} height={16} /> <AudioIcon width={16} height={16} />
@@ -139,6 +140,7 @@ export const SettingsModal = (props: Props) => {
const videoTab = ( const videoTab = (
<TabItem <TabItem
key="video" key="video"
data-testid="settings_video"
title={ title={
<> <>
<VideoIcon width={16} height={16} /> <VideoIcon width={16} height={16} />
@@ -153,6 +155,7 @@ export const SettingsModal = (props: Props) => {
const profileTab = ( const profileTab = (
<TabItem <TabItem
key="profile" key="profile"
data-testid="settings_profile"
title={ title={
<> <>
<UserIcon width={15} height={15} /> <UserIcon width={15} height={15} />
@@ -167,6 +170,7 @@ export const SettingsModal = (props: Props) => {
const feedbackTab = ( const feedbackTab = (
<TabItem <TabItem
key="feedback" key="feedback"
data-testid="settings_feedback"
title={ title={
<> <>
<FeedbackIcon width={16} height={16} /> <FeedbackIcon width={16} height={16} />

View File

@@ -55,11 +55,12 @@ function Tab<T>({ item, state }: TabProps<T>): JSX.Element {
const { key, rendered } = item; const { key, rendered } = item;
const ref = useRef<HTMLLIElement>(null); const ref = useRef<HTMLLIElement>(null);
const { tabProps } = useTab({ key }, state, ref); const { tabProps } = useTab({ key }, state, ref);
const testid = "tab_" + key;
return ( return (
<li <li
{...tabProps} {...tabProps}
ref={ref} ref={ref}
data-testid={testid}
className={classNames(styles.tab, { className={classNames(styles.tab, {
[styles.selected]: state.selectedKey === key, [styles.selected]: state.selectedKey === key,
[styles.disabled]: state.disabledKeys.has(key), [styles.disabled]: state.disabledKeys.has(key),