feat: refs #7220 updates

This commit is contained in:
Javier Segarra 2024-10-17 11:59:28 +02:00
parent e18ae76820
commit d00354553d
86 changed files with 95 additions and 212 deletions

View File

@ -28,7 +28,7 @@ import ${componentName} from 'src/components/${file}';
describe.skip('<${componentName} />', () => { describe.skip('<${componentName} />', () => {
it('TODO: boilerplate', () => { it('TODO: boilerplate', () => {
// see: https://on.cypress.io/mounting-vue // see: https://on.cypress.io/mounting-vue
cy.vnMount(${componentName}); cy.createWrapper(${componentName});
}); });
}); });
`; `;

View File

@ -3,6 +3,6 @@ import CreateBankEntityForm from 'src/components/CreateBankEntityForm.vue';
describe('<CreateBankEntityForm />', () => { describe('<CreateBankEntityForm />', () => {
it('TODO: boilerplate', () => { it('TODO: boilerplate', () => {
// see: https://on.cypress.io/mounting-vue // see: https://on.cypress.io/mounting-vue
cy.vnMount(CreateBankEntityForm); cy.createWrapper(CreateBankEntityForm);
}); });
}); });

View File

@ -3,6 +3,6 @@ import CreateManualInvoiceForm from 'src/components/CreateManualInvoiceForm.vue'
describe.skip('<CreateManualInvoiceForm />', () => { describe.skip('<CreateManualInvoiceForm />', () => {
it('TODO: boilerplate', () => { it('TODO: boilerplate', () => {
// see: https://on.cypress.io/mounting-vue // see: https://on.cypress.io/mounting-vue
cy.vnMount(CreateManualInvoiceForm); cy.createWrapper(CreateManualInvoiceForm);
}); });
}); });

View File

@ -3,6 +3,6 @@ import CreateNewCityForm from 'src/components/CreateNewCityForm.vue';
describe.skip('<CreateNewCityForm />', () => { describe.skip('<CreateNewCityForm />', () => {
it('TODO: boilerplate', () => { it('TODO: boilerplate', () => {
// see: https://on.cypress.io/mounting-vue // see: https://on.cypress.io/mounting-vue
cy.vnMount(CreateNewCityForm); cy.createWrapper(CreateNewCityForm);
}); });
}); });

View File

@ -3,6 +3,6 @@ import CreateNewExpenseForm from 'src/components/CreateNewExpenseForm.vue';
describe.skip('<CreateNewExpenseForm />', () => { describe.skip('<CreateNewExpenseForm />', () => {
it('TODO: boilerplate', () => { it('TODO: boilerplate', () => {
// see: https://on.cypress.io/mounting-vue // see: https://on.cypress.io/mounting-vue
cy.vnMount(CreateNewExpenseForm); cy.createWrapper(CreateNewExpenseForm);
}); });
}); });

View File

@ -3,6 +3,6 @@ import CreateNewPostcodeForm from 'src/components/CreateNewPostcodeForm.vue';
describe.skip('<CreateNewPostcodeForm />', () => { describe.skip('<CreateNewPostcodeForm />', () => {
it('TODO: boilerplate', () => { it('TODO: boilerplate', () => {
// see: https://on.cypress.io/mounting-vue // see: https://on.cypress.io/mounting-vue
cy.vnMount(CreateNewPostcodeForm); cy.createWrapper(CreateNewPostcodeForm);
}); });
}); });

View File

@ -3,6 +3,6 @@ import CreateNewProvinceForm from 'src/components/CreateNewProvinceForm.vue';
describe.skip('<CreateNewProvinceForm />', () => { describe.skip('<CreateNewProvinceForm />', () => {
it('TODO: boilerplate', () => { it('TODO: boilerplate', () => {
// see: https://on.cypress.io/mounting-vue // see: https://on.cypress.io/mounting-vue
cy.vnMount(CreateNewProvinceForm); cy.createWrapper(CreateNewProvinceForm);
}); });
}); });

View File

@ -3,6 +3,6 @@ import CreateThermographForm from 'src/components/CreateThermographForm.vue';
describe.skip('<CreateThermographForm />', () => { describe.skip('<CreateThermographForm />', () => {
it('TODO: boilerplate', () => { it('TODO: boilerplate', () => {
// see: https://on.cypress.io/mounting-vue // see: https://on.cypress.io/mounting-vue
cy.vnMount(CreateThermographForm); cy.createWrapper(CreateThermographForm);
}); });
}); });

View File

@ -3,6 +3,6 @@ import CrudModel from 'src/components/CrudModel.vue';
describe.skip('<CrudModel />', () => { describe.skip('<CrudModel />', () => {
it('TODO: boilerplate', () => { it('TODO: boilerplate', () => {
// see: https://on.cypress.io/mounting-vue // see: https://on.cypress.io/mounting-vue
cy.vnMount(CrudModel); cy.createWrapper(CrudModel);
}); });
}); });

View File

@ -3,6 +3,6 @@ import EditPictureForm from 'src/components/EditPictureForm.vue';
describe.skip('<EditPictureForm />', () => { describe.skip('<EditPictureForm />', () => {
it('TODO: boilerplate', () => { it('TODO: boilerplate', () => {
// see: https://on.cypress.io/mounting-vue // see: https://on.cypress.io/mounting-vue
cy.vnMount(EditPictureForm); cy.createWrapper(EditPictureForm);
}); });
}); });

View File

@ -3,6 +3,6 @@ import EditTableCellValueForm from 'src/components/EditTableCellValueForm.vue';
describe.skip('<EditTableCellValueForm />', () => { describe.skip('<EditTableCellValueForm />', () => {
it('TODO: boilerplate', () => { it('TODO: boilerplate', () => {
// see: https://on.cypress.io/mounting-vue // see: https://on.cypress.io/mounting-vue
cy.vnMount(EditTableCellValueForm); cy.createWrapper(EditTableCellValueForm);
}); });
}); });

View File

