add first rudimentary component tests

This commit is contained in:
mahula 2025-02-14 21:42:37 +01:00
parent d632e2c5b7
commit b1b3376aee

View File

@ -26,6 +26,7 @@ describe('<TextInput />', () => {
})
it('accepts user input', () => {
mount(<TextInput dataField='test-input' />)
cy.get('input[name="test-input"]').type('Hello Test')
cy.get('input[name="test-input"]').should('have.value', 'Hello Test')
})
@ -47,10 +48,6 @@ describe('<TextInput />', () => {
cy.get('@updateFormValueSpy').should('have.been.calledWith', 'Test')
})
it('respects the required attribute', () => {
cy.get('input[name="test-input"]').should('have.attr', 'required')
})
it('accepts a specific input type', () => {
mount(<TextInput dataField='test-input' type='email' />)
cy.get('input[name="test-input"]').should('have.attr', 'type', 'email')