diff --git a/test/cypress/components/CreateBankEntityForm.spec.js b/test/cypress/components/CreateBankEntityForm.spec.js index c8ecf1c02..0739c0e1c 100644 --- a/test/cypress/components/CreateBankEntityForm.spec.js +++ b/test/cypress/components/CreateBankEntityForm.spec.js @@ -1,4 +1,3 @@ -/// import { createTestingPinia } from '@pinia/testing'; import axios from 'axios'; import { setActivePinia } from 'pinia'; diff --git a/test/cypress/components/CreateManualInvoiceForm.spec.js b/test/cypress/components/CreateManualInvoiceForm.spec.js index 7f267e92c..83d963ff0 100644 --- a/test/cypress/components/CreateManualInvoiceForm.spec.js +++ b/test/cypress/components/CreateManualInvoiceForm.spec.js @@ -1,4 +1,3 @@ -/// import CreateManualInvoiceForm from 'src/components/CreateManualInvoiceForm.vue'; describe.skip('', () => { diff --git a/test/cypress/components/CreateNewCityForm.spec.js b/test/cypress/components/CreateNewCityForm.spec.js index a2e0a79f3..43c97a8a1 100644 --- a/test/cypress/components/CreateNewCityForm.spec.js +++ b/test/cypress/components/CreateNewCityForm.spec.js @@ -1,4 +1,3 @@ -/// import CreateNewCityForm from 'src/components/CreateNewCityForm.vue'; describe.skip('', () => { diff --git a/test/cypress/components/CreateNewExpenseForm.spec.js b/test/cypress/components/CreateNewExpenseForm.spec.js index 1051700bf..e42ebe9f4 100644 --- a/test/cypress/components/CreateNewExpenseForm.spec.js +++ b/test/cypress/components/CreateNewExpenseForm.spec.js @@ -1,4 +1,3 @@ -/// import CreateNewExpenseForm from 'src/components/CreateNewExpenseForm.vue'; describe.skip('', () => { diff --git a/test/cypress/components/CreateNewPostcodeForm.spec.js b/test/cypress/components/CreateNewPostcodeForm.spec.js index 9debf6e2a..f3f8c9ce1 100644 --- a/test/cypress/components/CreateNewPostcodeForm.spec.js +++ b/test/cypress/components/CreateNewPostcodeForm.spec.js @@ -1,4 +1,3 @@ -/// import CreateNewPostcodeForm from 'src/components/CreateNewPostcodeForm.vue'; describe.skip('', () => { diff --git a/test/cypress/components/CreateNewProvinceForm.spec.js b/test/cypress/components/CreateNewProvinceForm.spec.js index 65e704c85..507e72aaa 100644 --- a/test/cypress/components/CreateNewProvinceForm.spec.js +++ b/test/cypress/components/CreateNewProvinceForm.spec.js @@ -1,4 +1,3 @@ -/// import CreateNewProvinceForm from 'src/components/CreateNewProvinceForm.vue'; describe.skip('', () => { diff --git a/test/cypress/components/CreateThermographForm.spec.js b/test/cypress/components/CreateThermographForm.spec.js index 98b4fa8e5..8e5c89f17 100644 --- a/test/cypress/components/CreateThermographForm.spec.js +++ b/test/cypress/components/CreateThermographForm.spec.js @@ -1,4 +1,3 @@ -/// import CreateThermographForm from 'src/components/CreateThermographForm.vue'; describe.skip('', () => { diff --git a/test/cypress/components/CrudModel.spec.js b/test/cypress/components/CrudModel.spec.js index e1581b19e..a2a6dc14c 100644 --- a/test/cypress/components/CrudModel.spec.js +++ b/test/cypress/components/CrudModel.spec.js @@ -1,4 +1,3 @@ -/// import CrudModel from 'src/components/CrudModel.vue'; describe.skip('', () => { diff --git a/test/cypress/components/EditPictureForm.spec.js b/test/cypress/components/EditPictureForm.spec.js index 25d0e60a6..c2f73f3a4 100644 --- a/test/cypress/components/EditPictureForm.spec.js +++ b/test/cypress/components/EditPictureForm.spec.js @@ -1,4 +1,3 @@ -/// import EditPictureForm from 'src/components/EditPictureForm.vue'; describe.skip('', () => { diff --git a/test/cypress/components/EditTableCellValueForm.spec.js b/test/cypress/components/EditTableCellValueForm.spec.js index 39e0cf407..602278f84 100644 --- a/test/cypress/components/EditTableCellValueForm.spec.js +++ b/test/cypress/components/EditTableCellValueForm.spec.js @@ -1,4 +1,3 @@ -/// import EditTableCellValueForm from 'src/components/EditTableCellValueForm.vue'; describe.skip('', () => { diff --git a/test/cypress/components/FetchData.spec.js b/test/cypress/components/FetchData.spec.js index 1ff9380a4..de22cb886 100644 --- a/test/cypress/components/FetchData.spec.js +++ b/test/cypress/components/FetchData.spec.js @@ -1,4 +1,3 @@ -/// import axios from 'axios'; import FetchData from 'src/components/FetchData.vue'; diff --git a/test/cypress/components/FilterItemForm.spec.js b/test/cypress/components/FilterItemForm.spec.js index d787ea808..1a4976eb2 100644 --- a/test/cypress/components/FilterItemForm.spec.js +++ b/test/cypress/components/FilterItemForm.spec.js @@ -1,4 +1,3 @@ -/// import FilterItemForm from 'src/components/FilterItemForm.vue'; describe.skip('', () => { diff --git a/test/cypress/components/FilterTravelForm.spec.js b/test/cypress/components/FilterTravelForm.spec.js index 0e473a154..110e1d5ea 100644 --- a/test/cypress/components/FilterTravelForm.spec.js +++ b/test/cypress/components/FilterTravelForm.spec.js @@ -1,4 +1,3 @@ -/// import FilterTravelForm from 'src/components/FilterTravelForm.vue'; describe.skip('', () => { diff --git a/test/cypress/components/FormModel.spec.js b/test/cypress/components/FormModel.spec.js index 2f25ad5f5..7375be68b 100644 --- a/test/cypress/components/FormModel.spec.js +++ b/test/cypress/components/FormModel.spec.js @@ -1,4 +1,3 @@ -/// import { Notify } from 'quasar'; import FormModel from 'src/components/FormModel.vue'; import { useState } from 'src/composables/useState'; diff --git a/test/cypress/components/FormModelPopup.spec.js b/test/cypress/components/FormModelPopup.spec.js index ea80ca12d..a2a5ab572 100644 --- a/test/cypress/components/FormModelPopup.spec.js +++ b/test/cypress/components/FormModelPopup.spec.js @@ -1,4 +1,3 @@ -/// import FormModelPopup from 'src/components/FormModelPopup.vue'; describe.skip('', () => { diff --git a/test/cypress/components/FormPopup.spec.js b/test/cypress/components/FormPopup.spec.js index b425fd6a2..d5b49ec43 100644 --- a/test/cypress/components/FormPopup.spec.js +++ b/test/cypress/components/FormPopup.spec.js @@ -1,4 +1,3 @@ -/// import FormPopup from 'src/components/FormPopup.vue'; describe.skip('', () => { diff --git a/test/cypress/components/ItemsFilterPanel.spec.js b/test/cypress/components/ItemsFilterPanel.spec.js index d15a638e8..763f4b3ea 100644 --- a/test/cypress/components/ItemsFilterPanel.spec.js +++ b/test/cypress/components/ItemsFilterPanel.spec.js @@ -1,4 +1,3 @@ -/// import ItemsFilterPanel from 'src/components/ItemsFilterPanel.vue'; describe.skip('', () => { diff --git a/test/cypress/components/LeftMenu.spec.js b/test/cypress/components/LeftMenu.spec.js index bc18d9fef..ee13c09a6 100644 --- a/test/cypress/components/LeftMenu.spec.js +++ b/test/cypress/components/LeftMenu.spec.js @@ -1,4 +1,3 @@ -/// import LeftMenu from 'src/components/LeftMenu.vue'; describe.skip('', () => { diff --git a/test/cypress/components/LeftMenuItem.spec.js b/test/cypress/components/LeftMenuItem.spec.js index ee53ed5e7..6355548f9 100644 --- a/test/cypress/components/LeftMenuItem.spec.js +++ b/test/cypress/components/LeftMenuItem.spec.js @@ -1,4 +1,3 @@ -/// import LeftMenuItem from 'src/components/LeftMenuItem.vue'; describe.skip('', () => { diff --git a/test/cypress/components/LeftMenuItemGroup.spec.js b/test/cypress/components/LeftMenuItemGroup.spec.js index 3fac250da..28393f20f 100644 --- a/test/cypress/components/LeftMenuItemGroup.spec.js +++ b/test/cypress/components/LeftMenuItemGroup.spec.js @@ -1,4 +1,3 @@ -/// import LeftMenuItemGroup from 'src/components/LeftMenuItemGroup.vue'; describe.skip('', () => { diff --git a/test/cypress/components/NavBar.spec.js b/test/cypress/components/NavBar.spec.js index 7645e338b..38ad6b95e 100644 --- a/test/cypress/components/NavBar.spec.js +++ b/test/cypress/components/NavBar.spec.js @@ -1,4 +1,3 @@ -/// import NavBar from 'src/components/NavBar.vue'; describe.skip('', () => { diff --git a/test/cypress/components/PinnedModules.spec.js b/test/cypress/components/PinnedModules.spec.js index 7220452b6..1932ecfc1 100644 --- a/test/cypress/components/PinnedModules.spec.js +++ b/test/cypress/components/PinnedModules.spec.js @@ -1,4 +1,3 @@ -/// import PinnedModules from 'src/components/PinnedModules.vue'; describe.skip('', () => { diff --git a/test/cypress/components/RefundInvoiceForm.spec.js b/test/cypress/components/RefundInvoiceForm.spec.js index 8e0e2e6ed..04bc7fdbe 100644 --- a/test/cypress/components/RefundInvoiceForm.spec.js +++ b/test/cypress/components/RefundInvoiceForm.spec.js @@ -1,4 +1,3 @@ -/// import RefundInvoiceForm from 'src/components/RefundInvoiceForm.vue'; describe.skip('', () => { diff --git a/test/cypress/components/RegularizeStockForm.spec.js b/test/cypress/components/RegularizeStockForm.spec.js index 168f267ea..1810018bf 100644 --- a/test/cypress/components/RegularizeStockForm.spec.js +++ b/test/cypress/components/RegularizeStockForm.spec.js @@ -1,4 +1,3 @@ -/// import RegularizeStockForm from 'src/components/RegularizeStockForm.vue'; describe.skip('', () => { diff --git a/test/cypress/components/TransferInvoiceForm.spec.js b/test/cypress/components/TransferInvoiceForm.spec.js index 88f5d40fa..2c4bb276b 100644 --- a/test/cypress/components/TransferInvoiceForm.spec.js +++ b/test/cypress/components/TransferInvoiceForm.spec.js @@ -1,4 +1,3 @@ -/// import TransferInvoiceForm from 'src/components/TransferInvoiceForm.vue'; describe.skip('', () => { diff --git a/test/cypress/components/UserPanel.spec.js b/test/cypress/components/UserPanel.spec.js index 4e2806ed2..b6fa73283 100644 --- a/test/cypress/components/UserPanel.spec.js +++ b/test/cypress/components/UserPanel.spec.js @@ -1,4 +1,3 @@ -/// import UserPanel from 'src/components/UserPanel.vue'; describe.skip('', () => { diff --git a/test/cypress/components/common/RightMenu.spec.js b/test/cypress/components/common/RightMenu.spec.js index 849089ffa..049941ede 100644 --- a/test/cypress/components/common/RightMenu.spec.js +++ b/test/cypress/components/common/RightMenu.spec.js @@ -1,4 +1,3 @@ -/// import RightMenu from 'src/components/common/RightMenu.vue'; describe.skip('', () => { diff --git a/test/cypress/components/common/SendEmailDialog.spec.js b/test/cypress/components/common/SendEmailDialog.spec.js index b52dd567f..04bcafffc 100644 --- a/test/cypress/components/common/SendEmailDialog.spec.js +++ b/test/cypress/components/common/SendEmailDialog.spec.js @@ -1,4 +1,3 @@ -/// import SendEmailDialog from 'src/components/common/SendEmailDialog.vue'; describe('', () => { diff --git a/test/cypress/components/common/SendSmsDialog.spec.js b/test/cypress/components/common/SendSmsDialog.spec.js index 5d7e36794..6a53f3b85 100644 --- a/test/cypress/components/common/SendSmsDialog.spec.js +++ b/test/cypress/components/common/SendSmsDialog.spec.js @@ -1,4 +1,3 @@ -/// import SendSmsDialog from 'src/components/common/SendSmsDialog.vue'; describe.skip('', () => { diff --git a/test/cypress/components/common/TableVisibleColumns.spec.js b/test/cypress/components/common/TableVisibleColumns.spec.js index c9e7f60ae..4a96e603a 100644 --- a/test/cypress/components/common/TableVisibleColumns.spec.js +++ b/test/cypress/components/common/TableVisibleColumns.spec.js @@ -1,4 +1,3 @@ -/// import TableVisibleColumns from 'src/components/common/TableVisibleColumns.vue'; describe.skip('', () => { diff --git a/test/cypress/components/common/VnAccountNumber.spec.js b/test/cypress/components/common/VnAccountNumber.spec.js index 46f39eb31..3bf3db78d 100644 --- a/test/cypress/components/common/VnAccountNumber.spec.js +++ b/test/cypress/components/common/VnAccountNumber.spec.js @@ -1,4 +1,3 @@ -/// import VnAccountNumber from 'src/components/common/VnAccountNumber.vue'; describe.skip('', () => { diff --git a/test/cypress/components/common/VnBreadcrumbs.spec.js b/test/cypress/components/common/VnBreadcrumbs.spec.js index 937102cb1..80eefc32c 100644 --- a/test/cypress/components/common/VnBreadcrumbs.spec.js +++ b/test/cypress/components/common/VnBreadcrumbs.spec.js @@ -1,4 +1,3 @@ -/// import VnBreadcrumbs from 'src/components/common/VnBreadcrumbs.vue'; describe.skip('', () => { diff --git a/test/cypress/components/common/VnCard.spec.js b/test/cypress/components/common/VnCard.spec.js index 387eb4c32..26c131ec3 100644 --- a/test/cypress/components/common/VnCard.spec.js +++ b/test/cypress/components/common/VnCard.spec.js @@ -1,4 +1,3 @@ -/// import VnCard from 'src/components/common/VnCard.vue'; describe.skip('', () => { diff --git a/test/cypress/components/common/VnComponent.spec.js b/test/cypress/components/common/VnComponent.spec.js index 9e186454a..9262615fa 100644 --- a/test/cypress/components/common/VnComponent.spec.js +++ b/test/cypress/components/common/VnComponent.spec.js @@ -1,4 +1,3 @@ -/// import VnComponent from 'src/components/common/VnComponent.vue'; describe.skip('', () => { diff --git a/test/cypress/components/common/VnDms.spec.js b/test/cypress/components/common/VnDms.spec.js index a12c607e7..501a1cb1b 100644 --- a/test/cypress/components/common/VnDms.spec.js +++ b/test/cypress/components/common/VnDms.spec.js @@ -1,4 +1,3 @@ -/// import VnDms from 'src/components/common/VnDms.vue'; describe.skip('', () => { diff --git a/test/cypress/components/common/VnDmsList.spec.js b/test/cypress/components/common/VnDmsList.spec.js index 3385c9775..1293b7061 100644 --- a/test/cypress/components/common/VnDmsList.spec.js +++ b/test/cypress/components/common/VnDmsList.spec.js @@ -1,6 +1,5 @@ import VnDmsList from 'src/components/common/VnDmsList.vue'; -/// describe.skip('', () => { it('TODO: boilerplate', () => { // see: https://on.cypress.io/mounting-vue diff --git a/test/cypress/components/common/VnInput.spec.js b/test/cypress/components/common/VnInput.spec.js index 3deca8bd9..3b58dde55 100644 --- a/test/cypress/components/common/VnInput.spec.js +++ b/test/cypress/components/common/VnInput.spec.js @@ -1,6 +1,5 @@ import VnInput from 'src/components/common/VnInput.vue'; -/// describe.skip('', () => { it('TODO: boilerplate', () => { // see: https://on.cypress.io/mounting-vue diff --git a/test/cypress/components/common/VnInputDate.spec.js b/test/cypress/components/common/VnInputDate.spec.js index 4666d81df..c3e128c65 100644 --- a/test/cypress/components/common/VnInputDate.spec.js +++ b/test/cypress/components/common/VnInputDate.spec.js @@ -1,6 +1,5 @@ import VnInputDate from 'src/components/common/VnInputDate.vue'; -/// describe.skip('', () => { it('TODO: boilerplate', () => { // see: https://on.cypress.io/mounting-vue diff --git a/test/cypress/components/common/VnInputNumber.spec.js b/test/cypress/components/common/VnInputNumber.spec.js index 63e9314c4..a4035e5b1 100644 --- a/test/cypress/components/common/VnInputNumber.spec.js +++ b/test/cypress/components/common/VnInputNumber.spec.js @@ -1,4 +1,3 @@ -/// import VnInputNumber from 'src/components/common/VnInputNumber.vue'; describe.skip('', () => { diff --git a/test/cypress/components/common/VnInputTime.spec.js b/test/cypress/components/common/VnInputTime.spec.js index 178fa3b37..25e97ef0f 100644 --- a/test/cypress/components/common/VnInputTime.spec.js +++ b/test/cypress/components/common/VnInputTime.spec.js @@ -1,6 +1,5 @@ import VnInputTime from 'src/components/common/VnInputTime.vue'; -/// describe.skip('', () => { it('TODO: boilerplate', () => { // see: https://on.cypress.io/mounting-vue diff --git a/test/cypress/components/common/VnJsonValue.spec.js b/test/cypress/components/common/VnJsonValue.spec.js index d382650a7..fe8caad51 100644 --- a/test/cypress/components/common/VnJsonValue.spec.js +++ b/test/cypress/components/common/VnJsonValue.spec.js @@ -1,4 +1,3 @@ -/// import VnJsonValue from 'src/components/common/VnJsonValue.vue'; describe('', () => { diff --git a/test/cypress/components/common/VnLocation.spec.js b/test/cypress/components/common/VnLocation.spec.js index 37129976f..5fb16228d 100644 --- a/test/cypress/components/common/VnLocation.spec.js +++ b/test/cypress/components/common/VnLocation.spec.js @@ -1,4 +1,3 @@ -/// import VnLocation from 'src/components/common/VnLocation.vue'; describe.skip('', () => { const location = { diff --git a/test/cypress/components/common/VnLog.spec.js b/test/cypress/components/common/VnLog.spec.js index 22a06c32e..47ac8fb22 100644 --- a/test/cypress/components/common/VnLog.spec.js +++ b/test/cypress/components/common/VnLog.spec.js @@ -1,4 +1,3 @@ -/// import VnLog from 'src/components/common/VnLog.vue'; describe('', () => { diff --git a/test/cypress/components/common/VnLogFilter.spec.js b/test/cypress/components/common/VnLogFilter.spec.js index 528fbdc9b..288e0a604 100644 --- a/test/cypress/components/common/VnLogFilter.spec.js +++ b/test/cypress/components/common/VnLogFilter.spec.js @@ -1,4 +1,3 @@ -/// import VnLogFilter from 'src/components/common/VnLogFilter.vue'; describe.skip('', () => { diff --git a/test/cypress/components/common/VnPopup.spec.js b/test/cypress/components/common/VnPopup.spec.js index ba1090236..34a88393d 100644 --- a/test/cypress/components/common/VnPopup.spec.js +++ b/test/cypress/components/common/VnPopup.spec.js @@ -1,6 +1,5 @@ import VnPopup from 'src/components/common/VnPopup.vue'; -/// describe.skip('', () => { it('TODO: boilerplate', () => { // see: https://on.cypress.io/mounting-vue diff --git a/test/cypress/components/common/VnProgressModal.spec.js b/test/cypress/components/common/VnProgressModal.spec.js index b9aee4822..7abda8c53 100644 --- a/test/cypress/components/common/VnProgressModal.spec.js +++ b/test/cypress/components/common/VnProgressModal.spec.js @@ -1,9 +1,94 @@ -/// import VnProgressModal from 'src/components/common/VnProgressModal.vue'; describe.skip('', () => { - it('TODO: boilerplate', () => { - // see: https://on.cypress.io/mounting-vue - cy.createWrapper(VnProgressModal); + const mountComponent = (opt) => { + cy.createWrapper(VnProgressModal, opt); + }; + + it('should display progress and close button', () => { + mountComponent({ + props: { + progress: 0.5, + showDialog: true, + cancelled: false, + }, + }); + // Verifica que el diálogo esté visible + cy.get('.q-dialog').should('be.visible'); + + // Verifica el texto de progreso en el componente + cy.contains('50%'); + + // Verifica que el botón de cerrar esté presente + cy.get('.q-btn[icon="close"]').should('exist'); + }); + + it('should emit close event when close button is clicked', () => { + // Espía el evento de cierre + const onClose = cy.spy().as('closeEvent'); + mountComponent({ + props: { + progress: 0.5, + showDialog: true, + }, + listeners: { + close: onClose, + }, + }); + + // Clic en el botón de cerrar + cy.get('.q-btn[icon="close"]').click(); + + // Asegúrate de que el evento se haya emitido + cy.get('@closeEvent').should('have.been.calledOnce'); + }); + + it('should display cancelled badge if cancelled prop is true', () => { + // Montar el componente con `cancelled` en `true` + mountComponent({ + props: { + progress: 0.5, + showDialog: true, + cancelled: true, + }, + }); + + // Verifica que la etiqueta de cancelación esté visible + cy.contains('Cancelado').should('be.visible'); + }); + + it('should emit cancel event when cancel button is clicked', () => { + // Espía el evento de cancelación + const onCancel = cy.spy().as('cancelEvent'); + mountComponent({ + props: { + progress: 0.5, + showDialog: true, + cancelled: false, + }, + listeners: { + cancel: onCancel, + }, + }); + + // Clic en el botón de cancelar + cy.contains('Cancelar').click(); + + // Asegúrate de que el evento se haya emitido + cy.get('@cancelEvent').should('have.been.calledOnce'); + }); + + it('should hide cancel button when progress is 100%', () => { + // Montar el componente con `progress` en `1` (100%) + mountComponent({ + props: { + progress: 1, + showDialog: true, + cancelled: false, + }, + }); + + // Verificar que el botón de cancelar no esté presente + cy.contains('Cancelar').should('not.exist'); }); }); diff --git a/test/cypress/components/common/VnRadio.spec.js b/test/cypress/components/common/VnRadio.spec.js index 85840aeb7..c22dbf1e3 100644 --- a/test/cypress/components/common/VnRadio.spec.js +++ b/test/cypress/components/common/VnRadio.spec.js @@ -1,6 +1,5 @@ import VnRadio from 'src/components/common/VnRadio.vue'; -/// describe.skip('', () => { it('TODO: boilerplate', () => { // see: https://on.cypress.io/mounting-vue diff --git a/test/cypress/components/common/VnSectionMain.spec.js b/test/cypress/components/common/VnSectionMain.spec.js index 8b56adf5b..46e178e2d 100644 --- a/test/cypress/components/common/VnSectionMain.spec.js +++ b/test/cypress/components/common/VnSectionMain.spec.js @@ -1,4 +1,3 @@ -/// import VnSectionMain from 'src/components/common/VnSectionMain.vue'; describe.skip('', () => { diff --git a/test/cypress/components/common/VnSelect.spec.js b/test/cypress/components/common/VnSelect.spec.js index c36f60737..6488728d0 100644 --- a/test/cypress/components/common/VnSelect.spec.js +++ b/test/cypress/components/common/VnSelect.spec.js @@ -1,6 +1,5 @@ import VnSelect from 'src/components/common/VnSelect.vue'; -/// describe.skip('', () => { it('TODO: boilerplate', () => { // see: https://on.cypress.io/mounting-vue diff --git a/test/cypress/components/common/VnSelectCache.spec.js b/test/cypress/components/common/VnSelectCache.spec.js index 705580b2c..c10514879 100644 --- a/test/cypress/components/common/VnSelectCache.spec.js +++ b/test/cypress/components/common/VnSelectCache.spec.js @@ -1,6 +1,5 @@ import VnSelectCache from 'src/components/common/VnSelectCache.vue'; -/// describe.skip('', () => { it('TODO: boilerplate', () => { // see: https://on.cypress.io/mounting-vue diff --git a/test/cypress/components/common/VnSelectDialog.spec.js b/test/cypress/components/common/VnSelectDialog.spec.js index 1822af266..73966aef2 100644 --- a/test/cypress/components/common/VnSelectDialog.spec.js +++ b/test/cypress/components/common/VnSelectDialog.spec.js @@ -1,6 +1,5 @@ import VnSelectDialog from 'src/components/common/VnSelectDialog.vue'; -/// describe.skip('', () => { it('TODO: boilerplate', () => { // see: https://on.cypress.io/mounting-vue diff --git a/test/cypress/components/common/VnSelectEnum.spec.js b/test/cypress/components/common/VnSelectEnum.spec.js index 7f05b9bb4..119e35d80 100644 --- a/test/cypress/components/common/VnSelectEnum.spec.js +++ b/test/cypress/components/common/VnSelectEnum.spec.js @@ -1,6 +1,5 @@ import VnSelectEnum from 'src/components/common/VnSelectEnum.vue'; -/// describe.skip('', () => { it('TODO: boilerplate', () => { // see: https://on.cypress.io/mounting-vue diff --git a/test/cypress/components/common/VnSmsDialog.spec.js b/test/cypress/components/common/VnSmsDialog.spec.js index 0938ee3a1..07ef7b0f8 100644 --- a/test/cypress/components/common/VnSmsDialog.spec.js +++ b/test/cypress/components/common/VnSmsDialog.spec.js @@ -1,9 +1,79 @@ +/* eslint-disable cypress/unsafe-to-chain-command */ +/* eslint-disable cypress/no-assigning-return-values */ import VnSmsDialog from 'src/components/common/VnSmsDialog.vue'; -/// describe.skip('', () => { - it('TODO: boilerplate', () => { - // see: https://on.cypress.io/mounting-vue - cy.createWrapper(VnSmsDialog); + const defaultProps = { + phone: '123456789', + subject: 'Test Subject', + template: 'pendingPayment', + locale: 'es', + promise: cy.stub().resolves(), + }; + + const mountComponent = (opt) => { + cy.mount(VnSmsDialog, { + props: defaultProps, + ...opt, + }); + }; + + it('renders dialog with all elements', () => { + mountComponent(); + cy.get('.text-h6').should('contain', 'Send SMS'); + cy.get('.q-select').should('exist'); + cy.get('input[type="text"]').should('have.length', 2); + cy.get('textarea').should('exist'); + }); + + it('shows character counter and updates color based on length', () => { + mountComponent(); + const longMessage = 'a'.repeat(150); + cy.get('textarea').clear().type(longMessage); + cy.get('.q-chip').should('have.class', 'bg-warning'); + cy.get('.q-chip').should('contain', '150/160'); + + const maxMessage = 'a'.repeat(160); + cy.get('textarea').clear().type(maxMessage); + cy.get('.q-chip').should('have.class', 'bg-negative'); + }); + + it('updates message when changing language', () => { + mountComponent(); + const initialMessage = cy.get('textarea').invoke('val'); + cy.get('.q-select').click(); + cy.get('.q-item').contains('English').click(); + cy.get('textarea').invoke('val').should('not.equal', initialMessage); + }); + + it('handles SMS sending', () => { + const promiseSpy = cy.spy(defaultProps.promise); + mountComponent({ + props: { ...defaultProps, promise: promiseSpy }, + }); + + cy.get('button').contains('confirm').click(); + cy.wrap(promiseSpy).should('have.been.calledOnce'); + cy.get('button').contains('confirm').should('have.class', 'loading'); + }); + + it('clears message with clear icon', () => { + mountComponent(); + cy.get('textarea').type('Test message'); + cy.get('.q-icon').contains('close').click(); + cy.get('textarea').should('have.value', ''); + }); + + it('shows tooltip on info icon hover', () => { + mountComponent(); + cy.get('.q-icon').contains('info').trigger('mouseover'); + cy.get('.q-tooltip').should('be.visible'); + }); + + it('validates message length', () => { + mountComponent(); + const tooLongMessage = 'a'.repeat(161); + cy.get('textarea').type(tooLongMessage); + cy.get('.q-field').should('have.class', 'q-field--error'); }); }); diff --git a/test/cypress/components/common/VnSummaryDialog.spec.js b/test/cypress/components/common/VnSummaryDialog.spec.js index 60dbe972e..5896631fb 100644 --- a/test/cypress/components/common/VnSummaryDialog.spec.js +++ b/test/cypress/components/common/VnSummaryDialog.spec.js @@ -1,6 +1,5 @@ import VnSummaryDialog from 'src/components/common/VnSummaryDialog.vue'; -/// describe.skip('', () => { it('TODO: boilerplate', () => { // see: https://on.cypress.io/mounting-vue diff --git a/test/cypress/components/common/VnTitle.spec.js b/test/cypress/components/common/VnTitle.spec.js index cc093d625..a342860c9 100644 --- a/test/cypress/components/common/VnTitle.spec.js +++ b/test/cypress/components/common/VnTitle.spec.js @@ -1,4 +1,3 @@ -/// import VnTitle from 'src/components/common/VnTitle.vue'; describe('', () => { diff --git a/test/cypress/components/common/VnWeekdayPicker.spec.js b/test/cypress/components/common/VnWeekdayPicker.spec.js index 58115cb7c..46363e8e8 100644 --- a/test/cypress/components/common/VnWeekdayPicker.spec.js +++ b/test/cypress/components/common/VnWeekdayPicker.spec.js @@ -1,6 +1,5 @@ import VnWeekdayPicker from 'src/components/common/VnWeekdayPicker.vue'; -/// describe.skip('', () => { it('TODO: boilerplate', () => { // see: https://on.cypress.io/mounting-vue diff --git a/test/cypress/components/common/vnDiscount.spec.js b/test/cypress/components/common/vnDiscount.spec.js index 217ad96c6..990c5121d 100644 --- a/test/cypress/components/common/vnDiscount.spec.js +++ b/test/cypress/components/common/vnDiscount.spec.js @@ -1,6 +1,5 @@ import vnDiscount from 'src/components/common/vnDiscount.vue'; -/// describe.skip('', () => { it('TODO: boilerplate', () => { // see: https://on.cypress.io/mounting-vue diff --git a/test/cypress/components/ui/CardDescriptor.spec.js b/test/cypress/components/ui/CardDescriptor.spec.js index ce4fca1f3..bfa793580 100644 --- a/test/cypress/components/ui/CardDescriptor.spec.js +++ b/test/cypress/components/ui/CardDescriptor.spec.js @@ -1,6 +1,5 @@ import CardDescriptor from 'src/components/ui/CardDescriptor.vue'; -/// describe.skip('', () => { it('TODO: boilerplate', () => { // see: https://on.cypress.io/mounting-vue diff --git a/test/cypress/components/ui/CardList.spec.js b/test/cypress/components/ui/CardList.spec.js index 08ab78210..103f49046 100644 --- a/test/cypress/components/ui/CardList.spec.js +++ b/test/cypress/components/ui/CardList.spec.js @@ -1,9 +1,92 @@ import CardList from 'src/components/ui/CardList.vue'; -/// -describe.skip('', () => { - it('TODO: boilerplate', () => { - // see: https://on.cypress.io/mounting-vue - cy.createWrapper(CardList); +describe('', () => { + const mountComponent = (opt) => { + const defaultProps = { + element: { name: 'Item' }, + id: 1, + isSelected: false, + title: 'Card Title', + showCheckbox: true, + hasInfoIcons: true, + }; + cy.createWrapper(CardList, { + props: defaultProps, + ...opt, + }); + }; + + it('should display title and ID chip', () => { + mountComponent(); + // Verificar que el título esté presente + cy.contains('Card Title').should('be.visible'); + + // Verificar que la etiqueta ID esté presente y visible + cy.contains('ID: 1').should('be.visible'); + }); + + it('should display checkbox when showCheckbox is true', () => { + mountComponent(); + // Verificar que el checkbox esté visible cuando showCheckbox es verdadero + cy.get('.q-checkbox').should('exist'); + }); + + it('should emit toggleCardCheck event when checkbox is clicked', () => { + mountComponent(); // Espiar el evento `toggleCardCheck` + const onToggleCardCheck = cy.spy().as('toggleCardCheckEvent'); + mountComponent({ + props: { + element: { name: 'Item' }, + showCheckbox: true, + }, + listeners: { + toggleCardCheck: onToggleCardCheck, + }, + }); + + // Hacer clic en el checkbox + cy.get('.q-checkbox').click(); + + // Asegurarse de que el evento `toggleCardCheck` se emitió + cy.get('@toggleCardCheckEvent').should('have.been.calledOnce'); + }); + + it('should display info-icons slot content when hasInfoIcons is true', () => { + // Montar el componente con el slot info-icons + mountComponent({ + props: { + hasInfoIcons: true, + }, + slots: { + 'info-icons': `
Info Icon
`, + }, + }); + + // Verificar que el contenido del slot `info-icons` esté visible + cy.get('.info-icon-slot').should('be.visible'); + }); + + it('should display list-items slot content', () => { + // Montar el componente con el slot `list-items` + mountComponent({ + slots: { + 'list-items': `
List Item
`, + }, + }); + + // Verificar que el contenido del slot `list-items` esté visible + cy.get('.list-item-slot').should('be.visible'); + }); + + it('should display actions slot content', () => { + // Montar el componente con el slot `actions` + mountComponent({ + slots: { + actions: ``, + }, + }); + + // Verificar que el contenido del slot `actions` esté visible + cy.get('.action-button').should('be.visible'); }); }); diff --git a/test/cypress/components/ui/CardSummary.spec.js b/test/cypress/components/ui/CardSummary.spec.js index b54816c07..8c466aded 100644 --- a/test/cypress/components/ui/CardSummary.spec.js +++ b/test/cypress/components/ui/CardSummary.spec.js @@ -1,9 +1,98 @@ import CardSummary from 'src/components/ui/CardSummary.vue'; - -/// +import { createRouter, createWebHistory } from 'vue-router'; describe.skip('', () => { - it('TODO: boilerplate', () => { - // see: https://on.cypress.io/mounting-vue - cy.createWrapper(CardSummary); + let router, wrapper; + + beforeEach(() => { + router = createRouter({ + history: createWebHistory(), + routes: [ + { + path: '/test', + name: 'test', + meta: { moduleName: 'test' }, + }, + { + path: '/test/summary', + name: 'testSummary', + }, + ], + }); + }); + + const mountComponent = (opt) => { + opt = { + props: { + url: 'test-url', + dataKey: 'test-key', + ...opt, + }, + }; + cy.createWrapper(CardSummary, opt); + }; + + it('shows skeleton while loading', () => { + mountComponent(); + cy.get('.cardSummary').find('SkeletonSummary').should('exist'); + }); + + it('displays entity data correctly', () => { + const mockEntity = { + id: 1, + name: 'Test Entity', + }; + + mountComponent(); + // Intercept API call + cy.intercept('GET', 'test-url*', { + body: mockEntity, + }).as('fetchData'); + + cy.wait('@fetchData'); + cy.get('.summaryHeader').find('VnLv').should('have.prop', 'label', '1 -'); + cy.get('.summaryHeader').find('VnLv').should('have.prop', 'value', 'Test Entity'); + }); + + it('shows redirect icon when not in summary route', () => { + router.push('/test'); + mountComponent({ + entityId: 1, + moduleName: 'test', + }); + + cy.get('.header.link') + .should('exist') + .should('have.attr', 'href') + .and('include', '/test/summary'); + }); + + it('emits onFetch event after data fetch', () => { + const mockEntity = { id: 1, name: 'Test' }; + const onFetchSpy = cy.spy().as('onFetchSpy'); + + mountComponent({ + onFetch: onFetchSpy, + }); + + cy.intercept('GET', 'test-url*', { + body: mockEntity, + }).as('fetchData'); + + cy.wait('@fetchData'); + cy.get('@onFetchSpy').should('have.been.calledWith', mockEntity); + }); + + it('updates when props change', () => { + mountComponent(); + + cy.intercept('GET', 'new-url*').as('newFetch'); + + // Change props + cy.get('@wrapper').invoke('setProps', { + url: 'new-url', + filter: { test: true }, + }); + + cy.wait('@newFetch'); }); }); diff --git a/test/cypress/components/ui/CatalogItem.spec.js b/test/cypress/components/ui/CatalogItem.spec.js index aba216ecc..ae3159cdd 100644 --- a/test/cypress/components/ui/CatalogItem.spec.js +++ b/test/cypress/components/ui/CatalogItem.spec.js @@ -1,6 +1,5 @@ import CatalogItem from 'src/components/ui/CatalogItem.vue'; -/// describe.skip('', () => { it('TODO: boilerplate', () => { // see: https://on.cypress.io/mounting-vue diff --git a/test/cypress/components/ui/FetchedTags.spec.js b/test/cypress/components/ui/FetchedTags.spec.js index 2482835bf..0fe0a43a2 100644 --- a/test/cypress/components/ui/FetchedTags.spec.js +++ b/test/cypress/components/ui/FetchedTags.spec.js @@ -1,4 +1,3 @@ -/// import FetchedTags from 'src/components/ui/FetchedTags.vue'; // Ajusta la ruta según tu estructura de proyecto describe('FetchedTags', () => { diff --git a/test/cypress/components/ui/QCalendarMonthWrapper.spec.js b/test/cypress/components/ui/QCalendarMonthWrapper.spec.js index 35675a3d1..7bdd1e046 100644 --- a/test/cypress/components/ui/QCalendarMonthWrapper.spec.js +++ b/test/cypress/components/ui/QCalendarMonthWrapper.spec.js @@ -1,6 +1,5 @@ import QCalendarMonthWrapper from 'src/components/ui/QCalendarMonthWrapper.vue'; -/// describe.skip('', () => { it('TODO: boilerplate', () => { // see: https://on.cypress.io/mounting-vue diff --git a/test/cypress/components/ui/SkeletonDescriptor.spec.js b/test/cypress/components/ui/SkeletonDescriptor.spec.js index 1fa8a916d..5fcfcb9c4 100644 --- a/test/cypress/components/ui/SkeletonDescriptor.spec.js +++ b/test/cypress/components/ui/SkeletonDescriptor.spec.js @@ -1,6 +1,6 @@ +/// import SkeletonDescriptor from 'src/components/ui/SkeletonDescriptor.vue'; -/// describe.skip('', () => { it('TODO: boilerplate', () => { // see: https://on.cypress.io/mounting-vue diff --git a/test/cypress/components/ui/SkeletonForm.spec.js b/test/cypress/components/ui/SkeletonForm.spec.js index 92cbbd0bf..7547b79b1 100644 --- a/test/cypress/components/ui/SkeletonForm.spec.js +++ b/test/cypress/components/ui/SkeletonForm.spec.js @@ -1,6 +1,5 @@ import SkeletonForm from 'src/components/ui/SkeletonForm.vue'; -/// describe.skip('', () => { it('TODO: boilerplate', () => { // see: https://on.cypress.io/mounting-vue diff --git a/test/cypress/components/ui/SkeletonSummary.spec.js b/test/cypress/components/ui/SkeletonSummary.spec.js index 0427ff5e7..5e06e35c6 100644 --- a/test/cypress/components/ui/SkeletonSummary.spec.js +++ b/test/cypress/components/ui/SkeletonSummary.spec.js @@ -1,6 +1,5 @@ import SkeletonSummary from 'src/components/ui/SkeletonSummary.vue'; -/// describe.skip('', () => { it('TODO: boilerplate', () => { // see: https://on.cypress.io/mounting-vue diff --git a/test/cypress/components/ui/SkeletonTable.spec.js b/test/cypress/components/ui/SkeletonTable.spec.js index 8bd8dcf67..cebd421a7 100644 --- a/test/cypress/components/ui/SkeletonTable.spec.js +++ b/test/cypress/components/ui/SkeletonTable.spec.js @@ -1,6 +1,5 @@ import SkeletonTable from 'src/components/ui/SkeletonTable.vue'; -/// describe.skip('', () => { it('TODO: boilerplate', () => { // see: https://on.cypress.io/mounting-vue diff --git a/test/cypress/components/ui/VnAvatar.spec.js b/test/cypress/components/ui/VnAvatar.spec.js index 6960464bf..a90cd636a 100644 --- a/test/cypress/components/ui/VnAvatar.spec.js +++ b/test/cypress/components/ui/VnAvatar.spec.js @@ -1,4 +1,3 @@ -/// import VnAvatar from 'src/components/ui/VnAvatar.vue'; // Ajusta la ruta según tu estructura de proyecto describe('VnAvatar', () => { diff --git a/test/cypress/components/ui/VnConfirm.spec.js b/test/cypress/components/ui/VnConfirm.spec.js index b0c6c1007..111770197 100644 --- a/test/cypress/components/ui/VnConfirm.spec.js +++ b/test/cypress/components/ui/VnConfirm.spec.js @@ -1,6 +1,5 @@ import VnConfirm from 'src/components/ui/VnConfirm.vue'; -/// describe.skip('', () => { it('TODO: boilerplate', () => { // see: https://on.cypress.io/mounting-vue diff --git a/test/cypress/components/ui/VnFilterPanel.spec.js b/test/cypress/components/ui/VnFilterPanel.spec.js index 96c40b65b..ea5f5aaa2 100644 --- a/test/cypress/components/ui/VnFilterPanel.spec.js +++ b/test/cypress/components/ui/VnFilterPanel.spec.js @@ -1,6 +1,5 @@ import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue'; -/// describe.skip('', () => { it('TODO: boilerplate', () => { // see: https://on.cypress.io/mounting-vue diff --git a/test/cypress/components/ui/VnFilterPanelChip.spec.js b/test/cypress/components/ui/VnFilterPanelChip.spec.js index 318b4c550..fa8979f77 100644 --- a/test/cypress/components/ui/VnFilterPanelChip.spec.js +++ b/test/cypress/components/ui/VnFilterPanelChip.spec.js @@ -1,6 +1,5 @@ import VnFilterPanelChip from 'src/components/ui/VnFilterPanelChip.vue'; -/// describe.skip('', () => { it('TODO: boilerplate', () => { // see: https://on.cypress.io/mounting-vue diff --git a/test/cypress/components/ui/VnImg.spec.js b/test/cypress/components/ui/VnImg.spec.js index 0bff4ad28..e0efefa84 100644 --- a/test/cypress/components/ui/VnImg.spec.js +++ b/test/cypress/components/ui/VnImg.spec.js @@ -1,6 +1,5 @@ import VnImg from 'src/components/ui/VnImg.vue'; -/// describe.skip('', () => { it('TODO: boilerplate', () => { // see: https://on.cypress.io/mounting-vue diff --git a/test/cypress/components/ui/VnLinkPhone.spec.js b/test/cypress/components/ui/VnLinkPhone.spec.js index 1fc31a83c..478ada35b 100644 --- a/test/cypress/components/ui/VnLinkPhone.spec.js +++ b/test/cypress/components/ui/VnLinkPhone.spec.js @@ -1,6 +1,5 @@ import VnLinkPhone from 'src/components/ui/VnLinkPhone.vue'; -/// describe.skip('', () => { it('TODO: boilerplate', () => { // see: https://on.cypress.io/mounting-vue diff --git a/test/cypress/components/ui/VnLogo.spec.js b/test/cypress/components/ui/VnLogo.spec.js index c7da568c7..0f88f34e2 100644 --- a/test/cypress/components/ui/VnLogo.spec.js +++ b/test/cypress/components/ui/VnLogo.spec.js @@ -1,7 +1,6 @@ import { Dark } from 'quasar'; import VnLogo from 'src/components/ui/VnLogo.vue'; -/// describe('', () => { const mountComponent = (opt = {}) => { cy.createWrapper(VnLogo, { props: { ...opt } }); diff --git a/test/cypress/components/ui/VnLv.spec.js b/test/cypress/components/ui/VnLv.spec.js index 620ccc86f..af94b4a31 100644 --- a/test/cypress/components/ui/VnLv.spec.js +++ b/test/cypress/components/ui/VnLv.spec.js @@ -1,7 +1,6 @@ import VnLv from 'src/components/ui/VnLv.vue'; import { useClipboard } from 'src/composables/useClipboard'; -/// describe('', () => { before('login', () => { Cypress.on('uncaught:exception', () => false); diff --git a/test/cypress/components/ui/VnNotes.spec.js b/test/cypress/components/ui/VnNotes.spec.js index 65996c50a..7e3768997 100644 --- a/test/cypress/components/ui/VnNotes.spec.js +++ b/test/cypress/components/ui/VnNotes.spec.js @@ -1,6 +1,5 @@ import VnNotes from 'src/components/ui/VnNotes.vue'; -/// describe.skip('', () => { it('TODO: boilerplate', () => { // see: https://on.cypress.io/mounting-vue diff --git a/test/cypress/components/ui/VnOutForm.spec.js b/test/cypress/components/ui/VnOutForm.spec.js index 8b7f688c9..dfdaeea9a 100644 --- a/test/cypress/components/ui/VnOutForm.spec.js +++ b/test/cypress/components/ui/VnOutForm.spec.js @@ -1,6 +1,5 @@ import VnOutForm from 'src/components/ui/VnOutForm.vue'; -/// describe.skip('', () => { it('TODO: boilerplate', () => { // see: https://on.cypress.io/mounting-vue diff --git a/test/cypress/components/ui/VnPaginate.spec.js b/test/cypress/components/ui/VnPaginate.spec.js index 25f7a12ee..a986f5ca7 100644 --- a/test/cypress/components/ui/VnPaginate.spec.js +++ b/test/cypress/components/ui/VnPaginate.spec.js @@ -1,6 +1,5 @@ import VnPaginate from 'src/components/ui/VnPaginate.vue'; -/// describe.skip('', () => { it('TODO: boilerplate', () => { // see: https://on.cypress.io/mounting-vue diff --git a/test/cypress/components/ui/VnRow.spec.js b/test/cypress/components/ui/VnRow.spec.js index d629c8305..89ba138db 100644 --- a/test/cypress/components/ui/VnRow.spec.js +++ b/test/cypress/components/ui/VnRow.spec.js @@ -1,6 +1,5 @@ import VnRow from 'src/components/ui/VnRow.vue'; -/// describe.skip('', () => { it('TODO: boilerplate', () => { // see: https://on.cypress.io/mounting-vue diff --git a/test/cypress/components/ui/VnSearchbar.spec.js b/test/cypress/components/ui/VnSearchbar.spec.js index 266835045..fd2ccb627 100644 --- a/test/cypress/components/ui/VnSearchbar.spec.js +++ b/test/cypress/components/ui/VnSearchbar.spec.js @@ -1,6 +1,5 @@ import VnSearchbar from 'src/components/ui/VnSearchbar.vue'; -/// describe.skip('', () => { it('TODO: boilerplate', () => { // see: https://on.cypress.io/mounting-vue diff --git a/test/cypress/components/ui/VnSms.spec.js b/test/cypress/components/ui/VnSms.spec.js index 21adf15c1..2a3ab6240 100644 --- a/test/cypress/components/ui/VnSms.spec.js +++ b/test/cypress/components/ui/VnSms.spec.js @@ -1,6 +1,5 @@ import VnSms from 'src/components/ui/VnSms.vue'; -/// describe.skip('', () => { it('TODO: boilerplate', () => { // see: https://on.cypress.io/mounting-vue diff --git a/test/cypress/components/ui/VnSubToolbar.spec.js b/test/cypress/components/ui/VnSubToolbar.spec.js index 0b4be2c47..1fcc17f34 100644 --- a/test/cypress/components/ui/VnSubToolbar.spec.js +++ b/test/cypress/components/ui/VnSubToolbar.spec.js @@ -1,6 +1,5 @@ import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue'; -/// describe.skip('', () => { it('TODO: boilerplate', () => { // see: https://on.cypress.io/mounting-vue diff --git a/test/cypress/components/ui/VnUserLink.spec.js b/test/cypress/components/ui/VnUserLink.spec.js index ce51513b9..d7e0c016d 100644 --- a/test/cypress/components/ui/VnUserLink.spec.js +++ b/test/cypress/components/ui/VnUserLink.spec.js @@ -1,6 +1,5 @@ import VnUserLink from 'src/components/ui/VnUserLink.vue'; -/// describe.skip('', () => { it('TODO: boilerplate', () => { // see: https://on.cypress.io/mounting-vue