From fea455237232b18438c5c21ba0d0c8f27178cef7 Mon Sep 17 00:00:00 2001 From: Christian Heel <66922325+heelc29@users.noreply.github.com> Date: Wed, 15 Jan 2025 10:40:55 +0100 Subject: [PATCH] [5.2] system test for list multiselect checkboxes (#44720) * [5.2] system test for list multiselect (PR #44500) * add test for articles --- .../components/com_contact/Contacts.cy.js | 43 +++++++++++++++++++ .../components/com_content/Articles.cy.js | 43 +++++++++++++++++++ 2 files changed, 86 insertions(+) diff --git a/tests/System/integration/administrator/components/com_contact/Contacts.cy.js b/tests/System/integration/administrator/components/com_contact/Contacts.cy.js index 789d982d3d348..6025b8008fc25 100644 --- a/tests/System/integration/administrator/components/com_contact/Contacts.cy.js +++ b/tests/System/integration/administrator/components/com_contact/Contacts.cy.js @@ -94,4 +94,47 @@ describe('Test in backend that the contacts list', () => { cy.get('#system-message-container').contains('Contact deleted.').should('exist'); }); }); + + it('can select contacts with multiselect', () => { + cy.db_createContact({ name: 'Test contact 1' }) + .then(() => cy.db_createContact({ name: 'Test contact 2' })) + .then(() => cy.db_createContact({ name: 'Test contact 3' })) + .then(() => cy.db_createContact({ name: 'Test contact 4' })) + .then(() => cy.db_createContact({ name: 'Test contact 5' })) + .then(() => { + cy.reload(); + cy.searchForItem('Test contact'); + cy.get('#cb1').click(); + cy.get('body').type('{shift}', { release: false }); + cy.get('#cb3').click(); + + cy.clickToolbarButton('Action'); + cy.clickToolbarButton('Unpublish'); + + cy.checkForSystemMessage('3 contacts unpublished.'); + + cy.get('thead input[name=\'checkall-toggle\']').should('not.be.checked'); + cy.get('#cb0').click(); + cy.get('body').type('{shift}', { release: false }); + cy.get('#cb4').click(); + cy.get('thead input[name=\'checkall-toggle\']').should('be.checked'); + + cy.clickToolbarButton('Action'); + cy.clickToolbarButton('Unpublish'); + + cy.checkForSystemMessage('2 contacts unpublished.'); + + cy.checkAllResults(); + cy.get('#cb2').click(); + cy.get('body').type('{shift}', { release: false }); + cy.get('#cb4').click(); + cy.get('body').type('{shift}'); + cy.get('#cb0').click(); + + cy.clickToolbarButton('Action'); + cy.clickToolbarButton('Publish'); + + cy.checkForSystemMessage('Contact published.'); + }); + }); }); diff --git a/tests/System/integration/administrator/components/com_content/Articles.cy.js b/tests/System/integration/administrator/components/com_content/Articles.cy.js index 8809283cf0efc..84b97ed828167 100644 --- a/tests/System/integration/administrator/components/com_content/Articles.cy.js +++ b/tests/System/integration/administrator/components/com_content/Articles.cy.js @@ -94,4 +94,47 @@ describe('Test in backend that the articles list', () => { cy.get('#system-message-container').contains('Article deleted.').should('exist'); }); }); + + it('can select articles with multiselect', () => { + cy.db_createArticle({ title: 'Test article 1' }) + .then(() => cy.db_createArticle({ title: 'Test article 2' })) + .then(() => cy.db_createArticle({ title: 'Test article 3' })) + .then(() => cy.db_createArticle({ title: 'Test article 4' })) + .then(() => cy.db_createArticle({ title: 'Test article 5' })) + .then(() => { + cy.reload(); + cy.searchForItem('Test article'); + cy.get('#cb2').click(); + cy.get('body').type('{shift}', { release: false }); + cy.get('#cb4').click(); + + cy.clickToolbarButton('Action'); + cy.clickToolbarButton('Unpublish'); + + cy.checkForSystemMessage('3 articles unpublished.'); + + cy.get('thead input[name=\'checkall-toggle\']').should('not.be.checked'); + cy.get('#cb0').click(); + cy.get('body').type('{shift}', { release: false }); + cy.get('#cb4').click(); + cy.get('thead input[name=\'checkall-toggle\']').should('be.checked'); + + cy.clickToolbarButton('Action'); + cy.clickToolbarButton('Unpublish'); + + cy.checkForSystemMessage('2 articles unpublished.'); + + cy.checkAllResults(); + cy.get('#cb2').click(); + cy.get('body').type('{shift}', { release: false }); + cy.get('#cb0').click(); + cy.get('body').type('{shift}'); + cy.get('#cb4').click(); + + cy.clickToolbarButton('Action'); + cy.clickToolbarButton('Publish'); + + cy.checkForSystemMessage('Article published.'); + }); + }); });