feat: refs #7220 #7220 boilerplates all tests. Include generator
gitea/salix-front/pipeline/pr-dev There was a failure building this commit Details

This commit is contained in:
Javier Segarra 2024-09-25 22:51:51 +02:00
parent cc709002e1
commit 653fd28e06
58 changed files with 558 additions and 0 deletions

45
generate-tests.js Normal file
View File

@ -0,0 +1,45 @@
const fs = require('fs');
const path = require('path');
// Ruta de la carpeta de componentes
// Ruta de la carpeta de pruebas
['common', 'ui'].forEach((folder) => {
generateTest(folder);
});
function generateTest(type) {
const componentsDir = path.join(__dirname, `src/components/${type}`);
const testDir = path.join(__dirname, `test/cypress/components/${type}`);
// Leer todos los archivos en la carpeta de componentes
fs.readdir(componentsDir, (err, files) => {
if (err) return console.error('Error leyendo la carpeta de componentes:', err);
// Filtrar solo archivos .vue
const vueFiles = files.filter((file) => file.endsWith('.vue'));
vueFiles.forEach((file) => {
const componentName = path.basename(file, '.vue');
const testFileName = `${componentName}.spec.js`;
const testFilePath = path.join(testDir, testFileName);
// Contenido del archivo de prueba
const testFileContent = `
import ${componentName} from 'src/components/${type}/${file}';
describe('<${componentName} />', () => {
it('TODO: boilerplate', () => {
// see: https://on.cypress.io/mounting-vue
cy.vnMount(${componentName});
});
});
`;
// Escribir el archivo de prueba
fs.writeFile(testFilePath, testFileContent, (err) => {
if (err)
return console.error('Error escribiendo el archivo de prueba:', err);
console.log(`Archivo de prueba generado: ${testFileName}`);
});
});
});
}

View File

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

View File

@ -0,0 +1,9 @@
import SendEmailDialog from 'src/components/common/SendEmailDialog.vue';
describe('<SendEmailDialog />', () => {
it('TODO: boilerplate', () => {
// see: https://on.cypress.io/mounting-vue
cy.vnMount(SendEmailDialog);
});
});

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -0,0 +1,9 @@
import VnLocation from 'src/components/common/VnLocation.vue';
describe('<VnLocation />', () => {
it('TODO: boilerplate', () => {
// see: https://on.cypress.io/mounting-vue
cy.vnMount(VnLocation);
});
});

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -0,0 +1,9 @@
import VnSectionMain from 'src/components/common/VnSectionMain.vue';
describe('<VnSectionMain />', () => {
it('TODO: boilerplate', () => {
// see: https://on.cypress.io/mounting-vue
cy.vnMount(VnSectionMain);
});
});

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -0,0 +1,9 @@
import VnTitle from 'src/components/common/VnTitle.vue';
describe('<VnTitle />', () => {
it('TODO: boilerplate', () => {
// see: https://on.cypress.io/mounting-vue
cy.vnMount(VnTitle);
});
});

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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