mirror of
https://github.com/koel/koel
synced 2024-11-14 00:17:13 +00:00
feat(test): add missing Favorites e2e test
This commit is contained in:
parent
b93f2d2e94
commit
1c39a59449
1 changed files with 18 additions and 4 deletions
|
@ -1,7 +1,5 @@
|
|||
context('Favorites', () => {
|
||||
beforeEach(() => {
|
||||
cy.$login()
|
||||
})
|
||||
context('Favorites', { scrollBehavior: false }, () => {
|
||||
beforeEach(() => cy.$login())
|
||||
|
||||
function assertFavoriteCount (count: number) {
|
||||
cy.$clickSidebarItem('Favorites')
|
||||
|
@ -62,6 +60,22 @@ context('Favorites', () => {
|
|||
assertFavoriteCount(4)
|
||||
})
|
||||
|
||||
it('adds a favorite song from context menu', () => {
|
||||
cy.intercept('POST', '/api/interaction/like', {
|
||||
fixture: 'like.post.200.json'
|
||||
})
|
||||
|
||||
cy.$clickSidebarItem('All Songs')
|
||||
|
||||
cy.get('#songsWrapper').within(() => cy.get('tr.song-item:first-child').rightclick())
|
||||
cy.findByTestId('song-context-menu').within(() => {
|
||||
cy.findByText('Add To').click()
|
||||
cy.findByText('Favorites').click()
|
||||
})
|
||||
|
||||
assertFavoriteCount(4)
|
||||
})
|
||||
|
||||
it('deletes a favorite with Unlike button', () => {
|
||||
cy.intercept('POST', '/api/interaction/like', {})
|
||||
cy.$clickSidebarItem('Favorites')
|
||||
|
|
Loading…
Reference in a new issue