@ -3,6 +3,6 @@ import FetchData from 'src/components/FetchData.vue';
describe.skip('<FetchData />', () => { describe.skip('<FetchData />', () => {
it('TODO: boilerplate', () => { it('TODO: boilerplate', () => {
// see: https://on.cypress.io/mounting-vue // see: https://on.cypress.io/mounting-vue
cy.vnMount(FetchData); cy.createWrapper(FetchData);
}); });
}); });

View File

@ -3,6 +3,6 @@ import FilterItemForm from 'src/components/FilterItemForm.vue';
describe.skip('<FilterItemForm />', () => { describe.skip('<FilterItemForm />', () => {
it('TODO: boilerplate', () => { it('TODO: boilerplate', () => {
// see: https://on.cypress.io/mounting-vue // see: https://on.cypress.io/mounting-vue
cy.vnMount(FilterItemForm); cy.createWrapper(FilterItemForm);
}); });
}); });

View File

@ -3,6 +3,6 @@ import FilterTravelForm from 'src/components/FilterTravelForm.vue';
describe.skip('<FilterTravelForm />', () => { describe.skip('<FilterTravelForm />', () => {
it('TODO: boilerplate', () => { it('TODO: boilerplate', () => {
// see: https://on.cypress.io/mounting-vue // see: https://on.cypress.io/mounting-vue
cy.vnMount(FilterTravelForm); cy.createWrapper(FilterTravelForm);
}); });
}); });

View File

@ -3,6 +3,6 @@ import FormModel from 'src/components/FormModel.vue';
describe.skip('<FormModel />', () => { describe.skip('<FormModel />', () => {
it('TODO: boilerplate', () => { it('TODO: boilerplate', () => {
// see: https://on.cypress.io/mounting-vue // see: https://on.cypress.io/mounting-vue
cy.vnMount(FormModel, { props: {} }); cy.createWrapper(FormModel, { props: {} });
}); });
}); });

View File

@ -3,6 +3,6 @@ import FormModelPopup from 'src/components/FormModelPopup.vue';
describe.skip('<FormModelPopup />', () => { describe.skip('<FormModelPopup />', () => {
it('TODO: boilerplate', () => { it('TODO: boilerplate', () => {
// see: https://on.cypress.io/mounting-vue // see: https://on.cypress.io/mounting-vue
cy.vnMount(FormModelPopup); cy.createWrapper(FormModelPopup);
}); });
}); });

View File

@ -3,6 +3,6 @@ import FormPopup from 'src/components/FormPopup.vue';
describe.skip('<FormPopup />', () => { describe.skip('<FormPopup />', () => {
it('TODO: boilerplate', () => { it('TODO: boilerplate', () => {
// see: https://on.cypress.io/mounting-vue // see: https://on.cypress.io/mounting-vue
cy.vnMount(FormPopup); cy.createWrapper(FormPopup);
}); });
}); });

View File

@ -3,6 +3,6 @@ import ItemsFilterPanel from 'src/components/ItemsFilterPanel.vue';
describe.skip('<ItemsFilterPanel />', () => { describe.skip('<ItemsFilterPanel />', () => {
it('TODO: boilerplate', () => { it('TODO: boilerplate', () => {
// see: https://on.cypress.io/mounting-vue // see: https://on.cypress.io/mounting-vue
cy.vnMount(ItemsFilterPanel); cy.createWrapper(ItemsFilterPanel);
}); });
}); });

View File

@ -3,6 +3,6 @@ import LeftMenu from 'src/components/LeftMenu.vue';
describe.skip('<LeftMenu />', () => { describe.skip('<LeftMenu />', () => {
it('TODO: boilerplate', () => { it('TODO: boilerplate', () => {
// see: https://on.cypress.io/mounting-vue // see: https://on.cypress.io/mounting-vue
cy.vnMount(LeftMenu); cy.createWrapper(LeftMenu);
}); });
}); });

View File

@ -3,6 +3,6 @@ import LeftMenuItem from 'src/components/LeftMenuItem.vue';
describe.skip('<LeftMenuItem />', () => { describe.skip('<LeftMenuItem />', () => {
it('TODO: boilerplate', () => { it('TODO: boilerplate', () => {
// see: https://on.cypress.io/mounting-vue // see: https://on.cypress.io/mounting-vue
cy.vnMount(LeftMenuItem); cy.createWrapper(LeftMenuItem);
}); });
}); });

View File

@ -3,6 +3,6 @@ import LeftMenuItemGroup from 'src/components/LeftMenuItemGroup.vue';
describe.skip('<LeftMenuItemGroup />', () => { describe.skip('<LeftMenuItemGroup />', () => {
it('TODO: boilerplate', () => { it('TODO: boilerplate', () => {
// see: https://on.cypress.io/mounting-vue // see: https://on.cypress.io/mounting-vue
cy.vnMount(LeftMenuItemGroup); cy.createWrapper(LeftMenuItemGroup);
}); });
}); });

View File

@ -3,6 +3,6 @@ import NavBar from 'src/components/NavBar.vue';
describe.skip('<NavBar />', () => { describe.skip('<NavBar />', () => {
it('TODO: boilerplate', () => { it('TODO: boilerplate', () => {
// see: https://on.cypress.io/mounting-vue // see: https://on.cypress.io/mounting-vue
cy.vnMount(NavBar); cy.createWrapper(NavBar);
}); });
}); });

View File

@ -3,6 +3,6 @@ import PinnedModules from 'src/components/PinnedModules.vue';
describe.skip('<PinnedModules />', () => { describe.skip('<PinnedModules />', () => {
it('TODO: boilerplate', () => { it('TODO: boilerplate', () => {
// see: https://on.cypress.io/mounting-vue // see: https://on.cypress.io/mounting-vue
cy.vnMount(PinnedModules); cy.createWrapper(PinnedModules);
}); });
}); });

View File

@ -3,6 +3,6 @@ import RefundInvoiceForm from 'src/components/RefundInvoiceForm.vue';
describe.skip('<RefundInvoiceForm />', () => { describe.skip('<RefundInvoiceForm />', () => {
it('TODO: boilerplate', () => { it('TODO: boilerplate', () => {
// see: https://on.cypress.io/mounting-vue // see: https://on.cypress.io/mounting-vue
cy.vnMount(RefundInvoiceForm); cy.createWrapper(RefundInvoiceForm);
}); });
}); });

