From 0eb6173dc39ac482976af486d2b6095deda86a40 Mon Sep 17 00:00:00 2001 From: Phan An Date: Tue, 5 Jan 2021 00:05:46 +0100 Subject: [PATCH] feat(test): add tests for middle pane --- cypress/integration/footer-pane.spec.ts | 37 +++++++++++++++++++++++++ resources/assets | 2 +- 2 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 cypress/integration/footer-pane.spec.ts diff --git a/cypress/integration/footer-pane.spec.ts b/cypress/integration/footer-pane.spec.ts new file mode 100644 index 00000000..a8ec37c5 --- /dev/null +++ b/cypress/integration/footer-pane.spec.ts @@ -0,0 +1,37 @@ +context('Footer Pane', () => { + beforeEach(() => { + cy.$login() + cy.$mockPlayback() + + cy.$clickSidebarItem('All Songs') + + cy.get('#songsWrapper tr.song-item:first-child').dblclick().within(function () { + cy.get('.title').invoke('text').as('title') + cy.get('.album').invoke('text').as('album') + cy.get('.artist').invoke('text').as('artist') + }) + }) + + it('displays current song information', () => { + cy.findByTestId('footer-middle-pane').within(function () { + cy.get('.title').should('have.text', this.title) + cy.get('.album').should('have.text', this.album) + cy.get('.artist').should('have.text', this.artist) + }) + }) + + it('invokes artist screen', () => { + cy.findByTestId('footer-middle-pane').within(() => cy.get('.artist').click()) + cy.get('#artistWrapper').should('be.visible') + }) + + it('invokes album screen', () => { + cy.findByTestId('footer-middle-pane').within(() => cy.get('.album').click()) + cy.get('#albumWrapper').should('be.visible') + }) + + it('has a context menu for the current song', () => { + cy.get('#mainFooter').rightclick() + cy.findByTestId('song-context-menu').should('be.visible') + }) +}) diff --git a/resources/assets b/resources/assets index 5fbb3c4e..f7fd14f3 160000 --- a/resources/assets +++ b/resources/assets @@ -1 +1 @@ -Subproject commit 5fbb3c4e491a211d3ee1c0769e1309f4b1be5444 +Subproject commit f7fd14f34d00113768609ea028aac41dcb702ee0