import React from 'react' import { render, fireEvent, act } from 'test-utils' import TextInput from './TextInput' test('should set correct text', () => { // We render an instance of and get a `getByDisplayValue()` helper back from it const { getByDisplayValue } = render( {}} /> ) // We expect our text box to exist: expect(getByDisplayValue('Default Text Value')).toBeTruthy() // We wrap any state changing events in act() act(() => { // We fire off a text change event on the input box fireEvent.change(getByDisplayValue('Default Text Value'), { target: { value: 'Text Changed' } }) }) // We expect our changed text box to exist: expect(getByDisplayValue('Text Changed')).toBeTruthy() }) Contáctanos – Estudia Viajando Online

Contáctanos

Nuestro amable y atento personal está a la espera de tu opinión. Por favor, haznos saber cómo podemos ayudarte.

Mensaje directo Whatsapp