diff --git a/tests/System/integration/administrator/components/com_checkin/Default.cy.js b/tests/System/integration/administrator/components/com_checkin/Default.cy.js new file mode 100644 index 0000000000000..c426e9b3f73fb --- /dev/null +++ b/tests/System/integration/administrator/components/com_checkin/Default.cy.js @@ -0,0 +1,31 @@ +describe('Test in backend that the checkin', () => { + beforeEach(() => { + cy.doAdministratorLogin(); + cy.visit('/administrator/index.php?option=com_checkin'); + }); + + it('has a title', () => { + cy.get('h1.page-title').should('contain.text', 'Maintenance: Global Check-in'); + }); + + it('can display message', () => { + cy.get('p.lead').should('contain.text', 'There are no tables with checked out items'); + }); + + it('can display a list of checked out', () => { + cy.db_createArticle({ title: 'Test article', checked_out: '1', checked_out_time: '2024-01-01 20:00:00' }).then(() => { + cy.visit('/administrator/index.php?option=com_checkin'); + cy.get('tr.row0').should('contain.text', 'content'); + }); + }); + + it('can check in items', () => { + cy.db_createArticle({ title: 'Test article', checked_out: '1', checked_out_time: '2024-01-01 20:00:00' }).then(() => { + cy.visit('/administrator/index.php?option=com_checkin'); + cy.searchForItem('content'); + cy.checkAllResults(); + cy.get('#toolbar-checkin').click(); + cy.get('#system-message-container').contains('Item checked in').should('exist'); + }); + }); +});