test: added first tests for examples

This commit is contained in:
Dominik Biedebach
2022-05-10 19:38:10 +02:00
committed by Dominik
parent 3a3eb5311c
commit 229936dd3b
9 changed files with 182 additions and 10 deletions

View File

@@ -1,7 +1,24 @@
context('/src/Examples/CollaborativeEditing/Vue/', () => {
before(() => {
beforeEach(() => {
cy.visit('/src/Examples/CollaborativeEditing/Vue/')
})
// TODO: Write tests
it('should show the current room with participants', () => {
cy.get('.editor__status').then(status => {
status.should('contain', 'rooms.')
status.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.get('.editor__name').should('contain', 'John Doe')
})
})
})