diff --git a/cypress/integration/favorites.spec.ts b/cypress/integration/favorites.spec.ts index 1b9ca92f..2176b132 100644 --- a/cypress/integration/favorites.spec.ts +++ b/cypress/integration/favorites.spec.ts @@ -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')