2021-11-17 18:11:19 +01:00
|
|
|
import {ListFactory} from '../../factories/list'
|
|
|
|
|
|
|
|
import '../../support/authenticateUser'
|
2022-01-30 22:51:29 +01:00
|
|
|
import {prepareLists} from './prepareLists'
|
2021-11-17 18:11:19 +01:00
|
|
|
|
2022-01-30 22:51:29 +01:00
|
|
|
describe('List History', () => {
|
|
|
|
prepareLists()
|
|
|
|
|
2021-11-17 18:11:19 +01:00
|
|
|
it('should show a list history on the home page', () => {
|
2022-01-30 13:07:08 +01:00
|
|
|
cy.intercept(Cypress.env('API_URL') + '/namespaces*').as('loadNamespaces')
|
2022-01-30 14:10:46 +01:00
|
|
|
cy.intercept(Cypress.env('API_URL') + '/lists/*').as('loadList')
|
2022-01-30 13:07:08 +01:00
|
|
|
|
2021-11-17 18:11:19 +01:00
|
|
|
const lists = ListFactory.create(6)
|
|
|
|
|
|
|
|
cy.visit('/')
|
2022-01-30 14:00:14 +01:00
|
|
|
cy.wait('@loadNamespaces')
|
2022-01-30 14:03:50 +01:00
|
|
|
cy.get('body')
|
|
|
|
.should('not.contain', 'Last viewed')
|
2021-11-17 18:11:19 +01:00
|
|
|
|
|
|
|
cy.visit(`/lists/${lists[0].id}`)
|
2022-01-30 13:07:08 +01:00
|
|
|
cy.wait('@loadNamespaces')
|
2022-01-30 14:10:46 +01:00
|
|
|
cy.wait('@loadList')
|
2021-11-17 18:11:19 +01:00
|
|
|
cy.visit(`/lists/${lists[1].id}`)
|
2022-01-30 13:07:08 +01:00
|
|
|
cy.wait('@loadNamespaces')
|
2022-01-30 14:10:46 +01:00
|
|
|
cy.wait('@loadList')
|
2021-11-17 18:11:19 +01:00
|
|
|
cy.visit(`/lists/${lists[2].id}`)
|
2022-01-30 13:07:08 +01:00
|
|
|
cy.wait('@loadNamespaces')
|
2022-01-30 14:10:46 +01:00
|
|
|
cy.wait('@loadList')
|
2021-11-17 18:11:19 +01:00
|
|
|
cy.visit(`/lists/${lists[3].id}`)
|
2022-01-30 13:07:08 +01:00
|
|
|
cy.wait('@loadNamespaces')
|
2022-01-30 14:10:46 +01:00
|
|
|
cy.wait('@loadList')
|
2021-11-17 18:11:19 +01:00
|
|
|
cy.visit(`/lists/${lists[4].id}`)
|
2022-01-30 13:07:08 +01:00
|
|
|
cy.wait('@loadNamespaces')
|
2022-01-30 14:10:46 +01:00
|
|
|
cy.wait('@loadList')
|
2021-11-17 18:11:19 +01:00
|
|
|
cy.visit(`/lists/${lists[5].id}`)
|
2022-01-30 13:07:08 +01:00
|
|
|
cy.wait('@loadNamespaces')
|
2022-01-30 14:10:46 +01:00
|
|
|
cy.wait('@loadList')
|
2021-11-17 18:11:19 +01:00
|
|
|
|
2022-01-30 15:25:34 +01:00
|
|
|
// 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()
|
2022-01-30 13:07:08 +01:00
|
|
|
|
2022-01-30 14:37:41 +01:00
|
|
|
cy.get('body')
|
|
|
|
.should('contain', 'Last viewed')
|
2021-11-17 18:11:19 +01:00
|
|
|
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)
|
|
|
|
})
|
|
|
|
})
|