Skip to content

Commit

Permalink
Fix cypress test
Browse files Browse the repository at this point in the history
  • Loading branch information
EmiM committed Oct 19, 2023
1 parent e72af01 commit 3b60c01
Showing 1 changed file with 7 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,13 @@ describe('Scroll behavior test', () => {

it('scroll should be at the bottom after entering channel', () => {
cy.get(channelContent).compareSnapshot('after launch', {
capture: 'fullPage'
capture: 'fullPage',
})
})

it('scroll should be at the bottom after sending messages', () => {
cy.get(messageInput).focus().type('luke where are you?').type('{enter}')
cy.get(messageInput)
.focus()
.type('you underestimate the power of the force')
.type('{enter}')
cy.get(messageInput).focus().type('you underestimate the power of the force').type('{enter}')
cy.get(channelContent).compareSnapshot('send after enter')
})

Expand All @@ -62,10 +59,7 @@ describe('Scroll behavior test', () => {
cy.get(channelContent).compareSnapshot('scroll to the middle')

cy.get(messageInput).focus().type('obi wan was wrong').type('{enter}')
cy.get(messageInput)
.focus()
.type('actually, he is on the dark side')
.type('{enter}')
cy.get(messageInput).focus().type('actually, he is on the dark side').type('{enter}')

cy.get(channelContent).compareSnapshot('send after scroll')
})
Expand All @@ -91,15 +85,15 @@ describe('Scroll behavior test', () => {
it('PageUp keydown should scroll message list up.', () => {
cy.get(messageInput).focus().type('{pageup}')
cy.get(channelContent).compareSnapshot('after pageup', {
capture: 'fullPage'
capture: 'fullPage',
})
})

it('PageDown keydown should scroll message list down.', () => {
cy.get(channelContent).scrollTo(0, 0)
cy.get(messageInput).focus().type('{pagedown}')
cy.get(channelContent).compareSnapshot('after pagedown', {
capture: 'fullPage'
capture: 'fullPage',
})
})

Expand All @@ -109,7 +103,7 @@ describe('Scroll behavior test', () => {
.type('luke where are you?')
.type('{shift+enter}')
.type('you underestimate the power of the force')
.should('have.text', 'luke where are you?you underestimate the power of the force')
.should('have.text', 'luke where are you?\nyou underestimate the power of the force')
})

it('Check words wrapping in message input', () => {
Expand All @@ -120,9 +114,7 @@ describe('Scroll behavior test', () => {
}
return word
}
cy.get(messageInput)
.focus()
.type(longWord())
cy.get(messageInput).focus().type(longWord())

cy.get(messageInput).compareSnapshot('message input words wrapping')
})
Expand Down

0 comments on commit 3b60c01

Please sign in to comment.