mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-11-24 03:31:47 +08:00
test: fix broken tests & change inactive time for cypress
This commit is contained in:
parent
7d25030e80
commit
483468df66
@ -4,19 +4,17 @@ context('/src/Examples/CollaborativeEditing/React/', () => {
|
||||
})
|
||||
|
||||
it('should show the current room with participants', () => {
|
||||
cy.get('.editor__status').then(status => {
|
||||
status.should('contain', 'rooms.')
|
||||
status.should('contain', 'users online')
|
||||
})
|
||||
cy.wait(3000)
|
||||
cy.get('.editor__status')
|
||||
.should('contain', 'rooms.')
|
||||
.should('contain', 'users online')
|
||||
})
|
||||
|
||||
it('should allow user to change name', () => {
|
||||
cy.window().then(win => {
|
||||
cy.wait(5000)
|
||||
|
||||
cy.stub(win, 'prompt').returns('John Doe')
|
||||
cy.get('.editor__name > button').click()
|
||||
cy.wait(1000)
|
||||
cy.wait(3000)
|
||||
cy.get('.editor__name').should('contain', 'John Doe')
|
||||
})
|
||||
|
||||
|
@ -4,21 +4,18 @@ context('/src/Examples/CollaborativeEditing/Vue/', () => {
|
||||
})
|
||||
|
||||
it('should show the current room with participants', () => {
|
||||
cy.get('.editor__status').then(status => {
|
||||
status.should('contain', 'rooms.')
|
||||
status.should('contain', 'users online')
|
||||
})
|
||||
cy.wait(3000)
|
||||
cy.get('.editor__status')
|
||||
.should('contain', 'rooms.')
|
||||
.should('contain', 'users online')
|
||||
})
|
||||
|
||||
it('should allow user to change name', () => {
|
||||
cy.window().then(win => {
|
||||
cy.wait(5000)
|
||||
|
||||
cy.stub(win, 'prompt').returns('John Doe')
|
||||
cy.get('.editor__name > button').click()
|
||||
cy.wait(1000)
|
||||
cy.wait(3000)
|
||||
cy.get('.editor__name').should('contain', 'John Doe')
|
||||
})
|
||||
|
||||
})
|
||||
})
|
||||
|
@ -3,7 +3,6 @@ context('/src/Examples/Images/React/', () => {
|
||||
cy.visit('/src/Examples/Images/React/')
|
||||
})
|
||||
|
||||
// TODO: Write tests
|
||||
it('finds image elements inside editor', () => {
|
||||
cy.get('.ProseMirror img').should('have.length', 2)
|
||||
})
|
||||
@ -19,6 +18,7 @@ context('/src/Examples/Images/React/', () => {
|
||||
cy.window().then(win => {
|
||||
cy.stub(win, 'prompt').returns('https://unsplash.it/250/250')
|
||||
|
||||
cy.wait(1000)
|
||||
cy.get('button').contains('add image from URL').click()
|
||||
cy.wait(1000)
|
||||
cy.get('.ProseMirror img').should('have.length', 3)
|
||||
|
@ -19,6 +19,7 @@ context('/src/Examples/Images/Vue/', () => {
|
||||
cy.window().then(win => {
|
||||
cy.stub(win, 'prompt').returns('https://unsplash.it/250/250')
|
||||
|
||||
cy.wait(1000)
|
||||
cy.get('button').contains('add image from URL').click()
|
||||
cy.wait(1000)
|
||||
cy.get('.ProseMirror img').should('have.length', 3)
|
||||
|
@ -39,8 +39,10 @@ context('/src/Experiments/CollaborationAnnotation/Vue/', () => {
|
||||
|
||||
cy.get('.editor-1 .ProseMirror').type('{selectall}{backspace}Hello world{selectall}')
|
||||
cy.get('button').contains('comment').eq(0).click()
|
||||
cy.wait(1000)
|
||||
cy.get('.comment').should('exist').contains('This is a test comment')
|
||||
cy.get('button').contains('update').click()
|
||||
cy.wait(1000)
|
||||
cy.get('.comment').should('exist').contains('This is the new comment')
|
||||
})
|
||||
})
|
||||
@ -51,9 +53,11 @@ context('/src/Experiments/CollaborationAnnotation/Vue/', () => {
|
||||
|
||||
cy.get('.editor-1 .ProseMirror').type('{selectall}{backspace}Hello world{selectall}')
|
||||
cy.get('button').contains('comment').eq(0).click()
|
||||
cy.wait(1000)
|
||||
cy.get('.comment').should('exist').contains('This is a test comment')
|
||||
cy.get('button').contains('remove').click()
|
||||
cy.get('.ProseMirror .annotation').should('not.exist')
|
||||
cy.wait(1000)
|
||||
cy.get('.comment').should('not.exist')
|
||||
})
|
||||
})
|
||||
|
@ -2,5 +2,5 @@
|
||||
"baseUrl": "http://localhost:3000",
|
||||
"integrationFolder": "../",
|
||||
"testFiles": "{demos,tests}/**/*.spec.{js,ts}",
|
||||
"defaultCommandTimeout": 50000
|
||||
"defaultCommandTimeout": 5000
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user