{{ t(`filterPanel.${tag.label}`) }}:
diff --git a/src/pages/Zone/ZoneList.vue b/src/pages/Zone/ZoneList.vue
index 357ef871e..e4a1774fe 100644
--- a/src/pages/Zone/ZoneList.vue
+++ b/src/pages/Zone/ZoneList.vue
@@ -1,7 +1,7 @@
+ (validAddresses = data)"
+ />
@@ -156,8 +205,10 @@ onMounted(() => (stateStore.rightDrawer = true));
:columns="columns"
redirect="zone"
:right-search="false"
- auto-load
>
+
+ {{ showValidAddresses(row) }}
+
import('src/components/common/VnSectionMain.vue'),
- redirect: { name: 'AccountList' },
+ component: () => import('src/components/common/VnModule.vue'),
+ redirect: { name: 'AccountIndexMain' },
children: [
{
- path: 'list',
- name: 'AccountList',
- meta: {
- title: 'list',
- icon: 'view_list',
- },
+ path: '',
+ name: 'AccountIndexMain',
+ redirect: { name: 'AccountList' },
component: () => import('src/pages/Account/AccountList.vue'),
+ children: [
+ {
+ name: 'AccountList',
+ path: 'list',
+ meta: {
+ title: 'list',
+ icon: 'view_list',
+ },
+ },
+ accountCard,
+ ],
},
{
- path: 'role-list',
+ path: 'role',
name: 'AccountRoles',
+ redirect: { name: 'AccountRoleList' },
meta: {
title: 'roles',
icon: 'group',
},
component: () => import('src/pages/Account/Role/AccountRoles.vue'),
+ children: [
+ {
+ name: 'AccountRoleList',
+ path: 'list',
+ },
+ roleCard,
+ ],
},
{
- path: 'alias-list',
- name: 'AccountAliasList',
+ path: 'alias',
+ name: 'AccountAlias',
+ redirect: { name: 'AccountAliasList' },
meta: {
title: 'alias',
icon: 'email',
},
component: () => import('src/pages/Account/AccountAliasList.vue'),
+ children: [
+ {
+ name: 'AccountAliasList',
+ path: 'list',
+ },
+ aliasCard,
+ ],
},
{
path: 'acls',
@@ -120,81 +137,5 @@ export default {
},
],
},
- {
- name: 'AccountCard',
- path: ':id',
- component: () => import('src/pages/Account/Card/AccountCard.vue'),
- redirect: { name: 'AccountSummary' },
- children: [
- {
- name: 'AccountSummary',
- path: 'summary',
- meta: {
- title: 'summary',
- icon: 'launch',
- },
- component: () => import('src/pages/Account/Card/AccountSummary.vue'),
- },
- {
- name: 'AccountBasicData',
- path: 'basic-data',
- meta: {
- title: 'basicData',
- icon: 'vn:settings',
- },
- component: () =>
- import('src/pages/Account/Card/AccountBasicData.vue'),
- },
- {
- name: 'AccountInheritedRoles',
- path: 'inherited-roles',
- meta: {
- title: 'inheritedRoles',
- icon: 'group',
- },
- component: () =>
- import('src/pages/Account/Card/AccountInheritedRoles.vue'),
- },
- {
- name: 'AccountMailForwarding',
- path: 'mail-forwarding',
- meta: {
- title: 'mailForwarding',
- icon: 'forward',
- },
- component: () =>
- import('src/pages/Account/Card/AccountMailForwarding.vue'),
- },
- {
- name: 'AccountMailAlias',
- path: 'mail-alias',
- meta: {
- title: 'mailAlias',
- icon: 'email',
- },
- component: () =>
- import('src/pages/Account/Card/AccountMailAlias.vue'),
- },
- {
- name: 'AccountPrivileges',
- path: 'privileges',
- meta: {
- title: 'privileges',
- icon: 'badge',
- },
- component: () =>
- import('src/pages/Account/Card/AccountPrivileges.vue'),
- },
- {
- name: 'AccountLog',
- path: 'log',
- meta: {
- title: 'log',
- icon: 'history',
- },
- component: () => import('src/pages/Account/Card/AccountLog.vue'),
- },
- ],
- },
],
};
diff --git a/src/router/modules/account/accountCard.js b/src/router/modules/account/accountCard.js
new file mode 100644
index 000000000..3ba687adf
--- /dev/null
+++ b/src/router/modules/account/accountCard.js
@@ -0,0 +1,81 @@
+export default {
+ name: 'AccountCard',
+ path: ':id',
+ redirect: { name: 'AccountSummary' },
+ component: () => import('src/pages/Account/Card/AccountCard.vue'),
+ meta: {
+ menu: [
+ 'AccountBasicData',
+ 'AccountInheritedRoles',
+ 'AccountMailForwarding',
+ 'AccountMailAlias',
+ 'AccountPrivileges',
+ 'AccountLog',
+ ],
+ },
+ children: [
+ {
+ name: 'AccountSummary',
+ path: 'summary',
+ meta: {
+ title: 'summary',
+ icon: 'launch',
+ },
+ component: () => import('src/pages/Account/Card/AccountSummary.vue'),
+ },
+ {
+ name: 'AccountBasicData',
+ path: 'basic-data',
+ meta: {
+ title: 'basicData',
+ icon: 'vn:settings',
+ },
+ component: () => import('src/pages/Account/Card/AccountBasicData.vue'),
+ },
+ {
+ name: 'AccountInheritedRoles',
+ path: 'inherited-roles',
+ meta: {
+ title: 'inheritedRoles',
+ icon: 'group',
+ },
+ component: () => import('src/pages/Account/Card/AccountInheritedRoles.vue'),
+ },
+ {
+ name: 'AccountMailForwarding',
+ path: 'mail-forwarding',
+ meta: {
+ title: 'mailForwarding',
+ icon: 'forward',
+ },
+ component: () => import('src/pages/Account/Card/AccountMailForwarding.vue'),
+ },
+ {
+ name: 'AccountMailAlias',
+ path: 'mail-alias',
+ meta: {
+ title: 'mailAlias',
+ icon: 'email',
+ },
+ component: () => import('src/pages/Account/Card/AccountMailAlias.vue'),
+ },
+ {
+ name: 'AccountPrivileges',
+ path: 'privileges',
+ meta: {
+ title: 'privileges',
+ icon: 'badge',
+ },
+ component: () => import('src/pages/Account/Card/AccountPrivileges.vue'),
+ },
+ {
+ name: 'AccountLog',
+ path: 'log',
+ meta: {
+ title: 'log',
+ icon: 'history',
+ },
+ component: () => import('src/pages/Account/Card/AccountLog.vue'),
+ },
+ ],
+};
diff --git a/src/router/modules/account/aliasCard.js b/src/router/modules/account/aliasCard.js
new file mode 100644
index 000000000..cbbd31e51
--- /dev/null
+++ b/src/router/modules/account/aliasCard.js
@@ -0,0 +1,36 @@
+export default {
+ name: 'AliasCard',
+ path: ':id',
+ component: () => import('src/pages/Account/Alias/Card/AliasCard.vue'),
+ redirect: { name: 'AliasSummary' },
+ meta: { menu: ['AliasBasicData', 'AliasUsers'] },
+ children: [
+ {
+ name: 'AliasSummary',
+ path: 'summary',
+ meta: {
+ title: 'summary',
+ icon: 'launch',
+ },
+ component: () => import('src/pages/Account/Alias/Card/AliasSummary.vue'),
+ },
+ {
+ name: 'AliasBasicData',
+ path: 'basic-data',
+ meta: {
+ title: 'basicData',
+ icon: 'vn:settings',
+ },
+ component: () => import('src/pages/Account/Alias/Card/AliasBasicData.vue'),
+ },
+ {
+ name: 'AliasUsers',
+ path: 'users',
+ meta: {
+ title: 'aliasUsers',
+ icon: 'group',
+ },
+ component: () => import('src/pages/Account/Alias/Card/AliasUsers.vue'),
+ },
+ ],
+};
diff --git a/src/router/modules/account/roleCard.js b/src/router/modules/account/roleCard.js
new file mode 100644
index 000000000..c36ce71b9
--- /dev/null
+++ b/src/router/modules/account/roleCard.js
@@ -0,0 +1,57 @@
+export default {
+ name: 'RoleCard',
+ path: ':id',
+ component: () => import('src/pages/Account/Role/Card/RoleCard.vue'),
+ redirect: { name: 'RoleSummary' },
+ meta: {
+ menu: ['RoleBasicData', 'SubRoles', 'InheritedRoles', 'RoleLog'],
+ },
+ children: [
+ {
+ name: 'RoleSummary',
+ path: 'summary',
+ meta: {
+ title: 'summary',
+ icon: 'launch',
+ },
+ component: () => import('src/pages/Account/Role/Card/RoleSummary.vue'),
+ },
+ {
+ name: 'RoleBasicData',
+ path: 'basic-data',
+ meta: {
+ title: 'basicData',
+ icon: 'vn:settings',
+ },
+ component: () => import('src/pages/Account/Role/Card/RoleBasicData.vue'),
+ },
+ {
+ name: 'SubRoles',
+ path: 'sub-roles',
+ meta: {
+ title: 'subRoles',
+ icon: 'group',
+ },
+ component: () => import('src/pages/Account/Role/Card/SubRoles.vue'),
+ },
+
+ {
+ name: 'InheritedRoles',
+ path: 'inherited-roles',
+ meta: {
+ title: 'inheritedRoles',
+ icon: 'account_tree',
+ },
+ component: () => import('src/pages/Account/Role/Card/InheritedRoles.vue'),
+ },
+ {
+ name: 'RoleLog',
+ path: 'log',
+ meta: {
+ title: 'log',
+ icon: 'history',
+ },
+ component: () => import('src/pages/Account/Role/Card/RoleLog.vue'),
+ },
+ ],
+};
diff --git a/src/router/modules/claim.js b/src/router/modules/claim.js
index b58a58e8d..8b0a70896 100644
--- a/src/router/modules/claim.js
+++ b/src/router/modules/claim.js
@@ -27,7 +27,7 @@ export default {
{
name: 'ClaimMain',
path: '',
- component: () => import('src/components/common/VnSectionMain.vue'),
+ component: () => import('src/components/common/VnModule.vue'),
redirect: { name: 'ClaimList' },
children: [
{
diff --git a/src/router/modules/customer.js b/src/router/modules/customer.js
index 1b707f1a2..9e7f6fe70 100644
--- a/src/router/modules/customer.js
+++ b/src/router/modules/customer.js
@@ -39,7 +39,7 @@ export default {
{
path: '',
name: 'CustomerMain',
- component: () => import('src/components/common/VnSectionMain.vue'),
+ component: () => import('src/components/common/VnModule.vue'),
redirect: { name: 'CustomerList' },
children: [
{
diff --git a/src/router/modules/entry.js b/src/router/modules/entry.js
index 3add239df..26ce773c5 100644
--- a/src/router/modules/entry.js
+++ b/src/router/modules/entry.js
@@ -25,7 +25,7 @@ export default {
{
path: '',
name: 'EntryMain',
- component: () => import('src/components/common/VnSectionMain.vue'),
+ component: () => import('src/components/common/VnModule.vue'),
redirect: { name: 'EntryList' },
children: [
{
diff --git a/src/router/modules/index.js b/src/router/modules/index.js
index bf7e46b00..f28fed1c2 100644
--- a/src/router/modules/index.js
+++ b/src/router/modules/index.js
@@ -8,7 +8,7 @@ import Worker from './worker';
import Shelving from './shelving';
import Wagon from './wagon';
import Route from './route';
-import Supplier from './Supplier';
+import Supplier from './supplier';
import Travel from './travel';
import Order from './order';
import Department from './department';
@@ -20,8 +20,6 @@ import ItemType from './itemType';
import Zone from './zone';
import Account from './account';
import Monitor from './monitor';
-import MailAlias from './mailAlias';
-import Role from './role';
export default [
Item,
@@ -45,7 +43,5 @@ export default [
ItemType,
Zone,
Account,
- MailAlias,
Monitor,
- Role,
];
diff --git a/src/router/modules/invoiceIn.js b/src/router/modules/invoiceIn.js
index 168d64f37..788b27d37 100644
--- a/src/router/modules/invoiceIn.js
+++ b/src/router/modules/invoiceIn.js
@@ -25,7 +25,7 @@ export default {
{
path: '',
name: 'InvoiceInMain',
- component: () => import('src/components/common/VnSectionMain.vue'),
+ component: () => import('src/components/common/VnModule.vue'),
redirect: { name: 'InvoiceInList' },
children: [
{
diff --git a/src/router/modules/invoiceOut.js b/src/router/modules/invoiceOut.js
index 5e83b0859..53d27d0e8 100644
--- a/src/router/modules/invoiceOut.js
+++ b/src/router/modules/invoiceOut.js
@@ -18,7 +18,7 @@ export default {
{
path: '',
name: 'InvoiceOutMain',
- component: () => import('src/components/common/VnSectionMain.vue'),
+ component: () => import('src/components/common/VnModule.vue'),
redirect: { name: 'InvoiceOutList' },
children: [
{
diff --git a/src/router/modules/item.js b/src/router/modules/item.js
index 0f810434c..e2afd6c7b 100644
--- a/src/router/modules/item.js
+++ b/src/router/modules/item.js
@@ -36,7 +36,7 @@ export default {
{
path: '',
name: 'ItemMain',
- component: () => import('src/components/common/VnSectionMain.vue'),
+ component: () => import('src/components/common/VnModule.vue'),
redirect: { name: 'ItemList' },
children: [
{
diff --git a/src/router/modules/mailAlias.js b/src/router/modules/mailAlias.js
deleted file mode 100644
index 8e0f8abdc..000000000
--- a/src/router/modules/mailAlias.js
+++ /dev/null
@@ -1,57 +0,0 @@
-import { RouterView } from 'vue-router';
-
-export default {
- path: 'account/alias',
- name: 'Alias',
- meta: {
- title: 'alias',
- icon: 'email',
- moduleName: 'Alias',
- },
- component: RouterView,
- redirect: { name: 'AccountAliasList' },
- menus: {
- main: [],
- card: ['AliasBasicData', 'AliasUsers'],
- },
- children: [
- {
- name: 'AliasCard',
- path: ':id',
- component: () => import('src/pages/Account/Alias/Card/AliasCard.vue'),
- redirect: { name: 'AliasSummary' },
- children: [
- {
- name: 'AliasSummary',
- path: 'summary',
- meta: {
- title: 'summary',
- icon: 'launch',
- },
- component: () =>
- import('src/pages/Account/Alias/Card/AliasSummary.vue'),
- },
- {
- name: 'AliasBasicData',
- path: 'basic-data',
- meta: {
- title: 'basicData',
- icon: 'vn:settings',
- },
- component: () =>
- import('src/pages/Account/Alias/Card/AliasBasicData.vue'),
- },
- {
- name: 'AliasUsers',
- path: 'users',
- meta: {
- title: 'aliasUsers',
- icon: 'group',
- },
- component: () =>
- import('src/pages/Account/Alias/Card/AliasUsers.vue'),
- },
- ],
- },
- ],
-};
diff --git a/src/router/modules/monitor.js b/src/router/modules/monitor.js
index 7342a5904..89ba4078f 100644
--- a/src/router/modules/monitor.js
+++ b/src/router/modules/monitor.js
@@ -19,7 +19,8 @@ export default {
{
path: '',
name: 'MonitorMain',
- component: () => import('src/components/common/VnSectionMain.vue'),
+ component: () => import('src/components/common/VnModule.vue'),
+ props: (route) => ({ leftDrawer: route.name === 'MonitorClientsActions' }),
redirect: { name: 'MonitorTickets' },
children: [
{
diff --git a/src/router/modules/order.js b/src/router/modules/order.js
index bfa37fce5..77af812cf 100644
--- a/src/router/modules/order.js
+++ b/src/router/modules/order.js
@@ -19,7 +19,7 @@ export default {
{
path: '',
name: 'OrderMain',
- component: () => import('src/components/common/VnSectionMain.vue'),
+ component: () => import('src/components/common/VnModule.vue'),
redirect: { name: 'OrderList' },
children: [
{
diff --git a/src/router/modules/role.js b/src/router/modules/role.js
deleted file mode 100644
index 47cd10b18..000000000
--- a/src/router/modules/role.js
+++ /dev/null
@@ -1,76 +0,0 @@
-import { RouterView } from 'vue-router';
-
-export default {
- path: 'account/role',
- name: 'Role',
- meta: {
- title: 'role',
- icon: 'vn:greuge',
- moduleName: 'Role',
- },
- component: RouterView,
- redirect: { name: 'AccountRoles' },
- menus: {
- main: [],
- card: ['RoleBasicData', 'SubRoles', 'InheritedRoles', 'RoleLog'],
- },
- children: [
- {
- name: 'RoleCard',
- path: ':id',
- component: () => import('src/pages/Account/Role/Card/RoleCard.vue'),
- redirect: { name: 'RoleSummary' },
- children: [
- {
- name: 'RoleSummary',
- path: 'summary',
- meta: {
- title: 'summary',
- icon: 'launch',
- },
- component: () =>
- import('src/pages/Account/Role/Card/RoleSummary.vue'),
- },
- {
- name: 'RoleBasicData',
- path: 'basic-data',
- meta: {
- title: 'basicData',
- icon: 'vn:settings',
- },
- component: () =>
- import('src/pages/Account/Role/Card/RoleBasicData.vue'),
- },
- {
- name: 'SubRoles',
- path: 'sub-roles',
- meta: {
- title: 'subRoles',
- icon: 'group',
- },
- component: () => import('src/pages/Account/Role/Card/SubRoles.vue'),
- },
-
- {
- name: 'InheritedRoles',
- path: 'inherited-roles',
- meta: {
- title: 'inheritedRoles',
- icon: 'account_tree',
- },
- component: () =>
- import('src/pages/Account/Role/Card/InheritedRoles.vue'),
- },
- {
- name: 'RoleLog',
- path: 'log',
- meta: {
- title: 'log',
- icon: 'history',
- },
- component: () => import('src/pages/Account/Role/Card/RoleLog.vue'),
- },
- ],
- },
- ],
-};
diff --git a/src/router/modules/route.js b/src/router/modules/route.js
index 9a7b16df3..a6c4f30a2 100644
--- a/src/router/modules/route.js
+++ b/src/router/modules/route.js
@@ -25,7 +25,7 @@ export default {
{
path: '/route',
name: 'RouteMain',
- component: () => import('src/components/common/VnSectionMain.vue'),
+ component: () => import('src/components/common/VnModule.vue'),
redirect: { name: 'RouteList' },
children: [
{
diff --git a/src/router/modules/shelving.js b/src/router/modules/shelving.js
index b7f50a3b6..9cc6bcef1 100644
--- a/src/router/modules/shelving.js
+++ b/src/router/modules/shelving.js
@@ -18,14 +18,14 @@ export default {
{
path: '',
name: 'ShelvingMain',
- component: () => import('src/components/common/VnSectionMain.vue'),
+ component: () => import('src/components/common/VnModule.vue'),
redirect: { name: 'ShelvingList' },
children: [
{
path: 'list',
name: 'ShelvingList',
meta: {
- title: 'shelvingList',
+ title: 'list',
icon: 'view_list',
},
component: () => import('src/pages/Shelving/ShelvingList.vue'),
diff --git a/src/router/modules/Supplier.js b/src/router/modules/supplier.js
similarity index 98%
rename from src/router/modules/Supplier.js
rename to src/router/modules/supplier.js
index c08fb5961..647f4bdd3 100644
--- a/src/router/modules/Supplier.js
+++ b/src/router/modules/supplier.js
@@ -30,7 +30,7 @@ export default {
{
path: '',
name: 'SupplierMain',
- component: () => import('src/components/common/VnSectionMain.vue'),
+ component: () => import('src/components/common/VnModule.vue'),
redirect: { name: 'SupplierList' },
children: [
{
diff --git a/src/router/modules/ticket.js b/src/router/modules/ticket.js
index 6e407b88b..600b64c14 100644
--- a/src/router/modules/ticket.js
+++ b/src/router/modules/ticket.js
@@ -1,19 +1,12 @@
import { RouterView } from 'vue-router';
-export default {
- name: 'Ticket',
- path: '/ticket',
+const ticketCard = {
+ name: 'TicketCard',
+ path: ':id',
+ component: () => import('src/pages/Ticket/Card/TicketCard.vue'),
+ redirect: { name: 'TicketSummary' },
meta: {
- title: 'tickets',
- icon: 'vn:ticket',
- moduleName: 'Ticket',
- keyBinding: 't',
- },
- component: RouterView,
- redirect: { name: 'TicketMain' },
- menus: {
- main: ['TicketList', 'TicketAdvance', 'TicketWeekly', 'TicketFuture'],
- card: [
+ menu: [
'TicketBasicData',
'TicketSale',
'TicketLog',
@@ -32,21 +25,200 @@ export default {
'TicketSms',
],
},
+ children: [
+ {
+ path: 'summary',
+ name: 'TicketSummary',
+ meta: {
+ title: 'summary',
+ icon: 'launch',
+ },
+ component: () => import('src/pages/Ticket/Card/TicketSummary.vue'),
+ },
+ {
+ path: 'basic-data',
+ name: 'TicketBasicData',
+ meta: {
+ title: 'basicData',
+ icon: 'vn:settings',
+ },
+ component: () =>
+ import('src/pages/Ticket/Card/BasicData/TicketBasicDataView.vue'),
+ },
+ {
+ path: 'sale',
+ name: 'TicketSale',
+ meta: {
+ title: 'sale',
+ icon: 'vn:lines',
+ },
+ component: () => import('src/pages/Ticket/Card/TicketSale.vue'),
+ },
+ {
+ path: 'request',
+ name: 'TicketPurchaseRequest',
+ meta: {
+ title: 'purchaseRequest',
+ icon: 'vn:buyrequest',
+ },
+ component: () => import('src/pages/Ticket/Card/TicketPurchaseRequest.vue'),
+ },
+ {
+ path: 'tracking',
+ name: 'TicketTracking',
+ meta: {
+ title: 'tracking',
+ icon: 'vn:eye',
+ },
+ component: () => import('src/pages/Ticket/Card/TicketTracking.vue'),
+ },
+ {
+ path: 'log',
+ name: 'TicketLog',
+ meta: {
+ title: 'log',
+ icon: 'history',
+ },
+ component: () => import('src/pages/Ticket/Card/TicketLog.vue'),
+ },
+ {
+ path: 'observation',
+ name: 'TicketNotes',
+ meta: {
+ title: 'notes',
+ icon: 'vn:notes',
+ },
+ component: () => import('src/pages/Ticket/Card/TicketNotes.vue'),
+ },
+ {
+ path: 'picture',
+ name: 'TicketPicture',
+ meta: {
+ title: 'pictures',
+ icon: 'vn:photo',
+ },
+ component: () => import('src/pages/Ticket/Card/TicketPicture.vue'),
+ },
+ {
+ path: 'volume',
+ name: 'TicketVolume',
+ meta: {
+ title: 'volume',
+ icon: 'vn:volume',
+ },
+ component: () => import('src/pages/Ticket/Card/TicketVolume.vue'),
+ },
+ {
+ path: 'expedition',
+ name: 'TicketExpedition',
+ meta: {
+ title: 'expedition',
+ icon: 'vn:package',
+ },
+ component: () => import('src/pages/Ticket/Card/TicketExpedition.vue'),
+ },
+ {
+ path: 'service',
+ name: 'TicketService',
+ meta: {
+ title: 'services',
+ icon: 'vn:services',
+ },
+ component: () => import('src/pages/Ticket/Card/TicketService.vue'),
+ },
+ {
+ path: 'package',
+ name: 'TicketPackage',
+ meta: {
+ title: 'packages',
+ icon: 'vn:bucket',
+ },
+ component: () => import('src/pages/Ticket/Card/TicketPackage.vue'),
+ },
+ {
+ path: 'components',
+ name: 'TicketComponents',
+ meta: {
+ title: 'components',
+ icon: 'vn:components',
+ },
+ component: () => import('src/pages/Ticket/Card/TicketComponents.vue'),
+ },
+
+ {
+ path: 'sale-tracking',
+ name: 'TicketSaleTracking',
+ meta: {
+ title: 'saleTracking',
+ icon: 'assignment',
+ },
+ component: () => import('src/pages/Ticket/Card/TicketSaleTracking.vue'),
+ },
+ {
+ path: 'dms',
+ name: 'TicketDms',
+ meta: {
+ title: 'dms',
+ icon: 'cloud_upload',
+ },
+ component: () => import('src/pages/Ticket/Card/TicketDms.vue'),
+ },
+ {
+ path: 'boxing',
+ name: 'TicketBoxing',
+ meta: {
+ title: 'boxing',
+ icon: 'science',
+ },
+ component: () => import('src/pages/Ticket/Card/TicketBoxing.vue'),
+ },
+ {
+ path: 'sms',
+ name: 'TicketSms',
+ meta: {
+ title: 'sms',
+ icon: 'sms',
+ },
+ component: () => import('src/pages/Ticket/Card/TicketSms.vue'),
+ },
+ ],
+};
+
+export default {
+ name: 'Ticket',
+ path: '/ticket',
+ meta: {
+ title: 'tickets',
+ icon: 'vn:ticket',
+ moduleName: 'Ticket',
+ keyBinding: 't',
+ menu: ['TicketList', 'TicketAdvance', 'TicketWeekly', 'TicketFuture'],
+ },
+ component: RouterView,
+ redirect: { name: 'TicketMain' },
children: [
{
name: 'TicketMain',
path: '',
- component: () => import('src/components/common/VnSectionMain.vue'),
- redirect: { name: 'TicketList' },
+ component: () => import('src/components/common/VnModule.vue'),
+ redirect: { name: 'TicketIndexMain' },
children: [
{
- path: 'list',
- name: 'TicketList',
- meta: {
- title: 'list',
- icon: 'view_list',
- },
+ path: '',
+ name: 'TicketIndexMain',
+ redirect: { name: 'TicketList' },
component: () => import('src/pages/Ticket/TicketList.vue'),
+ children: [
+ {
+ name: 'TicketList',
+ path: 'list',
+ meta: {
+ title: 'list',
+ icon: 'view_list',
+ },
+ },
+ ticketCard,
+ ],
},
{
path: 'create',
@@ -86,170 +258,5 @@ export default {
},
],
},
- {
- name: 'TicketCard',
- path: ':id',
- component: () => import('src/pages/Ticket/Card/TicketCard.vue'),
- redirect: { name: 'TicketSummary' },
- children: [
- {
- path: 'summary',
- name: 'TicketSummary',
- meta: {
- title: 'summary',
- icon: 'launch',
- },
- component: () => import('src/pages/Ticket/Card/TicketSummary.vue'),
- },
- {
- path: 'basic-data',
- name: 'TicketBasicData',
- meta: {
- title: 'basicData',
- icon: 'vn:settings',
- },
- component: () =>
- import('src/pages/Ticket/Card/BasicData/TicketBasicDataView.vue'),
- },
- {
- path: 'sale',
- name: 'TicketSale',
- meta: {
- title: 'sale',
- icon: 'vn:lines',
- },
- component: () => import('src/pages/Ticket/Card/TicketSale.vue'),
- },
- {
- path: 'request',
- name: 'TicketPurchaseRequest',
- meta: {
- title: 'purchaseRequest',
- icon: 'vn:buyrequest',
- },
- component: () =>
- import('src/pages/Ticket/Card/TicketPurchaseRequest.vue'),
- },
- {
- path: 'tracking',
- name: 'TicketTracking',
- meta: {
- title: 'tracking',
- icon: 'vn:eye',
- },
- component: () => import('src/pages/Ticket/Card/TicketTracking.vue'),
- },
- {
- path: 'log',
- name: 'TicketLog',
- meta: {
- title: 'log',
- icon: 'history',
- },
- component: () => import('src/pages/Ticket/Card/TicketLog.vue'),
- },
- {
- path: 'observation',
- name: 'TicketNotes',
- meta: {
- title: 'notes',
- icon: 'vn:notes',
- },
- component: () => import('src/pages/Ticket/Card/TicketNotes.vue'),
- },
- {
- path: 'picture',
- name: 'TicketPicture',
- meta: {
- title: 'pictures',
- icon: 'vn:photo',
- },
- component: () => import('src/pages/Ticket/Card/TicketPicture.vue'),
- },
- {
- path: 'volume',
- name: 'TicketVolume',
- meta: {
- title: 'volume',
- icon: 'vn:volume',
- },
- component: () => import('src/pages/Ticket/Card/TicketVolume.vue'),
- },
- {
- path: 'expedition',
- name: 'TicketExpedition',
- meta: {
- title: 'expedition',
- icon: 'vn:package',
- },
- component: () => import('src/pages/Ticket/Card/TicketExpedition.vue'),
- },
- {
- path: 'service',
- name: 'TicketService',
- meta: {
- title: 'services',
- icon: 'vn:services',
- },
- component: () => import('src/pages/Ticket/Card/TicketService.vue'),
- },
- {
- path: 'package',
- name: 'TicketPackage',
- meta: {
- title: 'packages',
- icon: 'vn:bucket',
- },
- component: () => import('src/pages/Ticket/Card/TicketPackage.vue'),
- },
- {
- path: 'components',
- name: 'TicketComponents',
- meta: {
- title: 'components',
- icon: 'vn:components',
- },
- component: () => import('src/pages/Ticket/Card/TicketComponents.vue'),
- },
-
- {
- path: 'sale-tracking',
- name: 'TicketSaleTracking',
- meta: {
- title: 'saleTracking',
- icon: 'assignment',
- },
- component: () =>
- import('src/pages/Ticket/Card/TicketSaleTracking.vue'),
- },
- {
- path: 'dms',
- name: 'TicketDms',
- meta: {
- title: 'dms',
- icon: 'cloud_upload',
- },
- component: () => import('src/pages/Ticket/Card/TicketDms.vue'),
- },
- {
- path: 'boxing',
- name: 'TicketBoxing',
- meta: {
- title: 'boxing',
- icon: 'science',
- },
- component: () => import('src/pages/Ticket/Card/TicketBoxing.vue'),
- },
- {
- path: 'sms',
- name: 'TicketSms',
- meta: {
- title: 'sms',
- icon: 'sms',
- },
- component: () => import('src/pages/Ticket/Card/TicketSms.vue'),
- },
- ],
- },
],
};
diff --git a/src/router/modules/travel.js b/src/router/modules/travel.js
index dff693d2f..49272be1e 100644
--- a/src/router/modules/travel.js
+++ b/src/router/modules/travel.js
@@ -18,7 +18,7 @@ export default {
{
path: '',
name: 'TravelMain',
- component: () => import('src/components/common/VnSectionMain.vue'),
+ component: () => import('src/components/common/VnModule.vue'),
redirect: { name: 'TravelList' },
children: [
{
diff --git a/src/router/modules/wagon.js b/src/router/modules/wagon.js
index e25e585eb..4a322d305 100644
--- a/src/router/modules/wagon.js
+++ b/src/router/modules/wagon.js
@@ -18,14 +18,14 @@ export default {
{
path: '/wagon',
name: 'WagonMain',
- component: () => import('src/components/common/VnSectionMain.vue'),
+ component: () => import('src/components/common/VnModule.vue'),
redirect: { name: 'WagonList' },
children: [
{
path: 'list',
name: 'WagonList',
meta: {
- title: 'wagonsList',
+ title: 'list',
icon: 'vn:trolley',
},
component: () => import('src/pages/Wagon/WagonList.vue'),
@@ -62,7 +62,7 @@ export default {
{
path: '/wagon/type',
name: 'WagonTypeMain',
- component: () => import('src/components/common/VnSectionMain.vue'),
+ component: () => import('src/components/common/VnModule.vue'),
redirect: { name: 'WagonTypeList' },
children: [
{
diff --git a/src/router/modules/worker.js b/src/router/modules/worker.js
index 925019734..c732664ec 100644
--- a/src/router/modules/worker.js
+++ b/src/router/modules/worker.js
@@ -35,7 +35,7 @@ export default {
{
path: '',
name: 'WorkerMain',
- component: () => import('src/components/common/VnSectionMain.vue'),
+ component: () => import('src/components/common/VnModule.vue'),
redirect: { name: 'WorkerList' },
children: [
{
diff --git a/src/router/modules/zone.js b/src/router/modules/zone.js
index c5ebe762e..f400a708e 100644
--- a/src/router/modules/zone.js
+++ b/src/router/modules/zone.js
@@ -30,7 +30,7 @@ export default {
{
path: '/zone',
name: 'ZoneMain',
- component: () => import('src/components/common/VnSectionMain.vue'),
+ component: () => import('src/components/common/VnModule.vue'),
redirect: { name: 'ZoneList' },
children: [
{
@@ -38,7 +38,7 @@ export default {
name: 'ZoneList',
meta: {
title: 'zonesList',
- icon: 'vn:zone',
+ icon: 'view_list',
},
component: () => import('src/pages/Zone/ZoneList.vue'),
},
diff --git a/src/router/routes.js b/src/router/routes.js
index cced308b5..b9120f8c4 100644
--- a/src/router/routes.js
+++ b/src/router/routes.js
@@ -7,10 +7,9 @@ import worker from './modules/worker';
import invoiceOut from './modules/invoiceOut';
import invoiceIn from './modules/invoiceIn';
import wagon from './modules/wagon';
-import supplier from './modules/Supplier';
+import supplier from './modules/supplier';
import travel from './modules/travel';
import department from './modules/department';
-import role from './modules/role';
import ItemType from './modules/itemType';
import shelving from 'src/router/modules/shelving';
import order from 'src/router/modules/order';
@@ -21,7 +20,6 @@ import agency from 'src/router/modules/agency';
import zone from 'src/router/modules/zone';
import account from './modules/account';
import monitor from 'src/router/modules/monitor';
-import mailAlias from './modules/mailAlias';
const routes = [
{
@@ -95,8 +93,6 @@ const routes = [
ItemType,
zone,
account,
- role,
- mailAlias,
{
path: '/:catchAll(.*)*',
name: 'NotFound',
diff --git a/test/vitest/__tests__/stores/useStateQueryStore.spec.js b/src/stores/__tests__/useStateQueryStore.spec.js
similarity index 100%
rename from test/vitest/__tests__/stores/useStateQueryStore.spec.js
rename to src/stores/__tests__/useStateQueryStore.spec.js
diff --git a/src/stores/invoiceOutGlobal.js b/src/stores/invoiceOutGlobal.js
index 332494aa8..cc8d86ea8 100644
--- a/src/stores/invoiceOutGlobal.js
+++ b/src/stores/invoiceOutGlobal.js
@@ -19,7 +19,7 @@ export const useInvoiceOutGlobalStore = defineStore({
maxShipped: null,
clientId: null,
printer: null,
- serialType: null,
+ serialType: 'global',
},
addresses: [],
minInvoicingDate: null,
@@ -41,7 +41,6 @@ export const useInvoiceOutGlobalStore = defineStore({
async fetchAllData() {
try {
- const userInfo = await useUserConfig().fetch();
const date = Date.vnNew();
this.formInitialData.maxShipped = new Date(
date.getFullYear(),
@@ -53,7 +52,7 @@ export const useInvoiceOutGlobalStore = defineStore({
await Promise.all([
this.fetchParallelism(),
- this.fetchInvoiceOutConfig(userInfo.companyFk),
+ this.fetchInvoiceOutConfig(),
]);
this.initialDataLoading = false;
@@ -62,21 +61,23 @@ export const useInvoiceOutGlobalStore = defineStore({
}
},
- async fetchInvoiceOutConfig(companyFk) {
+ async fetchInvoiceOutConfig(formData = this.formInitialData) {
try {
- this.formInitialData.companyFk = companyFk;
- const params = { companyFk: companyFk };
+ const userInfo = await useUserConfig().fetch();
+ const params = {
+ companyFk: userInfo.companyFk,
+ serialType: formData.serialType,
+ };
const { data } = await axios.get('InvoiceOuts/getInvoiceDate', {
params,
});
- const stringDate = data.issued.substring(0, 10);
- this.minInvoicingDate = stringDate;
- this.formInitialData.invoiceDate = stringDate;
-
- this.minInvoicingDate = new Date(data.issued);
+ this.minInvoicingDate = data?.issued
+ ? new Date(data.issued)
+ : Date.vnNew();
this.formInitialData.invoiceDate = this.minInvoicingDate;
+ formData.invoiceDate = this.minInvoicingDate;
} catch (err) {
console.error('Error fetching invoice out global initial data');
throw new Error();
diff --git a/src/stores/useArrayDataStore.js b/src/stores/useArrayDataStore.js
index 6a0e7dfa8..8d62fdb4a 100644
--- a/src/stores/useArrayDataStore.js
+++ b/src/stores/useArrayDataStore.js
@@ -17,6 +17,8 @@ export const useArrayDataStore = defineStore('arrayDataStore', () => {
searchUrl: 'params',
navigate: null,
page: 1,
+ mapKey: 'id',
+ keepData: false,
};
function get(key) {
@@ -46,13 +48,19 @@ export const useArrayDataStore = defineStore('arrayDataStore', () => {
function getDefaultState() {
return Object.assign(JSON.parse(JSON.stringify(defaultOpts)), {
data: ref(),
+ map: ref(new Map()),
});
}
+ function resetPagination(key) {
+ reset(key, ['skip', 'filter.skip', 'page']);
+ }
+
return {
get,
set,
clear,
reset,
+ resetPagination,
};
});
diff --git a/src/stores/useStateStore.js b/src/stores/useStateStore.js
index 328df9978..686e76c77 100644
--- a/src/stores/useStateStore.js
+++ b/src/stores/useStateStore.js
@@ -15,6 +15,10 @@ export const useStateStore = defineStore('stateStore', () => {
rightDrawer.value = !rightDrawer.value;
}
+ function rightDrawerChangeValue(value) {
+ rightDrawer.value = value;
+ }
+
function toggleSubToolbar() {
subToolbar.value = !subToolbar.value;
}
@@ -50,5 +54,6 @@ export const useStateStore = defineStore('stateStore', () => {
isRightDrawerShown,
isSubToolbarShown,
toggleSubToolbar,
+ rightDrawerChangeValue,
};
});
diff --git a/test/cypress/integration/claim/claimDevelopment.spec.js b/test/cypress/integration/claim/claimDevelopment.spec.js
index eb39f340a..df9d09a49 100755
--- a/test/cypress/integration/claim/claimDevelopment.spec.js
+++ b/test/cypress/integration/claim/claimDevelopment.spec.js
@@ -3,6 +3,8 @@ describe('ClaimDevelopment', () => {
const claimId = 1;
const firstLineReason = 'tbody > :nth-child(1) > :nth-child(2)';
const thirdRow = 'tbody > :nth-child(3)';
+ const lastReason = 'Incompetencia';
+ const newReason = 'Calor';
beforeEach(() => {
cy.viewport(1920, 1080);
@@ -14,22 +16,22 @@ describe('ClaimDevelopment', () => {
});
it('should reset line', () => {
- cy.selectOption(firstLineReason, 'Novato');
+ cy.selectOption(firstLineReason, newReason);
cy.resetCard();
- cy.getValue(firstLineReason).should('equal', 'Prisas');
+ cy.getValue(firstLineReason).should('equal', lastReason);
});
it('should edit line', () => {
- cy.selectOption(firstLineReason, 'Novato');
+ cy.selectOption(firstLineReason, newReason);
cy.saveCard();
cy.login('developer');
cy.visit(`/#/claim/${claimId}/development`);
- cy.getValue(firstLineReason).should('equal', 'Novato');
+ cy.getValue(firstLineReason).should('equal', newReason);
//Restart data
- cy.selectOption(firstLineReason, 'Prisas');
+ cy.selectOption(firstLineReason, lastReason);
cy.saveCard();
});
@@ -42,7 +44,7 @@ describe('ClaimDevelopment', () => {
const rowData = [
false,
- 'Novato',
+ newReason,
'Roces',
'Compradores',
'administrativeNick',
diff --git a/test/cypress/integration/client/clientBasicData.spec.js b/test/cypress/integration/client/clientBasicData.spec.js
index efaad33c2..bed28dc22 100644
--- a/test/cypress/integration/client/clientBasicData.spec.js
+++ b/test/cypress/integration/client/clientBasicData.spec.js
@@ -7,8 +7,8 @@ describe('Client basic data', () => {
});
it('Should load layout', () => {
cy.get('.q-card').should('be.visible');
- cy.dataCy('customerPhone').filter('input').should('be.visible');
- cy.dataCy('customerPhone').filter('input').type('123456789');
+ cy.dataCy('customerPhone').find('input').should('be.visible');
+ cy.dataCy('customerPhone').find('input').type('123456789');
cy.get('.q-btn-group > .q-btn--standard').click();
cy.intercept('PATCH', '/api/Clients/1102', (req) => {
const { body } = req;
diff --git a/test/cypress/integration/client/clientList.spec.js b/test/cypress/integration/client/clientList.spec.js
index e89b5fc77..dcded63b0 100644
--- a/test/cypress/integration/client/clientList.spec.js
+++ b/test/cypress/integration/client/clientList.spec.js
@@ -16,25 +16,25 @@ describe('Client list', () => {
});
it('Client list create new client', () => {
- cy.get('.q-page-sticky > div > .q-btn > .q-btn__content > .q-icon').click();
+ cy.addBtnClick();
const randomInt = Math.floor(Math.random() * 90) + 10;
const data = {
Name: { val: `Name ${randomInt}` },
'Social name': { val: `TEST ${randomInt}` },
- 'Tax number': { val: `20852${randomInt.length}3Z` },
+ 'Tax number': { val: `20852${randomInt}3Z` },
'Web user': { val: `user_test_${randomInt}` },
Street: { val: `C/ STREET ${randomInt}` },
- Email: { val: 'user.test@1.com' },
- 'Sales person': { val: 'employee', type: 'select' },
- Location: { val: '46000, Valencia(Province one), España', type: 'select' },
+ Email: { val: `user.test${randomInt}@cypress.com` },
+ 'Sales person': { val: 'salesPerson', type: 'select' },
+ Location: { val: '46000', type: 'select' },
'Business type': { val: 'Otros', type: 'select' },
};
cy.fillInForm(data);
cy.get('.q-mt-lg > .q-btn--standard').click();
- cy.checkNotification('Data saved');
+ cy.checkNotification('Data created');
cy.url().should('include', '/summary');
});
it('Client list search client', () => {
diff --git a/test/cypress/integration/entry/stockBought.spec.js b/test/cypress/integration/entry/stockBought.spec.js
index 66e06b79e..078ad19cc 100644
--- a/test/cypress/integration/entry/stockBought.spec.js
+++ b/test/cypress/integration/entry/stockBought.spec.js
@@ -11,7 +11,7 @@ describe('EntryStockBought', () => {
cy.get('.q-notification__message').should('have.text', 'Data saved');
});
it('Should add a new reserved space for buyerBoss', () => {
- cy.get('.q-page-sticky > div > .q-btn > .q-btn__content > .q-icon').click();
+ cy.addBtnClick();
cy.get('input[aria-label="Reserve"]').type('1');
cy.get('input[aria-label="Date"]').eq(1).clear();
cy.get('input[aria-label="Date"]').eq(1).type('01-01');
diff --git a/test/cypress/integration/invoiceIn/invoiceInIntrastat.spec.js b/test/cypress/integration/invoiceIn/invoiceInIntrastat.spec.js
index f6dac4c73..4c2550548 100644
--- a/test/cypress/integration/invoiceIn/invoiceInIntrastat.spec.js
+++ b/test/cypress/integration/invoiceIn/invoiceInIntrastat.spec.js
@@ -2,7 +2,7 @@
describe('InvoiceInIntrastat', () => {
const firstRow = 'tbody > :nth-child(1)';
const thirdRow = 'tbody > :nth-child(3)';
- const firstRowCode = `${firstRow} > :nth-child(2)`;
+ const codes = `[data-cy="intrastat-code"]`;
const firstRowAmount = `${firstRow} > :nth-child(3)`;
beforeEach(() => {
@@ -11,13 +11,12 @@ describe('InvoiceInIntrastat', () => {
});
it('should edit the first line', () => {
- cy.selectOption(firstRowCode, 'Plantas vivas: Esqueje/injerto, Vid');
+ cy.selectOption(`${firstRow} ${codes}`, 'Plantas vivas: Esqueje/injerto, Vid');
cy.get(firstRowAmount).clear();
cy.saveCard();
- cy.get(`${firstRowCode} span`).should(
- 'have.text',
- '6021010:Plantas vivas: Esqueje/injerto, Vid'
- );
+ cy.get(codes)
+ .eq(0)
+ .should('have.value', '6021010: Plantas vivas: Esqueje/injerto, Vid');
});
it('should add a new row', () => {
diff --git a/test/cypress/integration/invoiceIn/invoiceInList.spec.js b/test/cypress/integration/invoiceIn/invoiceInList.spec.js
index fa0d1c5e4..d9ab3f7e7 100644
--- a/test/cypress/integration/invoiceIn/invoiceInList.spec.js
+++ b/test/cypress/integration/invoiceIn/invoiceInList.spec.js
@@ -1,7 +1,7 @@
///
describe('InvoiceInList', () => {
const firstRow = 'tbody.q-virtual-scroll__content tr:nth-child(1)';
- const firstId = `${firstRow} > td:nth-child(1) span`;
+ const firstId = `${firstRow} > td:nth-child(2) span`;
const firstDetailBtn = `${firstRow} .q-btn:nth-child(1)`;
const summaryHeaders = '.summaryBody .header-link';
diff --git a/test/cypress/integration/invoiceIn/invoiceInVat.spec.js b/test/cypress/integration/invoiceIn/invoiceInVat.spec.js
index b84d743d1..f8b403a45 100644
--- a/test/cypress/integration/invoiceIn/invoiceInVat.spec.js
+++ b/test/cypress/integration/invoiceIn/invoiceInVat.spec.js
@@ -2,6 +2,7 @@
describe('InvoiceInVat', () => {
const thirdRow = 'tbody > :nth-child(3)';
const firstLineVat = 'tbody > :nth-child(1) > :nth-child(4)';
+ const vats = '[data-cy="vat-sageiva"]';
const dialogInputs = '.q-dialog label input';
const addBtn = 'tbody tr:nth-child(1) td:nth-child(2) .--add-icon';
const randomInt = Math.floor(Math.random() * 100);
@@ -14,9 +15,9 @@ describe('InvoiceInVat', () => {
});
it('should edit the sage iva', () => {
- cy.selectOption(firstLineVat, 'H.P. IVA 21% CEE');
+ cy.selectOption(`${firstLineVat} ${vats}`, 'H.P. IVA 21% CEE');
cy.saveCard();
- cy.get(`${firstLineVat} span`).should('have.text', '8:H.P. IVA 21% CEE');
+ cy.get(vats).eq(0).should('have.value', '8: H.P. IVA 21% CEE');
});
it('should add a new row', () => {
diff --git a/test/cypress/integration/item/ItemFixedPrice.spec.js b/test/cypress/integration/item/ItemFixedPrice.spec.js
new file mode 100644
index 000000000..92dc27fda
--- /dev/null
+++ b/test/cypress/integration/item/ItemFixedPrice.spec.js
@@ -0,0 +1,63 @@
+///
+function goTo(n = 1) {
+ return `.q-virtual-scroll__content > :nth-child(${n})`;
+}
+const firstRow = goTo();
+`.q-virtual-scroll__content > :nth-child(2)`;
+describe('Handle Items FixedPrice', () => {
+ beforeEach(() => {
+ cy.viewport(1280, 720);
+ cy.login('developer');
+ cy.visit('/#/item/fixed-price', { timeout: 5000 });
+ cy.waitForElement('.q-table');
+ cy.get(
+ '.q-header > .q-toolbar > :nth-child(1) > .q-btn__content > .q-icon'
+ ).click();
+ });
+ it('filter', function () {
+ cy.get('.category-filter > :nth-child(1) > .q-btn__content > .q-icon').click();
+ cy.selectOption('.list > :nth-child(2)', 'Alstroemeria');
+ cy.get('.q-gutter-x-sm > .q-btn > .q-btn__content > .q-icon').click();
+
+ cy.addBtnClick();
+ cy.selectOption(`${firstRow} > :nth-child(2)`, '#13');
+ cy.get(`${firstRow} > :nth-child(4)`).find('input').type(1);
+ cy.get(`${firstRow} > :nth-child(5)`).find('input').type('2');
+ cy.selectOption(`${firstRow} > :nth-child(9)`, 'Warehouse One');
+ cy.get('.q-notification__message').should('have.text', 'Data saved');
+ /* ==== End Cypress Studio ==== */
+ });
+ it('Create and delete ', function () {
+ cy.get('.q-gutter-x-sm > .q-btn > .q-btn__content > .q-icon').click();
+ cy.addBtnClick();
+ cy.selectOption(`${firstRow} > :nth-child(2)`, '#11');
+ cy.get(`${firstRow} > :nth-child(4)`).type('1');
+ cy.get(`${firstRow} > :nth-child(5)`).type('2');
+ cy.selectOption(`${firstRow} > :nth-child(9)`, 'Warehouse One');
+ cy.get('.q-notification__message').should('have.text', 'Data saved');
+ cy.get('.q-gutter-x-sm > .q-btn > .q-btn__content > .q-icon').click();
+ cy.get(`${firstRow} > .text-right > .q-btn > .q-btn__content > .q-icon`).click();
+ cy.get(
+ '.q-card__actions > .q-btn--unelevated > .q-btn__content > .block'
+ ).click();
+ cy.get('.q-notification__message').should('have.text', 'Data saved');
+ });
+
+ it('Massive edit', function () {
+ cy.get(' .bg-header > :nth-child(1) > .q-checkbox > .q-checkbox__inner ').click();
+ cy.get('#subToolbar > .q-btn--standard').click();
+ cy.selectOption("[data-cy='field-to-edit']", 'Min price');
+ cy.dataCy('value-to-edit').find('input').type('1');
+ cy.get('.countLines').should('have.text', ' 1 ');
+ cy.get('.q-mt-lg > .q-btn--standard').click();
+ cy.get('.q-notification__message').should('have.text', 'Data saved');
+ });
+ it('Massive remove', function () {
+ cy.get(' .bg-header > :nth-child(1) > .q-checkbox > .q-checkbox__inner ').click();
+ cy.get('#subToolbar > .q-btn--flat').click();
+ cy.get(
+ '.q-card__actions > .q-btn--unelevated > .q-btn__content > .block'
+ ).click();
+ cy.get('.q-notification__message').should('have.text', 'Data saved');
+ });
+});
diff --git a/test/cypress/integration/route/roadMap/roadmapList.spec.js b/test/cypress/integration/route/roadMap/roadmapList.spec.js
index ba602fdf6..2f5e5672f 100644
--- a/test/cypress/integration/route/roadMap/roadmapList.spec.js
+++ b/test/cypress/integration/route/roadMap/roadmapList.spec.js
@@ -5,7 +5,7 @@ describe('RoadMap', () => {
cy.visit(`/#/route/roadmap`);
});
it('Route list create roadmap and redirect', () => {
- cy.get('.q-page-sticky > div > .q-btn > .q-btn__content > .q-icon').click();
+ cy.addBtnClick();
cy.get('input[name="name"]').eq(1).type('roadMapTestOne{enter}');
cy.get('.q-notification__message').should('have.text', 'Data created');
cy.url().should('include', '/summary');
diff --git a/test/cypress/integration/route/routeList.spec.js b/test/cypress/integration/route/routeList.spec.js
index 8020d3ea9..4da43ce8e 100644
--- a/test/cypress/integration/route/routeList.spec.js
+++ b/test/cypress/integration/route/routeList.spec.js
@@ -9,7 +9,7 @@ describe('Route', () => {
const getRowColumn = (row, column) => `:nth-child(${row}) > :nth-child(${column})`;
it('Route list create route', () => {
- cy.get('.q-page-sticky > div > .q-btn > .q-btn__content > .q-icon').click();
+ cy.addBtnClick();
cy.get('input[name="description"]').type('routeTestOne{enter}');
cy.get('.q-notification__message').should('have.text', 'Data created');
cy.url().should('include', '/summary');
diff --git a/test/cypress/integration/ticket/ticketExpedition.spec.js b/test/cypress/integration/ticket/ticketExpedition.spec.js
index d4afd401f..d74a122a1 100644
--- a/test/cypress/integration/ticket/ticketExpedition.spec.js
+++ b/test/cypress/integration/ticket/ticketExpedition.spec.js
@@ -16,7 +16,9 @@ describe('Ticket expedtion', () => {
cy.wait('@show');
cy.selectRows([1, 2]);
- cy.selectOption('[data-cy="change-state"]', 'Perdida');
+
+ cy.dataCy('change-state').click();
+ cy.selectOption('[data-cy="vnBtnSelect_select"]', 'Perdida');
cy.wait('@add');
cy.get(`${tableContent} tr:nth-child(-n+2) ${stateTd}`).each(($el) => {
diff --git a/test/cypress/integration/ticket/ticketList.spec.js b/test/cypress/integration/ticket/ticketList.spec.js
index bbdbcea92..b30b4cdad 100644
--- a/test/cypress/integration/ticket/ticketList.spec.js
+++ b/test/cypress/integration/ticket/ticketList.spec.js
@@ -47,7 +47,8 @@ describe('TicketList', () => {
Landed: { val: '01-01-2024', type: 'date' },
};
cy.fillInForm(data);
- cy.get('.q-mt-lg > .q-btn--standard').click();
+ cy.dataCy('Agency_select').click();
+ cy.dataCy('FormModelPopup_save').click();
cy.checkNotification('Data created');
cy.url().should('match', /\/ticket\/\d+\/summary/);
});
diff --git a/test/cypress/integration/vnComponent/VnBreadcrumbs.spec.js b/test/cypress/integration/vnComponent/VnBreadcrumbs.spec.js
index e996a65d5..8e37d8c9c 100644
--- a/test/cypress/integration/vnComponent/VnBreadcrumbs.spec.js
+++ b/test/cypress/integration/vnComponent/VnBreadcrumbs.spec.js
@@ -1,6 +1,5 @@
///
describe('VnBreadcrumbs', () => {
- const firstCard = '.q-infinite-scroll > :nth-child(1)';
const lastBreadcrumb = '.q-breadcrumbs--last > .q-breadcrumbs__el';
beforeEach(() => {
cy.viewport(1920, 1080);
@@ -13,10 +12,7 @@ describe('VnBreadcrumbs', () => {
});
it('should get the correct breadcrumbs', () => {
- cy.visit('#/customer/list');
- cy.get('.q-breadcrumbs__el').should('have.length', 2);
-
- cy.get(firstCard).click();
+ cy.visit('#/customer/1/summary');
cy.get(`${lastBreadcrumb} > .q-icon`).should('have.text', 'launch');
});
});
diff --git a/test/cypress/integration/vnComponent/VnLog.spec.js b/test/cypress/integration/vnComponent/VnLog.spec.js
index 4db724e99..80b9d07df 100644
--- a/test/cypress/integration/vnComponent/VnLog.spec.js
+++ b/test/cypress/integration/vnComponent/VnLog.spec.js
@@ -9,15 +9,15 @@ describe('VnLog', () => {
cy.visit(`/#/claim/${1}/log`);
cy.openRightMenu();
});
- // Se tiene que cambiar el Accept-Language a 'en', ya hay una tarea para eso #7189.
- xit('should filter by insert actions', () => {
+
+ it('should filter by insert actions', () => {
cy.checkOption(':nth-child(7) > .q-checkbox');
cy.get('.q-page').click();
cy.validateContent(chips[0], 'Document');
cy.validateContent(chips[1], 'Beginning');
});
- xit('should filter by entity', () => {
+ it('should filter by entity', () => {
cy.selectOption('.q-drawer--right .q-item > .q-select', 'Claim');
cy.get('.q-page').click();
cy.validateContent(chips[0], 'Claim');
diff --git a/test/cypress/integration/vnComponent/VnSearchBar.spec.js b/test/cypress/integration/vnComponent/VnSearchBar.spec.js
index b8621118c..885e5d6b3 100644
--- a/test/cypress/integration/vnComponent/VnSearchBar.spec.js
+++ b/test/cypress/integration/vnComponent/VnSearchBar.spec.js
@@ -7,10 +7,10 @@ describe('VnSearchBar', () => {
beforeEach(() => {
cy.viewport(1280, 720);
cy.login('developer');
- cy.visit('#/customer/list');
+ cy.visit('#/account/list');
});
- it('should redirect to customer summary page', () => {
+ it('should redirect to account summary page', () => {
searchAndCheck('1', employeeId);
searchAndCheck('salesPerson', salesPersonId);
});
@@ -20,7 +20,6 @@ describe('VnSearchBar', () => {
checkTableLength(2);
cy.clearSearchbar();
-
cy.writeSearchbar('0{enter}');
checkTableLength(0);
});
diff --git a/test/cypress/integration/wagonType/wagonTypeCreate.spec.js b/test/cypress/integration/wagon/wagonType/wagonTypeCreate.spec.js
similarity index 100%
rename from test/cypress/integration/wagonType/wagonTypeCreate.spec.js
rename to test/cypress/integration/wagon/wagonType/wagonTypeCreate.spec.js
diff --git a/test/cypress/integration/wagonType/wagonTypeEdit.spec.js b/test/cypress/integration/wagon/wagonType/wagonTypeEdit.spec.js
similarity index 100%
rename from test/cypress/integration/wagonType/wagonTypeEdit.spec.js
rename to test/cypress/integration/wagon/wagonType/wagonTypeEdit.spec.js
diff --git a/test/cypress/integration/worker/workerPda.spec.js b/test/cypress/integration/worker/workerPda.spec.js
index fe8efa834..31ec19eda 100644
--- a/test/cypress/integration/worker/workerPda.spec.js
+++ b/test/cypress/integration/worker/workerPda.spec.js
@@ -1,6 +1,5 @@
describe('WorkerPda', () => {
- const deviceProductionField =
- '.vn-row > .q-field > .q-field__inner > .q-field__control > .q-field__control-container';
+ const select = '[data-cy="pda-dialog-select"]';
beforeEach(() => {
cy.viewport(1920, 1080);
cy.login('developer');
@@ -8,8 +7,9 @@ describe('WorkerPda', () => {
});
it('assign pda', () => {
- cy.get('.q-page-sticky > div > .q-btn > .q-btn__content > .q-icon').click();
- cy.get(deviceProductionField).type('{downArrow}{enter}');
+ cy.addBtnClick();
+ cy.get(select).click();
+ cy.get(select).type('{downArrow}{enter}');
cy.get('.q-notification__message').should('have.text', 'Data created');
});
diff --git a/test/cypress/integration/zone/zoneBasicData.spec.js b/test/cypress/integration/zone/zoneBasicData.spec.js
index c6151a49b..6229039b7 100644
--- a/test/cypress/integration/zone/zoneBasicData.spec.js
+++ b/test/cypress/integration/zone/zoneBasicData.spec.js
@@ -1,5 +1,6 @@
describe('ZoneBasicData', () => {
const notification = '.q-notification__message';
+ const priceBasicData = '[data-cy="Price_input"]';
beforeEach(() => {
cy.viewport(1280, 720);
@@ -8,14 +9,20 @@ describe('ZoneBasicData', () => {
});
it('should throw an error if the name is empty', () => {
- cy.get('.q-card > :nth-child(1)').clear();
+ cy.get('[data-cy="zone-basic-data-name"] input').type('{selectall}{backspace}');
cy.get('.q-btn-group > .q-btn--standard').click();
cy.get(notification).should('contains.text', "can't be blank");
});
+ it('should throw an error if the price is empty', () => {
+ cy.get(priceBasicData).clear();
+ cy.get('.q-btn-group > .q-btn--standard').click();
+ cy.get(notification).should('contains.text', 'cannot be blank');
+ });
+
it("should edit the basicData's zone", () => {
cy.get('.q-card > :nth-child(1)').type(' modified');
cy.get('.q-btn-group > .q-btn--standard').click();
- cy.get(notification).should('contains.text', 'Data saved');
+ cy.checkNotification('Data saved');
});
});
diff --git a/test/cypress/integration/zone/zoneCreate.spec.js b/test/cypress/integration/zone/zoneCreate.spec.js
index 9618ea846..cc5de8c6c 100644
--- a/test/cypress/integration/zone/zoneCreate.spec.js
+++ b/test/cypress/integration/zone/zoneCreate.spec.js
@@ -22,6 +22,7 @@ describe('ZoneCreate', () => {
...data,
});
cy.get('input[aria-label="Close"]').type('10:00');
+ cy.get('body').click();
cy.get('.q-mt-lg > .q-btn--standard').click();
cy.get(notification).should('contains.text', 'Agency cannot be blank');
});
@@ -32,6 +33,7 @@ describe('ZoneCreate', () => {
Agency: { val: 'inhouse pickup', type: 'select' },
});
cy.get('input[aria-label="Close"]').type('10:00');
+ cy.get('body').click();
cy.get('.q-mt-lg > .q-btn--standard').click();
cy.get(notification).should('contains.text', 'Data created');
});
diff --git a/test/cypress/integration/zone/zoneList.spec.js b/test/cypress/integration/zone/zoneList.spec.js
index 92c77a2c6..8d01d4e4e 100644
--- a/test/cypress/integration/zone/zoneList.spec.js
+++ b/test/cypress/integration/zone/zoneList.spec.js
@@ -6,9 +6,7 @@ describe('ZoneList', () => {
});
it('should filter by agency', () => {
- cy.get(
- ':nth-child(1) > .column > .q-field > .q-field__inner > .q-field__control > .q-field__control-container'
- ).type('{downArrow}{enter}');
+ cy.get('input[aria-label="Agency"]').type('{downArrow}{enter}');
});
it('should open the zone summary', () => {
diff --git a/test/cypress/integration/zone/zoneWarehouse.spec.js b/test/cypress/integration/zone/zoneWarehouse.spec.js
index 3ffa3f69d..817e26312 100644
--- a/test/cypress/integration/zone/zoneWarehouse.spec.js
+++ b/test/cypress/integration/zone/zoneWarehouse.spec.js
@@ -1,10 +1,10 @@
describe('ZoneWarehouse', () => {
const data = {
- Warehouse: { val: 'Algemesi', type: 'select' },
+ Warehouse: { val: 'Warehouse One', type: 'select' },
};
- const deviceProductionField =
- '.vn-row > :nth-child(1) > .q-field > .q-field__inner > .q-field__control > .q-field__control-container';
- const dataError = "ER_DUP_ENTRY: Duplicate entry '2-2' for key 'zoneFk'";
+
+ const dataError = 'ER_DUP_ENTRY: Duplicate entry';
+ const saveBtn = '.q-btn--standard > .q-btn__content > .block';
beforeEach(() => {
cy.viewport(1280, 720);
@@ -13,22 +13,21 @@ describe('ZoneWarehouse', () => {
});
it('should throw an error if the warehouse chosen is already put in the zone', () => {
- cy.get('.q-page-sticky > div > .q-btn > .q-btn__content > .q-icon').click();
- cy.get(deviceProductionField).click();
- cy.get(deviceProductionField).type('{upArrow}{enter}');
- cy.get('.q-notification__message').should('have.text', dataError);
+ cy.addBtnClick();
+ cy.selectOption('[data-cy="Warehouse_select"]', 'Warehouse Two');
+ cy.get(saveBtn).click();
+ cy.checkNotification(dataError);
});
- it('should create a warehouse', () => {
- cy.get('.q-page-sticky > div > .q-btn > .q-btn__content > .q-icon').click();
- cy.get(deviceProductionField).click();
+ it('should create & remove a warehouse', () => {
+ cy.addBtnClick();
cy.fillInForm(data);
+ cy.get(saveBtn).click();
cy.get('.q-mt-lg > .q-btn--standard').click();
- });
- it('should delete a warehouse', () => {
cy.get('tbody > :nth-child(2) > :nth-child(2) > .q-icon').click();
- cy.get('.q-card__actions > .q-btn--flat > .q-btn__content').click();
+ cy.get('[title="Confirm"]').click();
+
cy.reload();
});
});
diff --git a/test/cypress/support/commands.js b/test/cypress/support/commands.js
index 21121d9df..df2c00e03 100755
--- a/test/cypress/support/commands.js
+++ b/test/cypress/support/commands.js
@@ -58,8 +58,9 @@ Cypress.Commands.add('domContentLoad', (element, timeout = 5000) => {
cy.waitUntil(() => cy.document().then((doc) => doc.readyState === 'complete'));
});
Cypress.Commands.add('waitForElement', (element, timeout = 5000) => {
- cy.waitUntil(() => cy.get(element).then(($el) => $el.is(':visible')));
+ cy.get(element, { timeout }).should('be.visible').and('not.be.disabled');
});
+
Cypress.Commands.add('getValue', (selector) => {
cy.get(selector).then(($el) => {
if ($el.find('.q-checkbox__inner').length > 0) {
@@ -86,15 +87,40 @@ Cypress.Commands.add('getValue', (selector) => {
});
// Fill Inputs
-Cypress.Commands.add('selectOption', (selector, option, timeout) => {
- cy.waitForElement(selector);
+Cypress.Commands.add('selectOption', (selector, option, timeout = 5000) => {
+ cy.waitForElement(selector, timeout);
cy.get(selector).click();
- cy.wait(timeout || 1000);
- cy.get('.q-menu .q-item').contains(option).click();
+ cy.get(selector).invoke('data', 'url').as('dataUrl');
+ cy.get(selector)
+ .clear()
+ .type(option)
+ .then(() => {
+ cy.get('.q-menu', { timeout })
+ .should('be.visible') // Asegurarse de que el menú está visible
+ .and('exist') // Verificar que el menú existe
+ .then(() => {
+ cy.get('@dataUrl').then((url) => {
+ if (url) {
+ cy.log('url: ', url);
+ // Esperar a que el menú no esté visible (desaparezca)
+ cy.get('.q-menu').should('not.be.visible');
+ // Ahora esperar a que el menú vuelva a aparecer
+ cy.get('.q-menu').should('be.visible').and('exist');
+ }
+ });
+ });
+ });
+
+ // Finalmente, seleccionar la opción deseada
+ cy.get('.q-menu:visible') // Asegurarse de que estamos dentro del menú visible
+ .find('.q-item') // Encontrar los elementos de las opciones
+ .contains(option) // Verificar que existe una opción que contenga el texto deseado
+ .click(); // Hacer clic en la opción
});
+
Cypress.Commands.add('countSelectOptions', (selector, option) => {
cy.waitForElement(selector);
- cy.get(selector).click();
+ cy.get(selector).click({ force: true });
cy.get('.q-menu .q-item').should('have.length', option);
});
@@ -110,14 +136,13 @@ Cypress.Commands.add('fillInForm', (obj, form = '.q-form > .q-card') => {
const { type, val } = field;
switch (type) {
case 'select':
- cy.wrap(el).type(val);
- cy.get('.q-menu .q-item').contains(val).click();
+ cy.selectOption(el, val);
break;
case 'date':
- cy.wrap(el).type(val.split('-').join(''));
+ cy.get(el).type(val.split('-').join(''));
break;
case 'time':
- cy.wrap(el).click();
+ cy.get(el).click();
cy.get('.q-time .q-time__clock').contains(val.h).click();
cy.get('.q-time .q-time__clock').contains(val.m).click();
cy.get('.q-time .q-time__link').contains(val.x).click();
@@ -347,3 +372,10 @@ Cypress.Commands.add('searchByLabel', (label, value) => {
Cypress.Commands.add('dataCy', (tag, attr = 'data-cy') => {
return cy.get(`[${attr}="${tag}"]`);
});
+
+Cypress.Commands.add('addBtnClick', () => {
+ cy.get('.q-page-sticky > div > .q-btn > .q-btn__content > .q-icon')
+ .should('exist')
+ .and('be.visible')
+ .click();
+});
diff --git a/test/vitest/__tests__/components/common/CrudModel.spec.js b/test/vitest/__tests__/components/common/CrudModel.spec.js
deleted file mode 100644
index 6ce93e59c..000000000
--- a/test/vitest/__tests__/components/common/CrudModel.spec.js
+++ /dev/null
@@ -1,120 +0,0 @@
-import { createWrapper } from 'app/test/vitest/helper';
-import CrudModel from 'components/CrudModel.vue';
-import { vi, afterEach, beforeEach, beforeAll, describe, expect, it } from 'vitest';
-
-describe('CrudModel', () => {
- let vm;
- beforeAll(() => {
- vm = createWrapper(CrudModel, {
- global: {
- stubs: [
- 'vnPaginate',
- 'useState',
- 'arrayData',
- 'useStateStore',
- 'vue-i18n',
- ],
- mocks: {
- validate: vi.fn(),
- },
- },
- propsData: {
- dataRequired: {
- fk: 1,
- },
- dataKey: 'crudModelKey',
- model: 'crudModel',
- url: 'crudModelUrl',
- },
- }).vm;
- });
-
- beforeEach(() => {
- vm.fetch([]);
- });
-
- afterEach(() => {
- vi.clearAllMocks();
- });
-
- describe('insert()', () => {
- it('should new element in list with index 0 if formData not has data', () => {
- vm.insert();
-
- expect(vm.formData.length).toEqual(1);
- expect(vm.formData[0].fk).toEqual(1);
- expect(vm.formData[0].$index).toEqual(0);
- });
- });
-
- describe('getChanges()', () => {
- it('should return correct updates and creates', async () => {
- vm.fetch([
- { id: 1, name: 'New name one' },
- { id: 2, name: 'New name two' },
- { id: 3, name: 'Bruce Wayne' },
- ]);
-
- vm.originalData = [
- { id: 1, name: 'Tony Starks' },
- { id: 2, name: 'Jessica Jones' },
- { id: 3, name: 'Bruce Wayne' },
- ];
-
- vm.insert();
- const result = vm.getChanges();
-
- const expected = {
- creates: [
- {
- $index: 3,
- fk: 1,
- },
- ],
- updates: [
- {
- data: {
- name: 'New name one',
- },
- where: {
- id: 1,
- },
- },
- {
- data: {
- name: 'New name two',
- },
- where: {
- id: 2,
- },
- },
- ],
- };
-
- expect(result).toEqual(expected);
- });
- });
-
- describe('getDifferences()', () => {
- it('should return the differences between two objects', async () => {
- const obj1 = {
- a: 1,
- b: 2,
- c: 3,
- };
- const obj2 = {
- a: null,
- b: 4,
- d: 5,
- };
-
- const result = vm.getDifferences(obj1, obj2);
-
- expect(result).toEqual({
- a: null,
- b: 4,
- d: 5,
- });
- });
- });
-});
diff --git a/test/vitest/__tests__/pages/InvoiceIn/InvoiceInIntrastat.spec.js b/test/vitest/__tests__/pages/InvoiceIn/InvoiceInIntrastat.spec.js
deleted file mode 100644
index adfb054c6..000000000
--- a/test/vitest/__tests__/pages/InvoiceIn/InvoiceInIntrastat.spec.js
+++ /dev/null
@@ -1,34 +0,0 @@
-import { vi, describe, expect, it, beforeAll } from 'vitest';
-import { createWrapper, axios } from 'app/test/vitest/helper';
-import InvoiceInIntrastat from 'src/pages/InvoiceIn/Card/InvoiceInIntrastat.vue';
-
-describe('InvoiceInIntrastat', () => {
- let vm;
-
- beforeAll(() => {
- vm = createWrapper(InvoiceInIntrastat, {
- global: {
- stubs: ['vnPaginate'],
- mocks: {
- fetch: vi.fn(),
- },
- },
- }).vm;
- vi.spyOn(axios, 'get').mockResolvedValue({ data: [{}] });
- });
-
- describe('getTotal()', () => {
- it('should correctly handle the sum', () => {
- const invoceInIntrastat = [
- { amount: 10, stems: 162 },
- { amount: 20, stems: 21 },
- ];
-
- const totalAmount = vm.getTotal(invoceInIntrastat, 'amount');
- const totalStems = vm.getTotal(invoceInIntrastat, 'stems');
-
- expect(totalAmount).toBe(10 + 20);
- expect(totalStems).toBe(162 + 21);
- });
- });
-});
diff --git a/test/vitest/__tests__/pages/InvoiceIn/InvoiceInVat.spec.js b/test/vitest/__tests__/pages/InvoiceIn/InvoiceInVat.spec.js
deleted file mode 100644
index 76453f65a..000000000
--- a/test/vitest/__tests__/pages/InvoiceIn/InvoiceInVat.spec.js
+++ /dev/null
@@ -1,38 +0,0 @@
-import { vi, describe, expect, it, beforeAll } from 'vitest';
-import { createWrapper } from 'app/test/vitest/helper';
-import InvoiceInVat from 'src/pages/InvoiceIn/Card/InvoiceInVat.vue';
-
-describe('InvoiceInVat', () => {
- let vm;
-
- beforeAll(() => {
- vm = createWrapper(InvoiceInVat, {
- global: {
- stubs: [],
- mocks: {
- fetch: vi.fn(),
- },
- },
- }).vm;
- });
-
- describe('taxRate()', () => {
- it('should correctly compute the tax rate', () => {
- const invoiceInTax = { taxableBase: 100, taxTypeSageFk: 1 };
- vm.sageTaxTypes = [
- { id: 1, rate: 10 },
- { id: 2, rate: 20 },
- ];
- const result = vm.taxRate(invoiceInTax);
- expect(result).toBe((10 / 100) * 100);
- });
-
- it('should return 0 if there is not tax rate', () => {
- const invoiceInTax = { taxableBase: 100, taxTypeSageFk: 1 };
- vm.sageTaxTypes = [];
-
- const result = vm.taxRate(invoiceInTax);
- expect(result).toBe(0);
- });
- });
-});
diff --git a/test/vitest/helper.js b/test/vitest/helper.js
index 4bfae5dc8..1e693ab63 100644
--- a/test/vitest/helper.js
+++ b/test/vitest/helper.js
@@ -26,7 +26,7 @@ vi.mock('vue-router', () => ({
params: {
id: 1,
},
- meta: { moduleName: 'mockName' },
+ meta: { moduleName: 'mockModuleName' },
matched: [{ path: 'mockName/list' }],
},
},
@@ -35,7 +35,7 @@ vi.mock('vue-router', () => ({
matched: [],
query: {},
params: {},
- meta: { moduleName: 'mockName' },
+ meta: { moduleName: 'mockModuleName', title: 'mockTitle', name: 'mockName' },
path: 'mockSection/list',
}),
onBeforeRouteLeave: () => {},
@@ -44,7 +44,18 @@ vi.mock('vue-router', () => ({
vi.mock('axios');
vi.spyOn(useValidator, 'useValidator').mockImplementation(() => {
- return { validate: vi.fn() };
+ return {
+ validate: vi.fn(),
+ validations: () => ({
+ format: vi.fn(),
+ presence: vi.fn(),
+ required: vi.fn(),
+ length: vi.fn(),
+ numericality: vi.fn(),
+ min: vi.fn(),
+ custom: vi.fn(),
+ }),
+ };
});
class FormDataMock {
diff --git a/vitest.config.js b/vitest.config.js
index ca9f6c1fe..a465f0e2d 100644
--- a/vitest.config.js
+++ b/vitest.config.js
@@ -13,7 +13,7 @@ export default defineConfig({
include: [
// Matches vitest tests in any subfolder of 'src' or into 'test/vitest/__tests__'
// Matches all files with extension 'js', 'jsx', 'ts' and 'tsx'
- 'test/vitest/__tests__/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}',
+ 'src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}',
],
},
plugins: [