koel/cypress/integration/home.spec.ts
2021-01-01 14:31:53 +01:00

31 lines
771 B
TypeScript

context('Home Screen', () => {
beforeEach(() => {
cy.clock()
cy.$login()
cy.tick(0)
})
it('renders', () => {
cy.get('.screen-header').should('be.visible')
cy.$each([
['.top-song-list', 3],
['.recent-song-list', 7],
['.recently-added-album-list', 6],
['.recently-added-song-list', 10],
['.top-artist-list', 1],
['.top-album-list', 3]
], (selector: string, itemCount: number) => {
cy.get(selector)
.should('exist')
.find('li')
.should('have.length', itemCount)
})
})
it('has a link to view all recently-played songs', () => {
cy.findByTestId('home-view-all-recently-played-btn')
.click()
.url()
.should('contain', '/#!/recently-played')
})
})