Skip to content

Trigger "change" event correctly #651

@bahmutov

Description

@bahmutov

Cypress 0.19.4 / 0.20.0 does not generate "change" event same way as the browser. For example in vanilla JS TodoMVC this leads to different results

// fires change event
cy.find('input').type('foo{enter}')
// does not fire change event
cy.find('input').type('foo').type('{enter}')

which shows up in this example repo bahmutov/add-todo-test#1

Good url to test http://todomvc.com/examples/vanillajs/

test

const getItems = () =>
  cy.get('.todo-list li')

it('adds 1 todo', () => {
  const url = 'http://todomvc.com/examples/vanillajs/'
  cy.visit(url)
  getItems()
    .should('have.length', 0)
  cy.get('.new-todo').type('pass this test').type('{enter}')
  getItems()
    .should('have.length', 1)
})

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions