Skip to content

Commit

Permalink
add new tests
Browse files Browse the repository at this point in the history
  • Loading branch information
smastrom committed Dec 10, 2023
1 parent a04649d commit e0b555b
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions tests/Email.cy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,32 @@ it('Should focus and update input value if pressing alphanumeric chars from a su
})
})

it('Should focus and update input value if pressing @ from a suggestion', () => {
cy.mount(<Email refineList={domains} />)

cy.withinRoot(() => {
cy.get('input').type('myusern')
cy.get('li').then((list) => {
cy.downArrow(getRandomIndex(list.length))
cy.realType('@gm')
cy.get('input').should('have.focus').and('have.value', 'myusern@gm')
})
})
})

it('Should focus and update input value if pressing . from a suggestion', () => {
cy.mount(<Email refineList={domains} />)

cy.withinRoot(() => {
cy.get('input').type('myusern')
cy.get('li').then((list) => {
cy.downArrow(getRandomIndex(list.length))
cy.realType('.')
cy.get('input').should('have.focus').and('have.value', 'myusern.')
})
})
})

it('Should focus and update input value if pressing backspace on a suggestion', () => {
cy.mount(<Email refineList={domains} />)

Expand Down

0 comments on commit e0b555b

Please sign in to comment.