chore(test): remove redundant time calls

This commit is contained in:
Phan An 2020-12-31 09:47:51 +01:00
parent 524a4b7039
commit 29953e45dd
2 changed files with 1 additions and 17 deletions

View file

@ -29,7 +29,7 @@ context('Playlists', () => {
})
})
it('deletes a playlist', () => {
it('deletes a playlist', async () => {
cy.intercept('GET', '/api/playlist/1/songs', {
fixture: 'playlist-songs.get.200.json'
})
@ -37,7 +37,6 @@ context('Playlists', () => {
cy.intercept('DELETE', '/api/playlist/1', {})
cy.$login()
cy.clock()
cy.get('#sidebar')
.findByText('Simple Playlist')
@ -63,12 +62,9 @@ context('Playlists', () => {
})
cy.$login()
cy.clock()
cy.findByTestId('sidebar-create-playlist-btn')
.click()
cy.tick(1)
cy.findByTestId('playlist-context-menu-create-simple')
.click()
@ -80,8 +76,6 @@ context('Playlists', () => {
.clear()
.type('A New Playlist{enter}')
cy.tick(50)
cy.get('#sidebar')
.findByText('A New Playlist')
.should('exist')
@ -105,10 +99,6 @@ context('Playlists', () => {
fixture: 'playlist-songs.get.200.json'
})
cy.clock()
cy.$login()
cy.tick(1)
cy.get('#sidebar')
.findByText('Simple Playlist')
.as('menuItem')
@ -122,8 +112,6 @@ context('Playlists', () => {
.clear()
.type('A New Name{enter}')
cy.tick(50)
cy.get('@menuItem')
.should('contain', 'A New Name')
.and('have.class', 'active')
@ -131,8 +119,6 @@ context('Playlists', () => {
cy.findByText('Updated playlist "A New Name".')
.should('be.visible')
cy.tick(50)
cy.get('#playlistWrapper .heading-wrapper')
.should('be.visible')
.and('contain', 'A New Name')

View file

@ -21,8 +21,6 @@ Cypress.Commands.add('$each', (dataset: Array<Array<any>>, callback: Function) =
})
Cypress.Commands.add('$confirm', () => {
cy.clock()
cy.tick(100) // wait for the alert to show up
cy.get('.alertify .ok')
.click()
})