View File

@ -3,6 +3,6 @@ import RegularizeStockForm from 'src/components/RegularizeStockForm.vue';
describe.skip('<RegularizeStockForm />', () => { describe.skip('<RegularizeStockForm />', () => {
it('TODO: boilerplate', () => { it('TODO: boilerplate', () => {
// see: https://on.cypress.io/mounting-vue // see: https://on.cypress.io/mounting-vue
cy.vnMount(RegularizeStockForm); cy.createWrapper(RegularizeStockForm);
}); });
}); });

View File

@ -3,6 +3,6 @@ import TransferInvoiceForm from 'src/components/TransferInvoiceForm.vue';
describe.skip('<TransferInvoiceForm />', () => { describe.skip('<TransferInvoiceForm />', () => {
it('TODO: boilerplate', () => { it('TODO: boilerplate', () => {
// see: https://on.cypress.io/mounting-vue // see: https://on.cypress.io/mounting-vue
cy.vnMount(TransferInvoiceForm); cy.createWrapper(TransferInvoiceForm);
}); });
}); });

View File

@ -3,6 +3,6 @@ import UserPanel from 'src/components/UserPanel.vue';
describe.skip('<UserPanel />', () => { describe.skip('<UserPanel />', () => {
it('TODO: boilerplate', () => { it('TODO: boilerplate', () => {
// see: https://on.cypress.io/mounting-vue // see: https://on.cypress.io/mounting-vue
cy.vnMount(UserPanel); cy.createWrapper(UserPanel);
}); });
}); });

View File

@ -1,87 +0,0 @@
import VnTitle from 'src/components/common/VnTitle.vue';
describe('<VnTitle />', () => {
it('renders text with link', () => {
cy.vnMount(VnTitle, {
props: {
url: 'https://example.com',
text: 'Example Link',
},
});
cy.get('a').should('exist');
cy.get('a').should('have.attr', 'href', 'https://example.com');
cy.get('a').should('contain.text', 'Example Link');
});
it('renders text without link', () => {
cy.vnMount(VnTitle, {
props: {
text: 'No Link',
},
});
cy.get('a').should('exist');
cy.get('a').should('not.have.attr', 'href');
cy.get('a').should('contain.text', 'No Link');
});
it('applies correct classes based on url prop', () => {
cy.vnMount(VnTitle, {
props: {
url: 'https://example.com',
},
});
cy.get('a').should('have.class', 'link');
cy.vnMount(VnTitle, {
props: {},
});
cy.get('a').should('have.class', 'color-vn-text');
});
it('displays icon when url is provided', () => {
cy.vnMount(VnTitle, {
props: {
url: 'https://example.com',
},
});
cy.get('.q-icon').should('exist');
});
it('does not display icon when url is not provided', () => {
cy.vnMount(VnTitle, {
props: {},
});
cy.get('.q-icon').should('not.exist');
});
it('applies correct cursor style based on url prop', () => {
cy.vnMount(VnTitle, {
props: {
url: 'https://example.com',
},
});
cy.get('.header-link').should('have.css', 'cursor', 'pointer');
cy.vnMount(VnTitle, {
props: {},
});
cy.get('.header-link').should('have.css', 'cursor', 'default');
});
it('renders default icon when no icon prop is provided', () => {
cy.vnMount(VnTitle, {
props: {
url: 'https://example.com',
},
});
cy.get('i').should('contain.text', 'open_in_new');
});
it('renders custom icon when icon prop is provided', () => {
cy.vnMount(VnTitle, {
props: {
url: 'https://example.com',
icon: 'custom_icon',
},
});
cy.get('i').should('contain.text', 'custom_icon');
});
});

View File

@ -3,6 +3,6 @@ import RightMenu from 'src/components/common/RightMenu.vue';
describe.skip('<RightMenu />', () => { describe.skip('<RightMenu />', () => {
it('TODO: boilerplate', () => { it('TODO: boilerplate', () => {
// see: https://on.cypress.io/mounting-vue // see: https://on.cypress.io/mounting-vue
cy.vnMount(RightMenu); cy.createWrapper(RightMenu);
}); });
}); });

View File

@ -3,7 +3,7 @@ import SendEmailDialog from 'src/components/common/SendEmailDialog.vue';
describe('<SendEmailDialog />', () => { describe('<SendEmailDialog />', () => {
it('TODO: boilerplate', () => { it('TODO: boilerplate', () => {
// see: https://on.cypress.io/mounting-vue // see: https://on.cypress.io/mounting-vue
cy.vnMount(SendEmailDialog, { props: { data: { address: '1234' } } }); cy.createWrapper(SendEmailDialog, { props: { data: { address: '1234' } } });
cy.get('input').type('1234'); cy.get('input').type('1234');
}); });
}); });

View File

@ -3,6 +3,6 @@ import SendSmsDialog from 'src/components/common/SendSmsDialog.vue';
describe.skip('<SendSmsDialog />', () => { describe.skip('<SendSmsDialog />', () => {
it('TODO: boilerplate', () => { it('TODO: boilerplate', () => {
// see: https://on.cypress.io/mounting-vue // see: https://on.cypress.io/mounting-vue
cy.vnMount(SendSmsDialog); cy.createWrapper(SendSmsDialog);
}); });
}); });

View File

@ -3,6 +3,6 @@ import TableVisibleColumns from 'src/components/common/TableVisibleColumns.vue';
describe.skip('<TableVisibleColumns />', () => { describe.skip('<TableVisibleColumns />', () => {
it('TODO: boilerplate', () => { it('TODO: boilerplate', () => {
// see: https://on.cypress.io/mounting-vue // see: https://on.cypress.io/mounting-vue
cy.vnMount(TableVisibleColumns); cy.createWrapper(TableVisibleColumns);
}); });
}); });

View File

@ -3,6 +3,6 @@ import VnAccountNumber from 'src/components/common/VnAccountNumber.vue';
describe.skip('<VnAccountNumber />', () => { describe.skip('<VnAccountNumber />', () => {
it('TODO: boilerplate', () => { it('TODO: boilerplate', () => {
// see: https://on.cypress.io/mounting-vue // see: https://on.cypress.io/mounting-vue
cy.vnMount(VnAccountNumber); cy.createWrapper(VnAccountNumber);
}); });
}); });

