fix: footer pane integration tests

This commit is contained in:
Phan An 2022-04-26 15:54:03 +03:00
parent a1b5432c03
commit 56205ca375
No known key found for this signature in database
GPG key ID: A81E4477F0BB6FDC
5 changed files with 11 additions and 29 deletions

View file

@ -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')

View file

@ -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')

View file

@ -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', () => {

View file

@ -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()

View file

@ -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')