diff --git a/cypress/integration/other-controls.spec.ts b/cypress/integration/other-controls.spec.ts new file mode 100644 index 00000000..9684ae6c --- /dev/null +++ b/cypress/integration/other-controls.spec.ts @@ -0,0 +1,49 @@ +context('Other Controls', () => { + beforeEach(() => { + cy.$login() + cy.$mockPlayback() + cy.$shuffleSeveralSongs() + }) + + it('likes/unlikes the current song', () => { + cy.$findInTestId('other-controls [data-test=like-btn]').as('like').click() + cy.get('#queueWrapper tr.song-item:first-child [data-test=btn-like-liked]').should('be.visible') + cy.get('@like').click() + cy.get('#queueWrapper tr.song-item:first-child [data-test=btn-like-unliked]').should('be.visible') + }) + + it('toggles the info panel', () => { + cy.findByTestId('extra-panel').should('be.visible') + cy.findByTestId('toggle-extra-panel-btn').as('btn').click() + cy.findByTestId('extra-panel').should('not.be.visible') + cy.findByTestId('toggle-extra-panel-btn').as('btn').click() + cy.findByTestId('extra-panel').should('be.visible') + }) + + it('toggles the "sound bars" icon when a song is played/paused', () => { + cy.$findInTestId('other-controls [data-test=soundbars]').should('be.visible') + cy.get('body').type(' ') + cy.$assertNotPlaying() + cy.$findInTestId('other-controls [data-test=soundbars]').should('not.exist') + }) + + it('toggles the visualizer', () => { + cy.findByTestId('toggle-visualizer-btn').click() + cy.findByTestId('visualizer').should('be.visible') + cy.findByTestId('toggle-visualizer-btn').click() + cy.findByTestId('visualizer').should('not.exist') + }) + + it('toggles the equalizer', () => { + cy.findByTestId('toggle-equalizer-btn').click() + cy.findByTestId('equalizer').should('be.visible') + cy.findByTestId('toggle-equalizer-btn').click() + cy.findByTestId('equalizer').should('not.be.visible') + }) + + it('downloads the current song', () => { + cy.intercept('/download/songs').as('download') + cy.$findInTestId('other-controls [data-test=download-btn]').click() + cy.wait('@download') + }) +}) diff --git a/resources/assets b/resources/assets index 7432cc47..c60db8c8 160000 --- a/resources/assets +++ b/resources/assets @@ -1 +1 @@ -Subproject commit 7432cc47cb026c7982f6a9a61575a7449b62d95f +Subproject commit c60db8c8fcb891329172221ba57cea93a97e7bf4