2021-01-04 19:55:08 +00:00
|
|
|
context('Extra Information Panel', () => {
|
|
|
|
beforeEach(() => cy.$login())
|
|
|
|
|
|
|
|
it('displays the lyrics as the default panel', () => {
|
|
|
|
cy.$shuffleSeveralSongs()
|
|
|
|
cy.get('#extraPanelLyrics').should('be.visible').and('contain.text', 'Sample song lyrics')
|
|
|
|
})
|
|
|
|
|
|
|
|
it('displays an option to add lyrics if blank', () => {
|
2022-04-26 09:46:31 +00:00
|
|
|
cy.fixture('song-info.get.200.json').then(data => {
|
2021-01-04 19:55:08 +00:00
|
|
|
data.lyrics = null
|
|
|
|
|
2022-04-26 11:32:13 +00:00
|
|
|
cy.intercept('/api/**/info', {
|
2021-01-04 19:55:08 +00:00
|
|
|
statusCode: 200,
|
|
|
|
body: data
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
2021-05-23 11:42:18 +00:00
|
|
|
cy.$clickSidebarItem('All Songs')
|
2022-04-27 21:43:00 +00:00
|
|
|
cy.$getSongRows().first().dblclick()
|
2021-05-23 11:42:18 +00:00
|
|
|
|
2021-01-04 19:55:08 +00:00
|
|
|
cy.get('#extraPanelLyrics').should('be.visible').and('contain.text', 'No lyrics found.')
|
2022-05-10 23:01:48 +00:00
|
|
|
cy.findByTestId('add-lyrics-btn').click()
|
2021-01-04 19:55:08 +00:00
|
|
|
cy.findByTestId('edit-song-form').should('be.visible').within(() => {
|
|
|
|
cy.get('[name=lyrics]').should('have.focus')
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
2022-04-26 09:46:31 +00:00
|
|
|
it('displays the artist information', () => {
|
2021-01-04 19:55:08 +00:00
|
|
|
cy.$shuffleSeveralSongs()
|
|
|
|
cy.get('#extraTabArtist').click()
|
|
|
|
cy.get('#extraPanelArtist').should('be.visible').within(() => {
|
2022-05-10 23:01:48 +00:00
|
|
|
cy.findByTestId('artist-info').should('be.visible')
|
2021-01-04 19:55:08 +00:00
|
|
|
cy.findByText('Artist summary').should('be.visible')
|
2022-05-03 16:51:59 +00:00
|
|
|
cy.findByTestId('more-btn').click()
|
2021-01-04 19:55:08 +00:00
|
|
|
cy.findByText('Artist summary').should('not.exist')
|
|
|
|
cy.findByText('Artist full bio').should('be.visible')
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
it('displays the album information', () => {
|
|
|
|
cy.$shuffleSeveralSongs()
|
|
|
|
cy.get('#extraTabAlbum').click()
|
|
|
|
cy.get('#extraPanelAlbum').should('be.visible').within(() => {
|
2022-05-10 23:01:48 +00:00
|
|
|
cy.findByTestId('album-info').should('be.visible')
|
2021-01-04 19:55:08 +00:00
|
|
|
cy.findByText('Album summary').should('be.visible')
|
2022-05-03 16:51:59 +00:00
|
|
|
cy.findByTestId('more-btn').click()
|
2021-01-04 19:55:08 +00:00
|
|
|
cy.findByText('Album summary').should('not.exist')
|
|
|
|
cy.findByText('Album full wiki').should('be.visible')
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
// YouTube spec has been handled by youtube.spec.ts
|
|
|
|
})
|