From f3d42950495b0f5fef562f89d350a22fa38b16c2 Mon Sep 17 00:00:00 2001 From: kolaente Date: Wed, 7 Jul 2021 10:26:31 +0200 Subject: [PATCH] Add frontend tests for list history --- cypress/integration/list/list.spec.js | 30 +++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/cypress/integration/list/list.spec.js b/cypress/integration/list/list.spec.js index 843d8291..57e98b15 100644 --- a/cypress/integration/list/list.spec.js +++ b/cypress/integration/list/list.spec.js @@ -511,4 +511,34 @@ describe('Lists', () => { .should('not.contain', task.title) }) }) + + describe('List history', () => { + it('should show a list history on the home page', () => { + const lists = ListFactory.create(6) + + cy.visit('/') + cy.get('h3') + .contains('Last viewed') + .should('not.exist') + + cy.visit(`/lists/${lists[0].id}`) + cy.visit(`/lists/${lists[1].id}`) + cy.visit(`/lists/${lists[2].id}`) + cy.visit(`/lists/${lists[3].id}`) + cy.visit(`/lists/${lists[4].id}`) + cy.visit(`/lists/${lists[5].id}`) + + cy.visit('/') + 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) + }) + }) })