0f4e6fa3f2
Co-authored-by: kolaente <k@knt.li> Reviewed-on: https://kolaente.dev/vikunja/frontend/pulls/2015 Co-authored-by: renovate <renovatebot@kolaente.de> Co-committed-by: renovate <renovatebot@kolaente.de>
56 lines
No EOL
1.6 KiB
JavaScript
56 lines
No EOL
1.6 KiB
JavaScript
import {ListFactory} from '../../factories/list'
|
|
|
|
import '../../support/authenticateUser'
|
|
import {prepareLists} from './prepareLists'
|
|
|
|
describe('List History', () => {
|
|
prepareLists()
|
|
|
|
it('should show a list history on the home page', () => {
|
|
cy.intercept(Cypress.env('API_URL') + '/namespaces*').as('loadNamespaces')
|
|
cy.intercept(Cypress.env('API_URL') + '/lists/*').as('loadList')
|
|
|
|
const lists = ListFactory.create(6)
|
|
|
|
cy.visit('/')
|
|
cy.wait('@loadNamespaces')
|
|
cy.get('body')
|
|
.should('not.contain', 'Last viewed')
|
|
|
|
cy.visit(`/lists/${lists[0].id}`)
|
|
cy.wait('@loadNamespaces')
|
|
cy.wait('@loadList')
|
|
cy.visit(`/lists/${lists[1].id}`)
|
|
cy.wait('@loadNamespaces')
|
|
cy.wait('@loadList')
|
|
cy.visit(`/lists/${lists[2].id}`)
|
|
cy.wait('@loadNamespaces')
|
|
cy.wait('@loadList')
|
|
cy.visit(`/lists/${lists[3].id}`)
|
|
cy.wait('@loadNamespaces')
|
|
cy.wait('@loadList')
|
|
cy.visit(`/lists/${lists[4].id}`)
|
|
cy.wait('@loadNamespaces')
|
|
cy.wait('@loadList')
|
|
cy.visit(`/lists/${lists[5].id}`)
|
|
cy.wait('@loadNamespaces')
|
|
cy.wait('@loadList')
|
|
|
|
// cy.visit('/')
|
|
// cy.wait('@loadNamespaces')
|
|
// Not using cy.visit here to work around the redirect issue fixed in #1337
|
|
cy.get('nav.menu.top-menu a')
|
|
.contains('Overview')
|
|
.click()
|
|
|
|
cy.get('body')
|
|
.should('contain', 'Last viewed')
|
|
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)
|
|
})
|
|
}) |