diff --git a/cypress/integration/list/list.spec.js b/cypress/integration/list/list.spec.js index 815eb2ac..7b39104c 100644 --- a/cypress/integration/list/list.spec.js +++ b/cypress/integration/list/list.spec.js @@ -117,6 +117,29 @@ describe('Lists', () => { cy.get('.tasks-container .tasks .color-bubble') .should('not.exist') }) + + it('Should paginate for > 50 tasks', () => { + const tasks = TaskFactory.create(100, { + id: '{increment}', + title: i => `task${i}`, + list_id: 1, + }) + cy.visit('/lists/1/list') + + cy.get('.tasks-container .tasks') + .should('contain', tasks[99].title) + + cy.get('.card-content .pagination .pagination-link') + .contains('2') + .click() + + cy.url() + .should('contain', '?page=2') + cy.get('.tasks-container .tasks') + .should('contain', tasks[1].title) + cy.get('.tasks-container .tasks') + .should('not.contain', tasks[99].title) + }) }) describe('Table View', () => { diff --git a/cypress/support/factory.js b/cypress/support/factory.js index 7dc1f718..63846476 100644 --- a/cypress/support/factory.js +++ b/cypress/support/factory.js @@ -27,6 +27,10 @@ export class Factory { for (let i = 1; i <= count; i++) { const entry = merge(this.factory(), override) for (const e in entry) { + if(typeof entry[e] === 'function') { + entry[e] = entry[e](i) + continue + } if (entry[e] === '{increment}') { entry[e] = i } diff --git a/src/components/tasks/mixins/taskList.js b/src/components/tasks/mixins/taskList.js index faec522e..6748ad06 100644 --- a/src/components/tasks/mixins/taskList.js +++ b/src/components/tasks/mixins/taskList.js @@ -70,6 +70,7 @@ export default { id: list.listId, params: params, search: search, + page: page, } if (JSON.stringify(currentList) === JSON.stringify(this.loadedList)) { return