vikunja-frontend/cypress/integration/list/list-history.spec.js

43 lines
1.2 KiB
JavaScript
Raw Normal View History

2021-11-17 18:11:19 +01:00
import {ListFactory} from '../../factories/list'
import '../../support/authenticateUser'
describe('List History', () => {
it('should show a list history on the home page', () => {
cy.intercept(Cypress.env('API_URL') + '/namespaces*').as('loadNamespaces')
2021-11-17 18:11:19 +01:00
const lists = ListFactory.create(6)
cy.visit('/')
cy.wait('@loadNamespaces')
cy.get('body')
.should('not.contain', 'Last viewed')
2021-11-17 18:11:19 +01:00
cy.visit(`/lists/${lists[0].id}`)
cy.wait('@loadNamespaces')
2021-11-17 18:11:19 +01:00
cy.visit(`/lists/${lists[1].id}`)
cy.wait('@loadNamespaces')
2021-11-17 18:11:19 +01:00
cy.visit(`/lists/${lists[2].id}`)
cy.wait('@loadNamespaces')
2021-11-17 18:11:19 +01:00
cy.visit(`/lists/${lists[3].id}`)
cy.wait('@loadNamespaces')
2021-11-17 18:11:19 +01:00
cy.visit(`/lists/${lists[4].id}`)
cy.wait('@loadNamespaces')
2021-11-17 18:11:19 +01:00
cy.visit(`/lists/${lists[5].id}`)
cy.wait('@loadNamespaces')
2021-11-17 18:11:19 +01:00
cy.visit('/')
cy.wait('@loadNamespaces')
2021-11-17 18:11:19 +01:00
cy.get('h3')
.contains('Last viewed')
.should('exist')
cy.get('.list-cards-wrapper-2-rows')
.should('not.contain', lists[0].title)
.should('contain', lists[1].title)
.should('contain', lists[2].title)
.should('contain', lists[3].title)
.should('contain', lists[4].title)
.should('contain', lists[5].title)
})
})