diff --git a/cypress/e2mock/edge-application/list-edge-applications.cy.js b/cypress/e2mock/edge-application/list-edge-applications.cy.js index 0b4e80e22..8e4bcb974 100644 --- a/cypress/e2mock/edge-application/list-edge-applications.cy.js +++ b/cypress/e2mock/edge-application/list-edge-applications.cy.js @@ -81,4 +81,25 @@ describe('Edge Application List Spec', { tags: ['@dev2'] }, () => { .its('response.body') .should('have.property', 'count', 100) }) -}) \ No newline at end of file + + it('should paginate correctly list', function () { + cy.intercept('GET', '/api/v4/edge_application/*', (req) => { + if (req.url.includes('page_size=10')) { + req.reply({ + fixture: '/edge-application/edge-applications-paginated.json' + }) + } + }).as('paginatedEdgeApplicationsListApi') + + cy.get(selectors.list.rowsPerPage.dropdown).click() + cy.get(selectors.list.rowsPerPage.option('10')).click() + cy.get(selectors.list.pageNumber.option('5')).click() + cy.wait('@paginatedEdgeApplicationsListApi') + cy.get(selectors.list.pageNumber.option('6')).should('be.visible') + cy.get(selectors.list.pageNumber.option('5')).should('have.class', 'p-highlight') + + cy.get(selectors.list.searchInput).type('foo 1{enter}') + cy.get(selectors.list.pageNumber.option('1')).should('be.visible') + cy.get(selectors.list.pageNumber.option('1')).should('have.class', 'p-highlight') + }) +}) diff --git a/cypress/fixtures/edge-application/edge-applications-paginated.json b/cypress/fixtures/edge-application/edge-applications-paginated.json new file mode 100644 index 000000000..842fdccb8 --- /dev/null +++ b/cypress/fixtures/edge-application/edge-applications-paginated.json @@ -0,0 +1,65 @@ +{ + "count": 100, + "results": [ + { + "id": 1727808946, + "name": "foo 1", + "last_editor": "foobar@azion.com", + "last_modified": "2024-10-01T18:45:58.915153Z" + }, + { + "id": 1727808947, + "name": "foo 2", + "last_editor": "foobar@azion.com", + "last_modified": "2024-10-02T18:45:58.915153Z" + }, + { + "id": 1727808948, + "name": "foo 3", + "last_editor": "foobar@azion.com", + "last_modified": "2024-10-03T18:45:58.915153Z" + }, + { + "id": 1727808949, + "name": "foo 4", + "last_editor": "foobar@azion.com", + "last_modified": "2024-10-04T18:45:58.915153Z" + }, + { + "id": 1727808950, + "name": "foo 5", + "last_editor": "foobar@azion.com", + "last_modified": "2024-10-05T18:45:58.915153Z" + }, + { + "id": 1727808951, + "name": "foo 6", + "last_editor": "foobar@azion.com", + "last_modified": "2024-10-06T18:45:58.915153Z" + }, + { + "id": 1727808952, + "name": "foo 7", + "last_editor": "foobar@azion.com", + "last_modified": "2024-10-07T18:45:58.915153Z" + }, + { + "id": 1727808953, + "name": "foo 8", + "last_editor": "foobar@azion.com", + "last_modified": "2024-10-08T18:45:58.915153Z" + }, + { + "id": 1727808954, + "name": "foo 9", + "last_editor": "foobar@azion.com", + "last_modified": "2024-10-09T18:45:58.915153Z" + }, + { + "id": 1727808955, + "name": "foo 10", + "last_editor": "foobar@azion.com", + "last_modified": "2024-10-10T18:45:58.915153Z" + } + ] +} diff --git a/cypress/support/selectors/block-selectors/list-table-block.js b/cypress/support/selectors/block-selectors/list-table-block.js index 0aa40bf3f..eb904c5f0 100644 --- a/cypress/support/selectors/block-selectors/list-table-block.js +++ b/cypress/support/selectors/block-selectors/list-table-block.js @@ -25,6 +25,9 @@ export default { dropdown: '.p-paginator-rpp-options', option: (size) => `li.p-dropdown-item[aria-label="${size}"]` }, + pageNumber: { + option: (page) => `button.p-paginator-page[aria-label="${page}"]` + }, orderingHeader: { firstColumn: ':nth-child(1) > .p-column-header-content > [data-pc-section="sort"] > .p-icon' } diff --git a/src/templates/content-block/banner.vue b/src/templates/content-block/banner.vue index 63c1d6a33..77e5ae92c 100644 --- a/src/templates/content-block/banner.vue +++ b/src/templates/content-block/banner.vue @@ -1,5 +1,5 @@