我正在为我的 react-native 项目使用 detox,它有一个使用 react-native-calendar 中的 Agenda 组件的日历组件。我希望为议程组件添加一个 testID,但似乎没有。这是我的议程代码。
<Agenda
items={this.state.items}
onDayPress={(day)=>{console.log('day pressed',day)}}
onDayChange={(day)=>{console.log('day changed')}}
pastScrollRange={50}
futureScrollRange={50}
renderItem={(item, firstItemInDay) => {return (<CalendarEvent EventID={item.EventID} navigation ={this.props.navigation}/>);}}
renderEmptyDate={() => {return (<EmptyEvent/>);}}
// specify what should be rendered instead of ActivityIndicator
//renderEmptyData = {() => {return (<EmptyEvent/>)}}
rowHasChanged={(r1, r2) => {return r1.text !== r2.text}}
// By default, agenda dates are marked if they have at least one item, but you can override this if needed
markedDates={markedDates}
theme={{
backgroundColor: '#203546',
calendarBackground: '#203546',
textSectionTitleColor: '#ffffff',
selectedDayBackgroundColor: '#203546',
selectedDayTextColor: '#ffffff',
todayTextColor: '#00adf5',
dayTextColor: '#ffffff',
textDisabledColor: '#ffffff',
dotColor: '#ffffff',
selectedDotColor: '#ffffff',
monthTextColor: '#ffffff',
textMonthFontWeight: 'bold',
textDayFontSize: 16,
textMonthFontSize: 20,
textDayHeaderFontSize: 15,
agendaDayTextColor: 'white',
agendaDayNumColor: 'white',
agendaTodayColor: '#00adf5',
agendaKnobColor: 'white'
}}/>