1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-02-22 08:02:25 +01:00

prevent code highlighting test failure due to timeout (#4423)

This commit is contained in:
Dylan Schiemann 2021-08-07 05:46:36 -07:00 committed by GitHub
parent 1f3a489afd
commit e4e27575a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -16,20 +16,26 @@ describe('code highlighting', () => {
.should('have.css', 'color', 'rgb(153, 0, 85)')
})
it('highlights javascript syntax', () => {
const JSCode = 'const slateVar = 30;{enter}'
cy.get('select').select('JavaScript') // Select the 'JavaScript' option
it(
'highlights javascript syntax',
{
defaultCommandTimeout: 10000, // test was not passing within 4s default
},
() => {
const JSCode = 'const slateVar = 30;{enter}'
cy.get('select').select('JavaScript') // Select the 'JavaScript' option
cy.get(slateEditor)
.type('{movetostart}')
.type(JSCode) // Type JavaScript code
cy.get(slateEditor)
.type('{movetostart}')
.type(JSCode) // Type JavaScript code
cy.get(slateEditor)
.find('span')
.eq(0)
.find(leafNode)
.eq(0)
.should('contain', 'const')
.should('have.css', 'color', 'rgb(0, 119, 170)')
})
cy.get(slateEditor)
.find('span')
.eq(0)
.find(leafNode)
.eq(0)
.should('contain', 'const')
.should('have.css', 'color', 'rgb(0, 119, 170)')
}
)
})