View File

@ -3,6 +3,6 @@ import VnBreadcrumbs from 'src/components/common/VnBreadcrumbs.vue';
describe.skip('<VnBreadcrumbs />', () => { describe.skip('<VnBreadcrumbs />', () => {
it('TODO: boilerplate', () => { it('TODO: boilerplate', () => {
// see: https://on.cypress.io/mounting-vue // see: https://on.cypress.io/mounting-vue
cy.vnMount(VnBreadcrumbs); cy.createWrapper(VnBreadcrumbs);
}); });
}); });

View File

@ -3,6 +3,6 @@ import VnCard from 'src/components/common/VnCard.vue';
describe.skip('<VnCard />', () => { describe.skip('<VnCard />', () => {
it('TODO: boilerplate', () => { it('TODO: boilerplate', () => {
// see: https://on.cypress.io/mounting-vue // see: https://on.cypress.io/mounting-vue
cy.vnMount(VnCard); cy.createWrapper(VnCard);
}); });
}); });

View File

@ -3,6 +3,6 @@ import VnComponent from 'src/components/common/VnComponent.vue';
describe.skip('<VnComponent />', () => { describe.skip('<VnComponent />', () => {
it('TODO: boilerplate', () => { it('TODO: boilerplate', () => {
// see: https://on.cypress.io/mounting-vue // see: https://on.cypress.io/mounting-vue
cy.vnMount(VnComponent); cy.createWrapper(VnComponent);
}); });
}); });

View File

@ -3,6 +3,6 @@ import VnDms from 'src/components/common/VnDms.vue';
describe.skip('<VnDms />', () => { describe.skip('<VnDms />', () => {
it('TODO: boilerplate', () => { it('TODO: boilerplate', () => {
// see: https://on.cypress.io/mounting-vue // see: https://on.cypress.io/mounting-vue
cy.vnMount(VnDms); cy.createWrapper(VnDms);
}); });
}); });

View File

@ -3,6 +3,6 @@ import VnDmsList from 'src/components/common/VnDmsList.vue';
describe.skip('<VnDmsList />', () => { describe.skip('<VnDmsList />', () => {
it('TODO: boilerplate', () => { it('TODO: boilerplate', () => {
// see: https://on.cypress.io/mounting-vue // see: https://on.cypress.io/mounting-vue
cy.vnMount(VnDmsList); cy.createWrapper(VnDmsList);
}); });
}); });

View File

@ -3,6 +3,6 @@ import VnInput from 'src/components/common/VnInput.vue';
describe.skip('<VnInput />', () => { describe.skip('<VnInput />', () => {
it('TODO: boilerplate', () => { it('TODO: boilerplate', () => {
// see: https://on.cypress.io/mounting-vue // see: https://on.cypress.io/mounting-vue
cy.vnMount(VnInput); cy.createWrapper(VnInput);
}); });
}); });

View File

@ -3,6 +3,6 @@ import VnInputDate from 'src/components/common/VnInputDate.vue';
describe.skip('<VnInputDate />', () => { describe.skip('<VnInputDate />', () => {
it('TODO: boilerplate', () => { it('TODO: boilerplate', () => {
// see: https://on.cypress.io/mounting-vue // see: https://on.cypress.io/mounting-vue
cy.vnMount(VnInputDate); cy.createWrapper(VnInputDate);
}); });
}); });

View File

@ -3,6 +3,6 @@ import VnInputNumber from 'src/components/common/VnInputNumber.vue';
describe.skip('<VnInputNumber />', () => { describe.skip('<VnInputNumber />', () => {
it('TODO: boilerplate', () => { it('TODO: boilerplate', () => {
// see: https://on.cypress.io/mounting-vue // see: https://on.cypress.io/mounting-vue
cy.vnMount(VnInputNumber); cy.createWrapper(VnInputNumber);
}); });
}); });

View File

@ -3,6 +3,6 @@ import VnInputTime from 'src/components/common/VnInputTime.vue';
describe.skip('<VnInputTime />', () => { describe.skip('<VnInputTime />', () => {
it('TODO: boilerplate', () => { it('TODO: boilerplate', () => {
// see: https://on.cypress.io/mounting-vue // see: https://on.cypress.io/mounting-vue
cy.vnMount(VnInputTime); cy.createWrapper(VnInputTime);
}); });
}); });

View File

@ -3,6 +3,6 @@ import VnJsonValue from 'src/components/common/VnJsonValue.vue';
describe.skip('<VnJsonValue />', () => { describe.skip('<VnJsonValue />', () => {
it('TODO: boilerplate', () => { it('TODO: boilerplate', () => {
// see: https://on.cypress.io/mounting-vue // see: https://on.cypress.io/mounting-vue
cy.vnMount(VnJsonValue); cy.createWrapper(VnJsonValue);
}); });
}); });

View File

