Skip to content

Commit

Permalink
[5.2] system test for list multiselect checkboxes (#44720)
Browse files Browse the repository at this point in the history
* [5.2] system test for list multiselect (PR #44500)

* add test for articles
  • Loading branch information
heelc29 authored Jan 15, 2025
1 parent ffbad2e commit fea4552
Show file tree
Hide file tree
Showing 2 changed files with 86 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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.');
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -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.');
});
});
});

0 comments on commit fea4552

Please sign in to comment.