Created
January 4, 2019 02:38
-
-
Save CodingItWrong/7128c13475a4606267cb437bd78dcc14 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { render, fireEvent } from 'react-native-testing-library'; | |
import NewMessageForm from '../../NewMessageForm'; | |
describe('NewMessageForm', () => { | |
describe('clicking send', () => { | |
const messageText = 'Hello world'; | |
let getByTestId; | |
beforeEach(() => { | |
({ getByTestId } = render(<NewMessageForm />)); | |
fireEvent.changeText(getByTestId('messageText'), messageText); | |
fireEvent.press(getByTestId('sendButton')); | |
}); | |
it('clears the message field', () => { | |
expect(getByTestId('messageText').props.value).toEqual(''); | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment