May 2019
Intermediate to advanced
496 pages
10h 38m
English
Let's render an HTML text input field onto the page. Add the following test to test/CustomerForm.test.js:
it('renders the first name field as a text box', () => { render(<CustomerForm />); const field = form('customer').elements.firstName; expect(field).not.toBeNull(); expect(field.tagName).toEqual('INPUT'); expect(field.type).toEqual('text');});
There are three expectations in this test:
Read now
Unlock full access