mirror of
https://github.com/utopia-os/utopia-ui.git
synced 2025-12-13 07:46:10 +00:00
add first rudimentary component tests
This commit is contained in:
parent
d632e2c5b7
commit
b1b3376aee
@ -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')
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user