@ -2,7 +2,7 @@ import VnLocation from 'src/components/common/VnLocation.vue';
describe.skip('<VnLocation />', () => { describe.skip('<VnLocation />', () => {
it('renders', () => { it('renders', () => {
// see: https://on.cypress.io/mounting-vue // see: https://on.cypress.io/mounting-vue
cy.vnMount(VnLocation, { cy.createWrapper(VnLocation, {
props: { props: {
modelValue: 1234, modelValue: 1234,
location: { location: {

View File

@ -3,6 +3,6 @@ import VnLog from 'src/components/common/VnLog.vue';
describe.skip('<VnLog />', () => { describe.skip('<VnLog />', () => {
it('TODO: boilerplate', () => { it('TODO: boilerplate', () => {
// see: https://on.cypress.io/mounting-vue // see: https://on.cypress.io/mounting-vue
cy.vnMount(VnLog); cy.createWrapper(VnLog);
}); });
}); });

View File

@ -3,6 +3,6 @@ import VnLogFilter from 'src/components/common/VnLogFilter.vue';
describe.skip('<VnLogFilter />', () => { describe.skip('<VnLogFilter />', () => {
it('TODO: boilerplate', () => { it('TODO: boilerplate', () => {
// see: https://on.cypress.io/mounting-vue // see: https://on.cypress.io/mounting-vue
cy.vnMount(VnLogFilter); cy.createWrapper(VnLogFilter);
}); });
}); });

View File

@ -3,6 +3,6 @@ import VnPopup from 'src/components/common/VnPopup.vue';
describe.skip('<VnPopup />', () => { describe.skip('<VnPopup />', () => {
it('TODO: boilerplate', () => { it('TODO: boilerplate', () => {
// see: https://on.cypress.io/mounting-vue // see: https://on.cypress.io/mounting-vue
cy.vnMount(VnPopup); cy.createWrapper(VnPopup);
}); });
}); });

View File

@ -3,6 +3,6 @@ import VnProgressModal from 'src/components/common/VnProgressModal.vue';
describe.skip('<VnProgressModal />', () => { describe.skip('<VnProgressModal />', () => {
it('TODO: boilerplate', () => { it('TODO: boilerplate', () => {
// see: https://on.cypress.io/mounting-vue // see: https://on.cypress.io/mounting-vue
cy.vnMount(VnProgressModal); cy.createWrapper(VnProgressModal);
}); });
}); });

View File

@ -3,6 +3,6 @@ import VnRadio from 'src/components/common/VnRadio.vue';
describe.skip('<VnRadio />', () => { describe.skip('<VnRadio />', () => {
it('TODO: boilerplate', () => { it('TODO: boilerplate', () => {
// see: https://on.cypress.io/mounting-vue // see: https://on.cypress.io/mounting-vue
cy.vnMount(VnRadio); cy.createWrapper(VnRadio);
}); });
}); });

View File

@ -3,7 +3,7 @@ import VnSectionMain from 'src/components/common/VnSectionMain.vue';
describe.skip('<VnSectionMain />', () => { describe.skip('<VnSectionMain />', () => {
it('TODO: boilerplate', () => { it('TODO: boilerplate', () => {
// see: https://on.cypress.io/mounting-vue // see: https://on.cypress.io/mounting-vue
cy.vnMount(VnSectionMain, { cy.createWrapper(VnSectionMain, {
props: { props: {
leftDrawer: true, leftDrawer: true,
}, },

View File

@ -3,6 +3,6 @@ import VnSelect from 'src/components/common/VnSelect.vue';
describe.skip('<VnSelect />', () => { describe.skip('<VnSelect />', () => {
it('TODO: boilerplate', () => { it('TODO: boilerplate', () => {
// see: https://on.cypress.io/mounting-vue // see: https://on.cypress.io/mounting-vue
cy.vnMount(VnSelect); cy.createWrapper(VnSelect);
}); });
}); });

View File

@ -3,6 +3,6 @@ import VnSelectCache from 'src/components/common/VnSelectCache.vue';
describe.skip('<VnSelectCache />', () => { describe.skip('<VnSelectCache />', () => {
it('TODO: boilerplate', () => { it('TODO: boilerplate', () => {
// see: https://on.cypress.io/mounting-vue // see: https://on.cypress.io/mounting-vue
cy.vnMount(VnSelectCache); cy.createWrapper(VnSelectCache);
}); });
}); });

View File

@ -3,6 +3,6 @@ import VnSelectDialog from 'src/components/common/VnSelectDialog.vue';
describe.skip('<VnSelectDialog />', () => { describe.skip('<VnSelectDialog />', () => {
it('TODO: boilerplate', () => { it('TODO: boilerplate', () => {
// see: https://on.cypress.io/mounting-vue // see: https://on.cypress.io/mounting-vue
cy.vnMount(VnSelectDialog); cy.createWrapper(VnSelectDialog);
}); });
}); });

View File

@ -3,6 +3,6 @@ import VnSelectEnum from 'src/components/common/VnSelectEnum.vue';
describe.skip('<VnSelectEnum />', () => { describe.skip('<VnSelectEnum />', () => {
it('TODO: boilerplate', () => { it('TODO: boilerplate', () => {
// see: https://on.cypress.io/mounting-vue // see: https://on.cypress.io/mounting-vue
cy.vnMount(VnSelectEnum); cy.createWrapper(VnSelectEnum);
}); });
}); });

View File

@ -3,6 +3,6 @@ import VnSmsDialog from 'src/components/common/VnSmsDialog.vue';
describe.skip('<VnSmsDialog />', () => { describe.skip('<VnSmsDialog />', () => {
it('TODO: boilerplate', () => { it('TODO: boilerplate', () => {
// see: https://on.cypress.io/mounting-vue // see: https://on.cypress.io/mounting-vue
cy.vnMount(VnSmsDialog); cy.createWrapper(VnSmsDialog);
}); });
}); });

View File

@ -3,6 +3,6 @@ import VnSummaryDialog from 'src/components/common/VnSummaryDialog.vue';
describe.skip('<VnSummaryDialog />', () => { describe.skip('<VnSummaryDialog />', () => {
it('TODO: boilerplate', () => { it('TODO: boilerplate', () => {
// see: https://on.cypress.io/mounting-vue // see: https://on.cypress.io/mounting-vue
cy.vnMount(VnSummaryDialog); cy.createWrapper(VnSummaryDialog);
}); });
}); });

View File

@ -2,7 +2,7 @@ import VnTitle from 'src/components/common/VnTitle.vue';
describe('<VnTitle />', () => { describe('<VnTitle />', () => {
it('renders text with link', () => { it('renders text with link', () => {
cy.vnMount(VnTitle, { cy.createWrapper(VnTitle, {
props: { props: {
url: 'https://example.com', url: 'https://example.com',
text: 'Example Link', text: 'Example Link',
@ -13,7 +13,7 @@ describe('<VnTitle />', () => {
cy.get('a').should('contain.text', 'Example Link'); cy.get('a').should('contain.text', 'Example Link');
}); });
it('renders text without link', () => { it('renders text without link', () => {
cy.vnMount(VnTitle, { cy.createWrapper(VnTitle, {
props: { props: {
text: 'No Link', text: 'No Link',
}, },
@ -24,21 +24,21 @@ describe('<VnTitle />', () => {
}); });
it('applies correct classes based on url prop', () => { it('applies correct classes based on url prop', () => {
cy.vnMount(VnTitle, { cy.createWrapper(VnTitle, {
props: { props: {
url: 'https://example.com', url: 'https://example.com',
}, },
}); });
cy.get('a').should('have.class', 'link'); cy.get('a').should('have.class', 'link');
cy.vnMount(VnTitle, { cy.createWrapper(VnTitle, {
props: {}, props: {},
}); });
cy.get('a').should('have.class', 'color-vn-text'); cy.get('a').should('have.class', 'color-vn-text');
}); });
it('displays icon when url is provided', () => { it('displays icon when url is provided', () => {
cy.vnMount(VnTitle, { cy.createWrapper(VnTitle, {
props: { props: {
url: 'https://example.com', url: 'https://example.com',
}, },
@ -47,27 +47,27 @@ describe('<VnTitle />', () => {
}); });
it('does not display icon when url is not provided', () => { it('does not display icon when url is not provided', () => {
cy.vnMount(VnTitle, { cy.createWrapper(VnTitle, {
props: {}, props: {},
}); });
cy.get('.q-icon').should('not.exist'); cy.get('.q-icon').should('not.exist');
}); });
it('applies correct cursor style based on url prop', () => { it('applies correct cursor style based on url prop', () => {
cy.vnMount(VnTitle, { cy.createWrapper(VnTitle, {
props: { props: {
url: 'https://example.com', url: 'https://example.com',
}, },
}); });
cy.get('.header-link').should('have.css', 'cursor', 'pointer'); cy.get('.header-link').should('have.css', 'cursor', 'pointer');
cy.vnMount(VnTitle, { cy.createWrapper(VnTitle, {
props: {}, props: {},
}); });
cy.get('.header-link').should('have.css', 'cursor', 'default'); cy.get('.header-link').should('have.css', 'cursor', 'default');
}); });
it('renders default icon when no icon prop is provided', () => { it('renders default icon when no icon prop is provided', () => {
cy.vnMount(VnTitle, { cy.createWrapper(VnTitle, {
props: { props: {
url: 'https://example.com', url: 'https://example.com',
}, },
@ -76,7 +76,7 @@ describe('<VnTitle />', () => {
}); });
it('renders custom icon when icon prop is provided', () => { it('renders custom icon when icon prop is provided', () => {
cy.vnMount(VnTitle, { cy.createWrapper(VnTitle, {
props: { props: {
url: 'https://example.com', url: 'https://example.com',
icon: 'custom_icon', icon: 'custom_icon',

View File

@ -3,6 +3,6 @@ import VnWeekdayPicker from 'src/components/common/VnWeekdayPicker.vue';
describe.skip('<VnWeekdayPicker />', () => { describe.skip('<VnWeekdayPicker />', () => {
it('TODO: boilerplate', () => { it('TODO: boilerplate', () => {
// see: https://on.cypress.io/mounting-vue // see: https://on.cypress.io/mounting-vue
cy.vnMount(VnWeekdayPicker); cy.createWrapper(VnWeekdayPicker);
}); });
}); });

View File

@ -3,6 +3,6 @@ import vnDiscount from 'src/components/common/vnDiscount.vue';
describe.skip('<vnDiscount />', () => { describe.skip('<vnDiscount />', () => {
it('TODO: boilerplate', () => { it('TODO: boilerplate', () => {
// see: https://on.cypress.io/mounting-vue // see: https://on.cypress.io/mounting-vue
cy.vnMount(vnDiscount); cy.createWrapper(vnDiscount);
}); });
}); });

View File

@ -3,6 +3,6 @@ import CardDescriptor from 'src/components/ui/CardDescriptor.vue';
describe.skip('<CardDescriptor />', () => { describe.skip('<CardDescriptor />', () => {
it('TODO: boilerplate', () => { it('TODO: boilerplate', () => {
// see: https://on.cypress.io/mounting-vue // see: https://on.cypress.io/mounting-vue
cy.vnMount(CardDescriptor); cy.createWrapper(CardDescriptor);
}); });
}); });

View File

@ -3,6 +3,6 @@ import CardList from 'src/components/ui/CardList.vue';
describe.skip('<CardList />', () => { describe.skip('<CardList />', () => {
it('TODO: boilerplate', () => { it('TODO: boilerplate', () => {
// see: https://on.cypress.io/mounting-vue // see: https://on.cypress.io/mounting-vue
cy.vnMount(CardList); cy.createWrapper(CardList);
}); });
}); });

View File

@ -3,6 +3,6 @@ import CardSummary from 'src/components/ui/CardSummary.vue';
describe.skip('<CardSummary />', () => { describe.skip('<CardSummary />', () => {
it('TODO: boilerplate', () => { it('TODO: boilerplate', () => {
// see: https://on.cypress.io/mounting-vue // see: https://on.cypress.io/mounting-vue
cy.vnMount(CardSummary); cy.createWrapper(CardSummary);
}); });
}); });

View File

@ -3,6 +3,6 @@ import CatalogItem from 'src/components/ui/CatalogItem.vue';
describe.skip('<CatalogItem />', () => { describe.skip('<CatalogItem />', () => {
it('TODO: boilerplate', () => { it('TODO: boilerplate', () => {
// see: https://on.cypress.io/mounting-vue // see: https://on.cypress.io/mounting-vue
cy.vnMount(CatalogItem); cy.createWrapper(CatalogItem);
}); });
}); });

View File

@ -3,6 +3,6 @@ import FetchedTags from 'src/components/ui/FetchedTags.vue';
describe.skip('<FetchedTags />', () => { describe.skip('<FetchedTags />', () => {
it('TODO: boilerplate', () => { it('TODO: boilerplate', () => {
// see: https://on.cypress.io/mounting-vue // see: https://on.cypress.io/mounting-vue
cy.vnMount(FetchedTags); cy.createWrapper(FetchedTags);
}); });
}); });

View File

@ -3,6 +3,6 @@ import QCalendarMonthWrapper from 'src/components/ui/QCalendarMonthWrapper.vue';
describe.skip('<QCalendarMonthWrapper />', () => { describe.skip('<QCalendarMonthWrapper />', () => {
it('TODO: boilerplate', () => { it('TODO: boilerplate', () => {
// see: https://on.cypress.io/mounting-vue // see: https://on.cypress.io/mounting-vue
cy.vnMount(QCalendarMonthWrapper); cy.createWrapper(QCalendarMonthWrapper);
}); });
}); });

View File

@ -3,6 +3,6 @@ import SkeletonDescriptor from 'src/components/ui/SkeletonDescriptor.vue';
describe.skip('<SkeletonDescriptor />', () => { describe.skip('<SkeletonDescriptor />', () => {
it('TODO: boilerplate', () => { it('TODO: boilerplate', () => {
// see: https://on.cypress.io/mounting-vue // see: https://on.cypress.io/mounting-vue
cy.vnMount(SkeletonDescriptor); cy.createWrapper(SkeletonDescriptor);
}); });
}); });

View File

@ -3,6 +3,6 @@ import SkeletonForm from 'src/components/ui/SkeletonForm.vue';
describe.skip('<SkeletonForm />', () => { describe.skip('<SkeletonForm />', () => {
it('TODO: boilerplate', () => { it('TODO: boilerplate', () => {
// see: https://on.cypress.io/mounting-vue // see: https://on.cypress.io/mounting-vue
cy.vnMount(SkeletonForm); cy.createWrapper(SkeletonForm);
}); });
}); });

View File

@ -3,6 +3,6 @@ import SkeletonSummary from 'src/components/ui/SkeletonSummary.vue';
describe.skip('<SkeletonSummary />', () => { describe.skip('<SkeletonSummary />', () => {
it('TODO: boilerplate', () => { it('TODO: boilerplate', () => {
// see: https://on.cypress.io/mounting-vue // see: https://on.cypress.io/mounting-vue
cy.vnMount(SkeletonSummary); cy.createWrapper(SkeletonSummary);
}); });
}); });

View File

@ -3,6 +3,6 @@ import SkeletonTable from 'src/components/ui/SkeletonTable.vue';
describe.skip('<SkeletonTable />', () => { describe.skip('<SkeletonTable />', () => {
it('TODO: boilerplate', () => { it('TODO: boilerplate', () => {
// see: https://on.cypress.io/mounting-vue // see: https://on.cypress.io/mounting-vue
cy.vnMount(SkeletonTable); cy.createWrapper(SkeletonTable);
}); });
}); });

View File

@ -3,6 +3,6 @@ import VnAvatar from 'src/components/ui/VnAvatar.vue';
describe.skip('<VnAvatar />', () => { describe.skip('<VnAvatar />', () => {
it('TODO: boilerplate', () => { it('TODO: boilerplate', () => {
// see: https://on.cypress.io/mounting-vue // see: https://on.cypress.io/mounting-vue
cy.vnMount(VnAvatar); cy.createWrapper(VnAvatar);
}); });
}); });

View File

@ -3,6 +3,6 @@ import VnConfirm from 'src/components/ui/VnConfirm.vue';
describe.skip('<VnConfirm />', () => { describe.skip('<VnConfirm />', () => {
it('TODO: boilerplate', () => { it('TODO: boilerplate', () => {
// see: https://on.cypress.io/mounting-vue // see: https://on.cypress.io/mounting-vue
cy.vnMount(VnConfirm); cy.createWrapper(VnConfirm);
}); });
}); });

View File

@ -3,6 +3,6 @@ import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue';
describe.skip('<VnFilterPanel />', () => { describe.skip('<VnFilterPanel />', () => {
it('TODO: boilerplate', () => { it('TODO: boilerplate', () => {
// see: https://on.cypress.io/mounting-vue // see: https://on.cypress.io/mounting-vue
cy.vnMount(VnFilterPanel); cy.createWrapper(VnFilterPanel);
}); });
}); });

View File

@ -3,6 +3,6 @@ import VnFilterPanelChip from 'src/components/ui/VnFilterPanelChip.vue';
describe.skip('<VnFilterPanelChip />', () => { describe.skip('<VnFilterPanelChip />', () => {
it('TODO: boilerplate', () => { it('TODO: boilerplate', () => {
// see: https://on.cypress.io/mounting-vue // see: https://on.cypress.io/mounting-vue
cy.vnMount(VnFilterPanelChip); cy.createWrapper(VnFilterPanelChip);
}); });
}); });

View File

@ -3,6 +3,6 @@ import VnImg from 'src/components/ui/VnImg.vue';
describe.skip('<VnImg />', () => { describe.skip('<VnImg />', () => {
it('TODO: boilerplate', () => { it('TODO: boilerplate', () => {
// see: https://on.cypress.io/mounting-vue // see: https://on.cypress.io/mounting-vue
cy.vnMount(VnImg); cy.createWrapper(VnImg);
}); });
}); });

View File

@ -3,6 +3,6 @@ import VnLinkPhone from 'src/components/ui/VnLinkPhone.vue';
describe.skip('<VnLinkPhone />', () => { describe.skip('<VnLinkPhone />', () => {
it('TODO: boilerplate', () => { it('TODO: boilerplate', () => {
// see: https://on.cypress.io/mounting-vue // see: https://on.cypress.io/mounting-vue
cy.vnMount(VnLinkPhone); cy.createWrapper(VnLinkPhone);
}); });
}); });

View File

@ -3,6 +3,6 @@ import VnLogo from 'src/components/ui/VnLogo.vue';
describe.skip('<VnLogo />', () => { describe.skip('<VnLogo />', () => {
it('TODO: boilerplate', () => { it('TODO: boilerplate', () => {
// see: https://on.cypress.io/mounting-vue // see: https://on.cypress.io/mounting-vue
cy.vnMount(VnLogo); cy.createWrapper(VnLogo);
}); });
}); });

View File

@ -3,6 +3,6 @@ import VnLv from 'src/components/ui/VnLv.vue';
describe.skip('<VnLv />', () => { describe.skip('<VnLv />', () => {
it('TODO: boilerplate', () => { it('TODO: boilerplate', () => {
// see: https://on.cypress.io/mounting-vue // see: https://on.cypress.io/mounting-vue
cy.vnMount(VnLv); cy.createWrapper(VnLv);
}); });
}); });

View File

@ -3,6 +3,6 @@ import VnNotes from 'src/components/ui/VnNotes.vue';
describe.skip('<VnNotes />', () => { describe.skip('<VnNotes />', () => {
it('TODO: boilerplate', () => { it('TODO: boilerplate', () => {
// see: https://on.cypress.io/mounting-vue // see: https://on.cypress.io/mounting-vue
cy.vnMount(VnNotes); cy.createWrapper(VnNotes);
}); });
}); });

View File

@ -3,6 +3,6 @@ import VnOutForm from 'src/components/ui/VnOutForm.vue';
describe.skip('<VnOutForm />', () => { describe.skip('<VnOutForm />', () => {
it('TODO: boilerplate', () => { it('TODO: boilerplate', () => {
// see: https://on.cypress.io/mounting-vue // see: https://on.cypress.io/mounting-vue
cy.vnMount(VnOutForm); cy.createWrapper(VnOutForm);
}); });
}); });

View File

@ -3,6 +3,6 @@ import VnPaginate from 'src/components/ui/VnPaginate.vue';
describe.skip('<VnPaginate />', () => { describe.skip('<VnPaginate />', () => {
it('TODO: boilerplate', () => { it('TODO: boilerplate', () => {
// see: https://on.cypress.io/mounting-vue // see: https://on.cypress.io/mounting-vue
cy.vnMount(VnPaginate); cy.createWrapper(VnPaginate);
}); });
}); });

View File

@ -3,6 +3,6 @@ import VnRow from 'src/components/ui/VnRow.vue';
describe.skip('<VnRow />', () => { describe.skip('<VnRow />', () => {
it('TODO: boilerplate', () => { it('TODO: boilerplate', () => {
// see: https://on.cypress.io/mounting-vue // see: https://on.cypress.io/mounting-vue
cy.vnMount(VnRow); cy.createWrapper(VnRow);
}); });
}); });

View File

@ -3,6 +3,6 @@ import VnSearchbar from 'src/components/ui/VnSearchbar.vue';
describe.skip('<VnSearchbar />', () => { describe.skip('<VnSearchbar />', () => {
it('TODO: boilerplate', () => { it('TODO: boilerplate', () => {
// see: https://on.cypress.io/mounting-vue // see: https://on.cypress.io/mounting-vue
cy.vnMount(VnSearchbar); cy.createWrapper(VnSearchbar);
}); });
}); });

View File

@ -3,6 +3,6 @@ import VnSms from 'src/components/ui/VnSms.vue';
describe.skip('<VnSms />', () => { describe.skip('<VnSms />', () => {
it('TODO: boilerplate', () => { it('TODO: boilerplate', () => {
// see: https://on.cypress.io/mounting-vue // see: https://on.cypress.io/mounting-vue
cy.vnMount(VnSms); cy.createWrapper(VnSms);
}); });
}); });

View File

@ -3,6 +3,6 @@ import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
describe.skip('<VnSubToolbar />', () => { describe.skip('<VnSubToolbar />', () => {
it('TODO: boilerplate', () => { it('TODO: boilerplate', () => {
// see: https://on.cypress.io/mounting-vue // see: https://on.cypress.io/mounting-vue
cy.vnMount(VnSubToolbar); cy.createWrapper(VnSubToolbar);
}); });
}); });

View File

@ -3,6 +3,6 @@ import VnUserLink from 'src/components/ui/VnUserLink.vue';
describe.skip('<VnUserLink />', () => { describe.skip('<VnUserLink />', () => {
it('TODO: boilerplate', () => { it('TODO: boilerplate', () => {
// see: https://on.cypress.io/mounting-vue // see: https://on.cypress.io/mounting-vue
cy.vnMount(VnUserLink); cy.createWrapper(VnUserLink);
}); });
}); });

View File

@ -1,7 +1,7 @@
import { createTestingPinia } from '@pinia/testing'; import { createTestingPinia } from '@pinia/testing';
import { mount } from 'cypress/vue'; import { mount } from 'cypress/vue';
import { i18n } from 'src/boot/i18n'; import { i18n } from 'src/boot/i18n';
import { Quasar } from 'quasar';
const pinia = createTestingPinia({ createSpy: () => {}, stubActions: false }); const pinia = createTestingPinia({ createSpy: () => {}, stubActions: false });
// // Run this code before each *test*. // // Run this code before each *test*.
@ -16,7 +16,7 @@ const pinia = createTestingPinia({ createSpy: () => {}, stubActions: false });
function createWrapper(component, options) { function createWrapper(component, options) {
const defaultOptions = { const defaultOptions = {
global: { global: {
plugins: [i18n, pinia], plugins: [Quasar, i18n, pinia],
}, },
mocks: { mocks: {
t: (tKey) => tKey, t: (tKey) => tKey,
@ -48,33 +48,3 @@ function createWrapper(component, options) {
// } // }
Cypress.Commands.add('createWrapper', createWrapper); Cypress.Commands.add('createWrapper', createWrapper);
// Cypress.Commands.add('mount', mount);
import { shallowMount } from '@vue/test-utils';
import { Quasar } from 'quasar';
Cypress.Commands.add('vnMount', (component, options = {}) => {
const globalConfig = {
global: {
stubs: ['router-view', 'vue-i18n'],
plugins: [Quasar, i18n, pinia],
mocks: { t: (key) => key },
},
};
// options.global = options.global || {};
// options.global.stubs = options.global.stubs || {};
// options.global.stubs.transition = false;
// options.global.components = options.global.components || {};
// options.global.plugins = options.global.plugins || [];
// Use store passed in from options, or initialize a new one
// const { /* store = getStore(), */ ...mountOptions } = options;
// Add plugins here
// options.global.plugins.push({
// install(app) {
// app.use(i18n);
// },
// });
console.log({ ...globalConfig, ...options });
return shallowMount(component, { ...globalConfig, ...options });
});