Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Socket
Sign inDemoInstall

react-native-testing-library

Package Overview
Dependencies
Maintainers
1
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-testing-library - npm Package Compare versions

Comparing version 1.13.1 to 1.13.2

2

package.json
{
"name": "react-native-testing-library",
"version": "1.13.1",
"version": "1.13.2",
"description": "Simple React Native testing utilities helping you write better tests with less effort",

@@ -5,0 +5,0 @@ "main": "build/index.js",

@@ -39,18 +39,18 @@ <div align='center'>

import { QuestionsBoard } from '../QuestionsBoard';
import { Question } from '../Question';
function setAnswer(question, answer) {
fireEvent.changeText(question, answer);
}
test('form submits two answers', () => {
const allQuestions = ['q1', 'q2'];
const mockFn = jest.fn();
test('should verify two questions', () => {
const { getAllByA11yRole, getByText } = render(<QuestionsBoard {...props} />);
const allQuestions = getAllByA11yRole('header');
const { getAllByA11yLabel, getByText } = render(
<QuestionsBoard questions={allQuestions} onSubmit={mockFn} />
);
setAnswer(allQuestions[0], 'a1');
setAnswer(allQuestions[1], 'a2');
const answerInputs = getAllByA11yLabel('answer input');
fireEvent.press(getByText('submit'));
fireEvent.changeText(answerInputs[0], 'a1');
fireEvent.changeText(answerInputs[1], 'a2');
fireEvent.press(getByText('Submit'));
expect(props.verifyQuestions).toBeCalledWith({
expect(mockFn).toBeCalledWith({
'1': { q: 'q1', a: 'a1' },

@@ -62,2 +62,4 @@ '2': { q: 'q2', a: 'a2' },

You can find the source of `QuestionsBoard` component and this example [here](https://github.com/callstack/react-native-testing-library/blob/master/src/__tests__/questionsBoard.test.js).
## Installation

@@ -64,0 +66,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc