2021-01-04 19:09:18 +00:00
|
|
|
context('Other Controls', () => {
|
|
|
|
beforeEach(() => {
|
|
|
|
cy.$login()
|
|
|
|
cy.$mockPlayback()
|
|
|
|
cy.$shuffleSeveralSongs()
|
|
|
|
})
|
|
|
|
|
|
|
|
it('likes/unlikes the current song', () => {
|
2022-05-09 13:04:24 +00:00
|
|
|
cy.$findInTestId('other-controls [data-testid=like-btn]').as('like').click()
|
|
|
|
cy.get('#queueWrapper .song-item:first-child [data-testid=btn-like-liked]').should('be.visible')
|
2021-01-04 19:09:18 +00:00
|
|
|
cy.get('@like').click()
|
2022-05-09 13:04:24 +00:00
|
|
|
cy.get('#queueWrapper .song-item:first-child [data-testid=btn-like-unliked]').should('be.visible')
|
2021-01-04 19:09:18 +00:00
|
|
|
})
|
|
|
|
|
|
|
|
it('toggles the info panel', () => {
|
2022-12-15 16:31:52 +00:00
|
|
|
cy.findByTestId('extra-drawer').should('be.visible')
|
|
|
|
cy.findByTestId('toggle-extra-drawer-btn').as('btn').click()
|
|
|
|
cy.findByTestId('extra-drawer').should('not.be.visible')
|
|
|
|
cy.findByTestId('toggle-extra-drawer-btn').as('btn').click()
|
|
|
|
cy.findByTestId('extra-drawer').should('be.visible')
|
2021-01-04 19:09:18 +00:00
|
|
|
})
|
|
|
|
|
|
|
|
it('toggles the "sound bars" icon when a song is played/paused', () => {
|
2022-05-10 23:01:48 +00:00
|
|
|
cy.$findInTestId('other-controls [data-testid=soundbars]').should('be.visible')
|
2021-01-04 19:09:18 +00:00
|
|
|
cy.get('body').type(' ')
|
|
|
|
cy.$assertNotPlaying()
|
2022-05-10 23:01:48 +00:00
|
|
|
cy.$findInTestId('other-controls [data-testid=soundbars]').should('not.exist')
|
2021-01-04 19:09:18 +00:00
|
|
|
})
|
|
|
|
|
|
|
|
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')
|
|
|
|
})
|
|
|
|
})
|