mirror of
https://github.com/callstack/react-native-testing-library.git
synced 2026-09-18 23:09:04 +08:00
chore(docs): improve examples to use better APIs
This commit is contained in:
@@ -44,8 +44,8 @@ function setAnswer(question, answer) {
|
||||
}
|
||||
|
||||
test('should verify two questions', () => {
|
||||
const { getAllByType, getByText } = render(<QuestionsBoard {...props} />);
|
||||
const allQuestions = getAllByType(Question);
|
||||
const { getAllByA11yRole, getByText } = render(<QuestionsBoard {...props} />);
|
||||
const allQuestions = getAllByA11yRole('header');
|
||||
|
||||
setAnswer(allQuestions[0], 'a1');
|
||||
setAnswer(allQuestions[1], 'a2');
|
||||
|
||||
Reference in New Issue
Block a user