mirror of
https://github.com/koel/koel
synced 2024-11-28 06:50:27 +00:00
feat(test): add e2e tests for Extra panel
This commit is contained in:
parent
7b8c8f4584
commit
f7adf75929
2 changed files with 53 additions and 1 deletions
52
cypress/integration/extra-panel.spec.ts
Normal file
52
cypress/integration/extra-panel.spec.ts
Normal file
|
@ -0,0 +1,52 @@
|
||||||
|
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', () => {
|
||||||
|
cy.fixture('info.get.200.json').then(data => {
|
||||||
|
data.lyrics = null
|
||||||
|
|
||||||
|
cy.intercept('GET', '/api/**/info', {
|
||||||
|
statusCode: 200,
|
||||||
|
body: data
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
cy.$shuffleSeveralSongs()
|
||||||
|
cy.get('#extraPanelLyrics').should('be.visible').and('contain.text', 'No lyrics found.')
|
||||||
|
cy.get('#extraPanelLyrics [data-test=add-lyrics-btn]').click()
|
||||||
|
cy.findByTestId('edit-song-form').should('be.visible').within(() => {
|
||||||
|
cy.get('[name=lyrics]').should('have.focus')
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
it('displays the band information', () => {
|
||||||
|
cy.$shuffleSeveralSongs()
|
||||||
|
cy.get('#extraTabArtist').click()
|
||||||
|
cy.get('#extraPanelArtist').should('be.visible').within(() => {
|
||||||
|
cy.get('[data-test=artist-info]').should('be.visible')
|
||||||
|
cy.findByText('Artist summary').should('be.visible')
|
||||||
|
cy.get('[data-test=more-btn]').click()
|
||||||
|
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(() => {
|
||||||
|
cy.get('[data-test=album-info]').should('be.visible')
|
||||||
|
cy.findByText('Album summary').should('be.visible')
|
||||||
|
cy.get('[data-test=more-btn]').click()
|
||||||
|
cy.findByText('Album summary').should('not.exist')
|
||||||
|
cy.findByText('Album full wiki').should('be.visible')
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
// YouTube spec has been handled by youtube.spec.ts
|
||||||
|
})
|
|
@ -1 +1 @@
|
||||||
Subproject commit c60db8c8fcb891329172221ba57cea93a97e7bf4
|
Subproject commit e7f951dcd3994551d691560455df2bfd08e9f74d
|
Loading…
Reference in a new issue