I'm a fresher and got a task of writing unit test for the following component. The problem is there are multiple props and some condition as well based on which I need to show the toggle.I am not understanding how to test that? Whether by passing dummy data or how?
type myProps = {disabled?: boolean,title?: string,onClick: () => void | Promise<void>,icon?: string,text?: string,icon2?: string,toggleButton?: boolean,value?: boolean,onValueChange?: boolean,thumbColor?: string,trackColor?: string,};export const myList = ({disabled = false,title,onClick,icon1,text,icon2,toggleButton,value = false,onValueChange = false,thumbColor,trackColor,}: myProps) => {return (<ListItem onPress={onClick} disabled={disabled}> {leftIcon && (<Icon name={icon1} color={lightGray} style={styles.itemLeftIcon} size={IconSize} /> )}<ListItem.Content><ListItem.Title>{title}</ListItem.Title></ListItem.Content> {toggleButton ? (<Switch value={value} onValueChange={onValueChange} thumbColor={thumbColor} trackColor={trackColor} disabled={disabled} /> ) : (<Text style={styles.itemRightText} numberOfLines={2} ellipsizeMode={'tail'}> {text}</Text> )} {icon2 && (<Icon name={icon2} color={lightGray} style={styles.itemRightIcon} size= {IconSize} /> )}</ListItem>);};