mirror of
https://github.com/koel/koel
synced 2024-11-10 06:34:14 +00:00
fix: footer pane integration tests
This commit is contained in:
parent
a1b5432c03
commit
56205ca375
5 changed files with 11 additions and 29 deletions
|
@ -6,17 +6,9 @@ context('Albums', { scrollBehavior: false }, () => {
|
|||
|
||||
it('loads the list of albums', () => {
|
||||
cy.get('#albumsWrapper').within(() => {
|
||||
cy.get('.screen-header')
|
||||
.should('be.visible')
|
||||
.and('contain.text', 'Albums')
|
||||
|
||||
cy.get('[data-test=view-mode-thumbnail]')
|
||||
.should('be.visible')
|
||||
.and('have.class', 'active')
|
||||
|
||||
cy.get('[data-test=view-mode-list]')
|
||||
.should('be.visible')
|
||||
.and('not.have.class', 'active')
|
||||
cy.get('.screen-header').should('be.visible').and('contain.text', 'Albums')
|
||||
cy.get('[data-test=view-mode-thumbnail]').should('be.visible').and('have.class', 'active')
|
||||
cy.get('[data-test=view-mode-list]').should('be.visible').and('not.have.class', 'active')
|
||||
cy.get('[data-test=album-card]').should('have.length', 7)
|
||||
})
|
||||
})
|
||||
|
@ -54,7 +46,7 @@ context('Albums', { scrollBehavior: false }, () => {
|
|||
})
|
||||
|
||||
cy.get('#albumWrapper').within(() => {
|
||||
cy.get('.song-item').should('have.length.at.least', 1)
|
||||
cy.$getVisibleSongRows().should('have.length.at.least', 1)
|
||||
|
||||
cy.get('.screen-header').within(() => {
|
||||
cy.findByText('Download All').should('be.visible')
|
||||
|
|
|
@ -6,17 +6,9 @@ context('Artists', { scrollBehavior: false }, () => {
|
|||
|
||||
it('loads the list of artists', () => {
|
||||
cy.get('#artistsWrapper').within(() => {
|
||||
cy.get('.screen-header')
|
||||
.should('be.visible')
|
||||
.and('contain.text', 'Artists')
|
||||
|
||||
cy.get('[data-test=view-mode-thumbnail]')
|
||||
.should('be.visible')
|
||||
.and('have.class', 'active')
|
||||
|
||||
cy.get('[data-test=view-mode-list]')
|
||||
.should('be.visible')
|
||||
.and('not.have.class', 'active')
|
||||
cy.get('.screen-header').should('be.visible').and('contain.text', 'Artists')
|
||||
cy.get('[data-test=view-mode-thumbnail]').should('be.visible').and('have.class', 'active')
|
||||
cy.get('[data-test=view-mode-list]').should('be.visible').and('not.have.class', 'active')
|
||||
cy.get('[data-test=artist-card]').should('have.length', 1)
|
||||
})
|
||||
})
|
||||
|
@ -55,7 +47,7 @@ context('Artists', { scrollBehavior: false }, () => {
|
|||
})
|
||||
|
||||
cy.get('#artistWrapper').within(() => {
|
||||
cy.get('.song-item').should('have.length.at.least', 1)
|
||||
cy.$getVisibleSongRows().should('have.length.at.least', 1)
|
||||
|
||||
cy.get('.screen-header').within(() => {
|
||||
cy.findByText('Download All').should('be.visible')
|
||||
|
|
|
@ -26,9 +26,7 @@ context('Authentication', () => {
|
|||
|
||||
cy.visit('/')
|
||||
submitLoginForm()
|
||||
cy.findByTestId('login-form')
|
||||
.should('be.visible')
|
||||
.and('have.class', 'error')
|
||||
cy.findByTestId('login-form').should('be.visible').and('have.class', 'error')
|
||||
})
|
||||
|
||||
it('logs out', () => {
|
||||
|
|
|
@ -17,7 +17,7 @@ context('Extra Information Panel', () => {
|
|||
})
|
||||
|
||||
cy.$clickSidebarItem('All Songs')
|
||||
cy.get('#songsWrapper .song-item:first-child').dblclick()
|
||||
cy.$getVisibleSongRows().first().dblclick()
|
||||
|
||||
cy.get('#extraPanelLyrics').should('be.visible').and('contain.text', 'No lyrics found.')
|
||||
cy.get('#extraPanelLyrics [data-test=add-lyrics-btn]').click()
|
||||
|
|
|
@ -5,7 +5,7 @@ context('Footer Pane', () => {
|
|||
|
||||
cy.$clickSidebarItem('All Songs')
|
||||
|
||||
cy.get('#songsWrapper .song-item:first-child').dblclick().within(function () {
|
||||
cy.$getVisibleSongRows().first().dblclick().within(function () {
|
||||
cy.get('.title').invoke('text').as('title')
|
||||
cy.get('.album').invoke('text').as('album')
|
||||
cy.get('.artist').invoke('text').as('artist')
|
||||
|
|
Loading…
Reference in a new issue