{{ 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/department.js b/src/router/modules/department.js
deleted file mode 100644
index 9aab40534..000000000
--- a/src/router/modules/department.js
+++ /dev/null
@@ -1,47 +0,0 @@
-import { RouterView } from 'vue-router';
-
-export default {
- path: '/department',
- name: 'Department',
- meta: {
- title: 'department',
- icon: 'vn:greuge',
- moduleName: 'Department',
- },
- component: RouterView,
- redirect: { name: 'WorkerDepartment' },
- menus: {
- main: [],
- card: ['DepartmentBasicData'],
- },
- children: [
- {
- name: 'DepartmentCard',
- path: 'department/:id',
- component: () => import('src/pages/Department/Card/DepartmentCard.vue'),
- redirect: { name: 'DepartmentSummary' },
- children: [
- {
- name: 'DepartmentSummary',
- path: 'summary',
- meta: {
- title: 'summary',
- icon: 'launch',
- },
- component: () =>
- import('src/pages/Department/Card/DepartmentSummary.vue'),
- },
- {
- name: 'DepartmentBasicData',
- path: 'basic-data',
- meta: {
- title: 'basicData',
- icon: 'vn:settings',
- },
- component: () =>
- import('src/pages/Department/Card/DepartmentBasicData.vue'),
- },
- ],
- },
- ],
-};
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..a22d5399c 100644
--- a/src/router/modules/index.js
+++ b/src/router/modules/index.js
@@ -8,10 +8,9 @@ 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';
import Entry from './entry';
import roadmap from './roadmap';
import Parking from './parking';
@@ -20,8 +19,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,
@@ -37,7 +34,6 @@ export default [
Travel,
Order,
invoiceIn,
- Department,
Entry,
roadmap,
Parking,
@@ -45,7 +41,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 627692be8..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: [
{
@@ -75,9 +75,9 @@ export default {
},
{
name: 'TravelHistory',
- path: 'history',
+ path: 'log',
meta: {
- title: 'history',
+ title: 'log',
icon: 'history',
},
component: () => import('src/pages/Travel/Card/TravelLog.vue'),
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..e9fb0c4f1 100644
--- a/src/router/modules/worker.js
+++ b/src/router/modules/worker.js
@@ -1,19 +1,12 @@
import { RouterView } from 'vue-router';
-export default {
- path: '/worker',
- name: 'Worker',
+const workerCard = {
+ name: 'WorkerCard',
+ path: ':id',
+ component: () => import('src/pages/Worker/Card/WorkerCard.vue'),
+ redirect: { name: 'WorkerSummary' },
meta: {
- title: 'workers',
- icon: 'vn:worker',
- moduleName: 'Worker',
- keyBinding: 'w',
- },
- component: RouterView,
- redirect: { name: 'WorkerMain' },
- menus: {
- main: ['WorkerList', 'WorkerDepartment'],
- card: [
+ menu: [
'WorkerBasicData',
'WorkerNotes',
'WorkerPda',
@@ -33,207 +26,247 @@ export default {
},
children: [
{
- path: '',
- name: 'WorkerMain',
- component: () => import('src/components/common/VnSectionMain.vue'),
- redirect: { name: 'WorkerList' },
+ name: 'WorkerSummary',
+ path: 'summary',
+ meta: {
+ title: 'summary',
+ icon: 'launch',
+ },
+ component: () => import('src/pages/Worker/Card/WorkerSummary.vue'),
+ },
+ {
+ path: 'basic-data',
+ name: 'WorkerBasicData',
+ meta: {
+ title: 'basicData',
+ icon: 'vn:settings',
+ acls: [
+ {
+ model: 'Worker',
+ props: 'updateAttributes',
+ accessType: 'WRITE',
+ },
+ ],
+ },
+ component: () => import('src/pages/Worker/Card/WorkerBasicData.vue'),
+ },
+ {
+ path: 'notes',
+ name: 'NotesCard',
+ redirect: { name: 'WorkerNotes' },
children: [
{
- path: 'list',
- name: 'WorkerList',
+ path: '',
+ name: 'WorkerNotes',
meta: {
- title: 'list',
- icon: 'view_list',
+ title: 'notes',
+ icon: 'vn:notes',
},
- component: () => import('src/pages/Worker/WorkerList.vue'),
- },
- {
- path: 'department',
- name: 'WorkerDepartment',
- meta: {
- title: 'department',
- icon: 'vn:greuge',
- },
- component: () => import('src/pages/Worker/WorkerDepartment.vue'),
- },
- {
- path: 'create',
- name: 'WorkerCreate',
- meta: {
- title: 'workerCreate',
- icon: 'add',
- },
- component: () => import('src/pages/Worker/WorkerCreate.vue'),
+ component: () => import('src/pages/Worker/Card/WorkerNotes.vue'),
},
],
},
{
- name: 'WorkerCard',
- path: ':id',
- component: () => import('src/pages/Worker/Card/WorkerCard.vue'),
- redirect: { name: 'WorkerSummary' },
+ name: 'WorkerTimeControl',
+ path: 'time-control',
+ meta: {
+ title: 'timeControl',
+ icon: 'access_time',
+ },
+ component: () => import('src/pages/Worker/Card/WorkerTimeControl.vue'),
+ },
+ {
+ name: 'WorkerCalendar',
+ path: 'calendar',
+ meta: {
+ title: 'calendar',
+ icon: 'calendar_today',
+ },
+ component: () => import('src/pages/Worker/Card/WorkerCalendar.vue'),
+ },
+ {
+ name: 'WorkerPda',
+ path: 'pda',
+ meta: {
+ title: 'pda',
+ icon: 'phone_android',
+ },
+ component: () => import('src/pages/Worker/Card/WorkerPda.vue'),
+ },
+ {
+ name: 'WorkerNotificationsManager',
+ path: 'notifications',
+ meta: {
+ title: 'notifications',
+ icon: 'notifications',
+ },
+ component: () =>
+ import('src/pages/Worker/Card/WorkerNotificationsManager.vue'),
+ },
+ {
+ path: 'pbx',
+ name: 'WorkerPBX',
+ meta: {
+ title: 'pbx',
+ icon: 'vn:pbx',
+ },
+ component: () => import('src/pages/Worker/Card/WorkerPBX.vue'),
+ },
+ {
+ name: 'WorkerDms',
+ path: 'dms',
+ meta: {
+ title: 'dms',
+ icon: 'cloud_upload',
+ },
+ component: () => import('src/pages/Worker/Card/WorkerDms.vue'),
+ },
+ {
+ name: 'WorkerLog',
+ path: 'log',
+ meta: {
+ title: 'log',
+ icon: 'vn:History',
+ acls: [{ model: 'WorkerLog', props: 'find', accessType: 'READ' }],
+ },
+ component: () => import('src/pages/Worker/Card/WorkerLog.vue'),
+ },
+ {
+ name: 'WorkerLocker',
+ path: 'locker',
+ meta: {
+ title: 'locker',
+ icon: 'lock',
+ },
+ component: () => import('src/pages/Worker/Card/WorkerLocker.vue'),
+ },
+ {
+ name: 'WorkerBalance',
+ path: 'balance',
+ meta: {
+ title: 'balance',
+ icon: 'balance',
+ },
+ component: () => import('src/pages/Worker/Card/WorkerBalance.vue'),
+ },
+ {
+ name: 'WorkerFormation',
+ path: 'formation',
+ meta: {
+ title: 'formation',
+ icon: 'clinical_notes',
+ },
+ component: () => import('src/pages/Worker/Card/WorkerFormation.vue'),
+ },
+ {
+ name: 'WorkerMedical',
+ path: 'medical',
+ meta: {
+ title: 'medical',
+ icon: 'medical_information',
+ },
+ component: () => import('src/pages/Worker/Card/WorkerMedical.vue'),
+ },
+ {
+ name: 'WorkerPit',
+ path: 'pit',
+ meta: {
+ title: 'pit',
+ icon: 'lock',
+ },
+ component: () => import('src/pages/Worker/Card/WorkerPit.vue'),
+ },
+ {
+ name: 'WorkerOperator',
+ path: 'operator',
+ meta: {
+ title: 'operator',
+ icon: 'person',
+ },
+ component: () => import('src/pages/Worker/Card/WorkerOperator.vue'),
+ },
+ ],
+};
+
+const departmentCard = {
+ name: 'DepartmentCard',
+ path: ':id',
+ component: () => import('src/pages/Department/Card/DepartmentCard.vue'),
+ redirect: { name: 'DepartmentSummary' },
+ meta: {
+ menu: ['DepartmentBasicData'],
+ },
+ children: [
+ {
+ path: 'summary',
+ name: 'DepartmentSummary',
+ meta: {
+ title: 'summary',
+ icon: 'launch',
+ },
+ component: () => import('src/pages/Department/Card/DepartmentSummary.vue'),
+ },
+ {
+ path: 'basic-data',
+ name: 'DepartmentBasicData',
+ meta: {
+ title: 'basicData',
+ icon: 'vn:settings',
+ },
+ component: () => import('src/pages/Department/Card/DepartmentBasicData.vue'),
+ },
+ ],
+};
+
+export default {
+ name: 'Worker',
+ path: '/worker',
+ meta: {
+ title: 'workers',
+ icon: 'vn:worker',
+ moduleName: 'Worker',
+ keyBinding: 'w',
+ menu: ['WorkerList', 'WorkerDepartment'],
+ },
+ component: RouterView,
+ redirect: { name: 'WorkerMain' },
+ children: [
+ {
+ path: '',
+ name: 'WorkerMain',
+ component: () => import('src/components/common/VnModule.vue'),
+ redirect: { name: 'WorkerIndexMain' },
children: [
{
- name: 'WorkerSummary',
- path: 'summary',
- meta: {
- title: 'summary',
- icon: 'launch',
- },
- component: () => import('src/pages/Worker/Card/WorkerSummary.vue'),
- },
- {
- path: 'basic-data',
- name: 'WorkerBasicData',
- meta: {
- title: 'basicData',
- icon: 'vn:settings',
- acls: [
- {
- model: 'Worker',
- props: 'updateAttributes',
- accessType: 'WRITE',
- },
- ],
- },
- component: () => import('src/pages/Worker/Card/WorkerBasicData.vue'),
- },
- {
- path: 'notes',
- name: 'NotesCard',
- redirect: { name: 'WorkerNotes' },
+ path: '',
+ name: 'WorkerIndexMain',
+ redirect: { name: 'WorkerList' },
+ component: () => import('src/pages/Worker/WorkerList.vue'),
children: [
{
- path: '',
- name: 'WorkerNotes',
+ name: 'WorkerList',
+ path: 'list',
meta: {
- title: 'notes',
- icon: 'vn:notes',
+ title: 'list',
+ icon: 'view_list',
},
- component: () =>
- import('src/pages/Worker/Card/WorkerNotes.vue'),
},
+ workerCard,
],
},
{
- name: 'WorkerTimeControl',
- path: 'time-control',
- meta: {
- title: 'timeControl',
- icon: 'access_time',
- },
- component: () =>
- import('src/pages/Worker/Card/WorkerTimeControl.vue'),
- },
- {
- name: 'WorkerCalendar',
- path: 'calendar',
- meta: {
- title: 'calendar',
- icon: 'calendar_today',
- },
- component: () => import('src/pages/Worker/Card/WorkerCalendar.vue'),
- },
- {
- name: 'WorkerPda',
- path: 'pda',
- meta: {
- title: 'pda',
- icon: 'phone_android',
- },
- component: () => import('src/pages/Worker/Card/WorkerPda.vue'),
- },
- {
- name: 'WorkerNotificationsManager',
- path: 'notifications',
- meta: {
- title: 'notifications',
- icon: 'notifications',
- },
- component: () =>
- import('src/pages/Worker/Card/WorkerNotificationsManager.vue'),
- },
- {
- path: 'pbx',
- name: 'WorkerPBX',
- meta: {
- title: 'pbx',
- icon: 'vn:pbx',
- },
- component: () => import('src/pages/Worker/Card/WorkerPBX.vue'),
- },
- {
- name: 'WorkerDms',
- path: 'dms',
- meta: {
- title: 'dms',
- icon: 'cloud_upload',
- },
- component: () => import('src/pages/Worker/Card/WorkerDms.vue'),
- },
- {
- name: 'WorkerLog',
- path: 'log',
- meta: {
- title: 'log',
- icon: 'vn:History',
- acls: [{ model: 'WorkerLog', props: 'find', accessType: 'READ' }],
- },
- component: () => import('src/pages/Worker/Card/WorkerLog.vue'),
- },
- {
- name: 'WorkerLocker',
- path: 'locker',
- meta: {
- title: 'locker',
- icon: 'lock',
- },
- component: () => import('src/pages/Worker/Card/WorkerLocker.vue'),
- },
- {
- name: 'WorkerBalance',
- path: 'balance',
- meta: {
- title: 'balance',
- icon: 'balance',
- },
- component: () => import('src/pages/Worker/Card/WorkerBalance.vue'),
- },
- {
- name: 'WorkerFormation',
- path: 'formation',
- meta: {
- title: 'formation',
- icon: 'clinical_notes',
- },
- component: () => import('src/pages/Worker/Card/WorkerFormation.vue'),
- },
- {
- name: 'WorkerMedical',
- path: 'medical',
- meta: {
- title: 'medical',
- icon: 'medical_information',
- },
- component: () => import('src/pages/Worker/Card/WorkerMedical.vue'),
- },
- {
- name: 'WorkerPit',
- path: 'pit',
- meta: {
- title: 'pit',
- icon: 'lock',
- },
- component: () => import('src/pages/Worker/Card/WorkerPit.vue'),
- },
- {
- name: 'WorkerOperator',
- path: 'operator',
- meta: {
- title: 'operator',
- icon: 'person',
- },
- component: () => import('src/pages/Worker/Card/WorkerOperator.vue'),
+ path: 'department',
+ name: 'Department',
+ redirect: { name: 'WorkerDepartment' },
+ component: () => import('src/pages/Worker/WorkerDepartment.vue'),
+ children: [
+ {
+ name: 'WorkerDepartment',
+ path: 'list',
+ meta: { title: 'department', icon: 'vn:greuge' },
+ },
+ departmentCard,
+ ],
},
],
},
diff --git a/src/router/modules/zone.js b/src/router/modules/zone.js
index 1f27cc76f..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'),
},
@@ -106,7 +106,7 @@ export default {
},
{
name: 'ZoneHistory',
- path: 'history',
+ path: 'log',
meta: {
title: 'log',
icon: 'history',
diff --git a/src/router/routes.js b/src/router/routes.js
index cced308b5..d84ba7e46 100644
--- a/src/router/routes.js
+++ b/src/router/routes.js
@@ -7,10 +7,8 @@ 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 +19,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 = [
{
@@ -87,7 +84,6 @@ const routes = [
route,
supplier,
travel,
- department,
roadmap,
entry,
parking,
@@ -95,8 +91,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/src/utils/dataByOrder.js b/src/utils/dataByOrder.js
index 1bdedb8a1..eb4a4f586 100644
--- a/src/utils/dataByOrder.js
+++ b/src/utils/dataByOrder.js
@@ -1,6 +1,7 @@
function orderData(data, order) {
if (typeof order === 'function') return data.sort(data);
if (typeof order === 'string') order = [order];
+ if (!Array.isArray(data)) return [];
if (Array.isArray(order)) {
let orderComp = [];
diff --git a/test/cypress/.gitignore b/test/cypress/.gitignore
index 8d940320e..c9793a5f2 100644
--- a/test/cypress/.gitignore
+++ b/test/cypress/.gitignore
@@ -1,2 +1,3 @@
reports/*
screenshots/*
+downloads/*
\ No newline at end of file
diff --git a/test/cypress/integration/Order/orderCatalog.spec.js b/test/cypress/integration/Order/orderCatalog.spec.js
index 45eda6f1f..cffc47f91 100644
--- a/test/cypress/integration/Order/orderCatalog.spec.js
+++ b/test/cypress/integration/Order/orderCatalog.spec.js
@@ -11,21 +11,6 @@ describe('OrderCatalog', () => {
cy.dataCy('catalogFilterCustomTag').contains(filterName);
};
- const checkFilterTag = (filterName = 'Plant') => {
- cy.dataCy('vnFilterPanelChip').should('exist');
- cy.dataCy('vnFilterPanelChip').contains(filterName);
- };
-
- const selectCategory = (categoryIndex = 1, categoryName = 'Plant') => {
- cy.get(
- `div.q-page-container div:nth-of-type(${categoryIndex}) > [data-cy='catalogFilterCategory']`
- ).should('exist');
- cy.get(
- `div.q-page-container div:nth-of-type(${categoryIndex}) > [data-cy='catalogFilterCategory']`
- ).click();
- checkCustomFilterTag(categoryName);
- };
-
const searchByCustomTagInput = (option) => {
cy.dataCy('catalogFilterValueInput').find('input').last().focus();
cy.dataCy('catalogFilterValueInput').find('input').last().type(option);
@@ -33,31 +18,19 @@ describe('OrderCatalog', () => {
checkCustomFilterTag(option);
};
- const selectTypeFilter = (option) => {
- cy.selectOption(
- 'div.q-page-container div.list > div:nth-of-type(2) div:nth-of-type(3)',
- option
- );
- checkFilterTag(option);
- };
-
it('Shows empty state', () => {
cy.dataCy('orderCatalogPage').should('exist');
cy.dataCy('orderCatalogPage').contains('No data to display');
});
- it('filter by category', () => {
- selectCategory();
+ it('filter by category and type', () => {
+ cy.get(':nth-child(1) > [data-cy="catalogFilterCategory"]').click();
+ cy.selectOption('[data-cy="catalogFilterType"]', 'Anthurium');
cy.dataCy('orderCatalogItem').should('exist');
});
- it('filters by type', () => {
- selectCategory();
- selectTypeFilter('Anthurium');
- });
-
it('filters by custom value select', () => {
- selectCategory();
+ cy.get(':nth-child(1) > [data-cy="catalogFilterCategory"]').click();
searchByCustomTagInput('Silver');
});
@@ -67,10 +40,12 @@ describe('OrderCatalog', () => {
return false;
}
});
- selectCategory();
- cy.dataCy('catalogFilterValueDialogBtn').should('exist');
+ cy.get(
+ '[data-cy="vn-searchbar"] > .q-field > .q-field__inner > .q-field__control'
+ ).type('{enter}');
+ cy.get(':nth-child(1) > [data-cy="catalogFilterCategory"]').click();
cy.dataCy('catalogFilterValueDialogBtn').last().click();
- cy.dataCy('catalogFilterValueDialogTagSelect').should('exist');
+ cy.get('[data-cy="catalogFilterValueDialogTagSelect"]').click();
cy.selectOption("[data-cy='catalogFilterValueDialogTagSelect']", 'Tallos');
cy.dataCy('catalogFilterValueDialogValueInput').find('input').focus();
cy.dataCy('catalogFilterValueDialogValueInput').find('input').type('2');
@@ -79,34 +54,16 @@ describe('OrderCatalog', () => {
});
it('removes a secondary tag', () => {
- selectCategory();
- selectTypeFilter('Anthurium');
+ cy.get(':nth-child(1) > [data-cy="catalogFilterCategory"]').click();
+ cy.selectOption('[data-cy="catalogFilterType"]', 'Anthurium');
cy.dataCy('vnFilterPanelChip').should('exist');
- cy.get(
- "div.q-page-container [data-cy='vnFilterPanelChip'] > i.q-chip__icon--remove"
- )
- .contains('cancel')
- .should('exist');
- cy.get(
- "div.q-page-container [data-cy='vnFilterPanelChip'] > i.q-chip__icon--remove"
- )
- .contains('cancel')
- .click();
+ cy.get('[data-cy="catalogFilterCustomTag"] > .q-chip__icon--remove').click();
cy.dataCy('vnFilterPanelChip').should('not.exist');
});
it('Removes category tag', () => {
- selectCategory();
- cy.get(
- "div.q-page-container [data-cy='catalogFilterCustomTag'] > i.q-chip__icon--remove"
- )
- .contains('cancel')
- .should('exist');
- cy.get(
- "div.q-page-container [data-cy='catalogFilterCustomTag'] > i.q-chip__icon--remove"
- )
- .contains('cancel')
- .click();
+ cy.get(':nth-child(1) > [data-cy="catalogFilterCategory"]').click();
+ cy.get('.q-chip__icon--remove').click();
cy.dataCy('catalogFilterCustomTag').should('not.exist');
});
});
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 7b0a19828..bed28dc22 100644
--- a/test/cypress/integration/client/clientBasicData.spec.js
+++ b/test/cypress/integration/client/clientBasicData.spec.js
@@ -3,11 +3,17 @@ describe('Client basic data', () => {
beforeEach(() => {
cy.viewport(1280, 720);
cy.login('developer');
- cy.visit('#/customer/1110/basic-data', {
- timeout: 5000,
- });
+ cy.visit('#/customer/1102/basic-data');
});
it('Should load layout', () => {
cy.get('.q-card').should('be.visible');
+ 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;
+ cy.wrap(body).should('have.property', 'phone', '123456789');
+ });
+ cy.get('.q-notification__message').should('have.text', 'Data saved');
});
});
diff --git a/test/cypress/integration/client/clientBillingData.spec.js b/test/cypress/integration/client/clientBillingData.spec.js
index 00af82e39..16e8fc0fc 100644
--- a/test/cypress/integration/client/clientBillingData.spec.js
+++ b/test/cypress/integration/client/clientBillingData.spec.js
@@ -8,6 +8,6 @@ describe('Client billing data', () => {
});
});
it('Should load layout', () => {
- cy.get('.q-card').should('be.visible');
+ cy.get('.q-page').should('be.visible');
});
});
diff --git a/test/cypress/integration/client/clientFiscalData.spec.js b/test/cypress/integration/client/clientFiscalData.spec.js
index e337c26f8..05e0772e9 100644
--- a/test/cypress/integration/client/clientFiscalData.spec.js
+++ b/test/cypress/integration/client/clientFiscalData.spec.js
@@ -3,11 +3,16 @@ describe('Client fiscal data', () => {
beforeEach(() => {
cy.viewport(1280, 720);
cy.login('developer');
- cy.visit('#/customer/1110/fiscal-data', {
+ cy.visit('#/customer/1107/fiscal-data', {
timeout: 5000,
});
});
- it('Should load layout', () => {
+ it('Should change required value when change customer', () => {
cy.get('.q-card').should('be.visible');
+ cy.dataCy('sageTaxTypeFk').filter('input').should('not.have.attr', 'required');
+ cy.get('#searchbar input').clear();
+ cy.get('#searchbar input').type('1{enter}');
+ cy.get('.q-item > .q-item__label').should('have.text', ' #1');
+ cy.dataCy('sageTaxTypeFk').filter('input').should('have.attr', 'required');
});
});
diff --git a/test/cypress/integration/client/clientList.spec.js b/test/cypress/integration/client/clientList.spec.js
index 431ac0548..d5723375b 100644
--- a/test/cypress/integration/client/clientList.spec.js
+++ b/test/cypress/integration/client/clientList.spec.js
@@ -15,24 +15,26 @@ describe('Client list', () => {
});
});
- it('Client list create new client', () => {
- cy.get('.q-page-sticky > div > .q-btn > .q-btn__content > .q-icon').click();
+ it.skip('Client list create new client', () => {
+ cy.addBtnClick();
+ const randomInt = Math.floor(Math.random() * 90) + 10;
+
const data = {
- Name: { val: 'Name 1' },
- 'Social name': { val: 'TEST 1' },
- 'Tax number': { val: '20852113Z' },
- 'Web user': { val: 'user_test_1' },
- Street: { val: 'C/ STREET 1' },
- Email: { val: 'user.test@1.com' },
- 'Sales person': { val: 'employee', type: 'select' },
- Location: { val: '46000, Valencia(Province one), España', type: 'select' },
+ Name: { val: `Name ${randomInt}` },
+ 'Social name': { val: `TEST ${randomInt}` },
+ 'Tax number': { val: `20852${randomInt}3Z` },
+ 'Web user': { val: `user_test_${randomInt}` },
+ Street: { val: `C/ STREET ${randomInt}` },
+ 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('created');
+ cy.checkNotification('Data created');
cy.url().should('include', '/summary');
});
it('Client list search client', () => {
@@ -54,8 +56,8 @@ describe('Client list', () => {
cy.openActionDescriptor('Create ticket');
cy.waitForElement('#formModel');
cy.waitForElement('.q-form');
- cy.checkValueSelectForm(1, search);
- cy.checkValueSelectForm(2, search);
+ cy.checkValueForm(1, search);
+ cy.checkValueForm(2, search);
});
it('Client founded create order', () => {
const search = 'Jessica Jones';
diff --git a/test/cypress/integration/client/clientSms.spec.js b/test/cypress/integration/client/clientSms.spec.js
new file mode 100644
index 000000000..731522a5c
--- /dev/null
+++ b/test/cypress/integration/client/clientSms.spec.js
@@ -0,0 +1,12 @@
+///
+describe('Client notes', () => {
+ beforeEach(() => {
+ cy.viewport(1280, 720);
+ cy.login('developer');
+ cy.visit('#/customer/1101/sms');
+ });
+ it('Should load layout', () => {
+ cy.get('.q-page').should('be.visible');
+ cy.get('.q-page > :nth-child(2) > :nth-child(1)').should('be.visible');
+ });
+});
diff --git a/test/cypress/integration/client/clientWebAccess.spec.js b/test/cypress/integration/client/clientWebAccess.spec.js
index 47f9efa4c..6803336a3 100644
--- a/test/cypress/integration/client/clientWebAccess.spec.js
+++ b/test/cypress/integration/client/clientWebAccess.spec.js
@@ -3,11 +3,26 @@ describe('Client web-access', () => {
beforeEach(() => {
cy.viewport(1280, 720);
cy.login('developer');
- cy.visit('#/customer/1110/web-access', {
- timeout: 5000,
- });
});
- it('Should load layout', () => {
+ it('Should test buttons ', () => {
+ cy.visit('#/customer/1101/web-access');
+ cy.get('.q-page').should('be.visible');
+ cy.get('#formModel').should('be.visible');
cy.get('.q-card').should('be.visible');
+ cy.get('.q-btn-group > :nth-child(1)').should('not.be.disabled');
+ cy.get('.q-checkbox__inner').click();
+ cy.get('.q-btn-group > .q-btn--standard.q-btn--actionable').should(
+ 'not.be.disabled'
+ );
+ cy.get('.q-btn-group > .q-btn--flat').should('not.be.disabled');
+ cy.get('.q-btn-group > :nth-child(1)').click();
+ cy.get('.q-dialog__inner > .q-card > :nth-child(1)')
+ .should('be.visible')
+ .find('.text-h6')
+ .should('have.text', 'Change password');
+ });
+ it('Should disabled buttons', () => {
+ cy.visit('#/customer/1110/web-access');
+ cy.get('.q-btn-group > :nth-child(1)').should('be.disabled');
});
});
diff --git a/test/cypress/integration/client/credit-management/clientCreditContracts.spec.js b/test/cypress/integration/client/credit-management/clientCreditContracts.spec.js
index 3c35d5ed0..1c2f935fc 100644
--- a/test/cypress/integration/client/credit-management/clientCreditContracts.spec.js
+++ b/test/cypress/integration/client/credit-management/clientCreditContracts.spec.js
@@ -1,5 +1,5 @@
///
-describe('Client credit opinion', () => {
+describe('Client credit contracts', () => {
beforeEach(() => {
cy.viewport(1280, 720);
cy.login('developer');
@@ -8,6 +8,6 @@ describe('Client credit opinion', () => {
});
});
it('Should load layout', () => {
- cy.get('.q-card').should('be.visible');
+ cy.get('.q-page').should('be.visible');
});
});
diff --git a/test/cypress/integration/client/others/clientUnpaid.spec.js b/test/cypress/integration/client/others/clientUnpaid.spec.js
index 9972ba0e9..ab6bc18bf 100644
--- a/test/cypress/integration/client/others/clientUnpaid.spec.js
+++ b/test/cypress/integration/client/others/clientUnpaid.spec.js
@@ -3,11 +3,17 @@ describe('Client unpaid', () => {
beforeEach(() => {
cy.viewport(1280, 720);
cy.login('developer');
- cy.visit('#/customer/1110/others/unpaid', {
- timeout: 5000,
- });
});
- it('Should load layout', () => {
+ it('Should add unpaid', () => {
+ cy.visit('#/customer/1102/others/unpaid');
cy.get('.q-card').should('be.visible');
+ cy.get('.q-checkbox__inner').click();
+ cy.dataCy('customerUnpaidAmount').find('input').type('100');
+ cy.dataCy('customerUnpaidDate').find('input').type('01/01/2001');
+ cy.get('.q-btn-group > .q-btn--standard').click();
+ cy.reload();
+ cy.get('.q-checkbox__inner')
+ .should('be.visible')
+ .and('not.have.class', 'q-checkbox__inner--active');
});
});
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/invoiceOut/invoiceOutList.spec.js b/test/cypress/integration/invoiceOut/invoiceOutList.spec.js
new file mode 100644
index 000000000..30cc8e497
--- /dev/null
+++ b/test/cypress/integration/invoiceOut/invoiceOutList.spec.js
@@ -0,0 +1,46 @@
+///
+describe('InvoiceOut list', () => {
+ const invoice = {
+ Ticket: { val: '8' },
+ Serial: { val: 'Española rapida', type: 'select' },
+ };
+ const invoiceError = {
+ Ticket: { val: '1' },
+ Serial: { val: 'Española rapida', type: 'select' },
+ };
+
+ beforeEach(() => {
+ cy.viewport(1920, 1080);
+ cy.login('developer');
+ cy.visit(`/#/invoice-out/list`);
+ cy.typeSearchbar('{enter}');
+ });
+
+ it('should search and filter an invoice and enter to the summary', () => {
+ cy.typeSearchbar('1{enter}');
+ cy.get('.q-virtual-scroll__content > :nth-child(2) > :nth-child(7)').click();
+ cy.get('.header > a.q-btn > .q-btn__content').click();
+ cy.typeSearchbar('{enter}');
+ cy.dataCy('InvoiceOutFilterAmountBtn').find('input').type('8.88{enter}');
+ });
+
+ it('should download all pdfs', () => {
+ cy.get('.bg-header > :nth-child(1) > .q-checkbox > .q-checkbox__inner').click();
+ cy.dataCy('InvoiceOutDownloadPdfBtn').click();
+ cy.get('.bg-header > :nth-child(1) > .q-checkbox > .q-checkbox__inner').click();
+ });
+
+ it('should give an error when manual invoicing a ticket that is already invoiced', () => {
+ cy.dataCy('vnTableCreateBtn').click();
+ cy.fillInForm(invoiceError);
+ cy.dataCy('FormModelPopup_save').click();
+ cy.checkNotification('This ticket is already invoiced');
+ });
+
+ it('should create a manual invoice and enter to its summary', () => {
+ cy.dataCy('vnTableCreateBtn').click();
+ cy.fillInForm(invoice);
+ cy.dataCy('FormModelPopup_save').click();
+ cy.checkNotification('Data created');
+ });
+});
diff --git a/test/cypress/integration/invoiceOut/invoiceOutMakeInvoice.spec.js b/test/cypress/integration/invoiceOut/invoiceOutMakeInvoice.spec.js
new file mode 100644
index 000000000..145f492a1
--- /dev/null
+++ b/test/cypress/integration/invoiceOut/invoiceOutMakeInvoice.spec.js
@@ -0,0 +1,21 @@
+///
+describe('InvoiceOut manual invoice', () => {
+ beforeEach(() => {
+ cy.viewport(1920, 1080);
+ cy.login('developer');
+ cy.visit(`/#/ticket/list`);
+ cy.get('#searchbar input').type('{enter}');
+ });
+
+ it('should create an invoice from a ticket and go to that invoice', () => {
+ cy.searchByLabel('Customer ID', '1101');
+ cy.get(
+ '[data-q-vs-anchor=""] > :nth-child(1) > .q-checkbox > .q-checkbox__inner'
+ ).click();
+ cy.dataCy('ticketListMakeInvoiceBtn').click();
+ cy.checkNotification('Data saved');
+ cy.get('.q-virtual-scroll__content > :nth-child(1) > :nth-child(3)').click();
+ cy.get(':nth-child(8) > .value > .link').click();
+ cy.get('.header > :nth-child(3) > .q-btn__content').click();
+ });
+});
diff --git a/test/cypress/integration/invoiceOut/invoiceOutNegativeBases.spec.js b/test/cypress/integration/invoiceOut/invoiceOutNegativeBases.spec.js
new file mode 100644
index 000000000..5f629df0b
--- /dev/null
+++ b/test/cypress/integration/invoiceOut/invoiceOutNegativeBases.spec.js
@@ -0,0 +1,16 @@
+///
+describe('InvoiceOut negative bases', () => {
+ beforeEach(() => {
+ cy.viewport(1920, 1080);
+ cy.login('developer');
+ cy.visit(`/#/invoice-out/negative-bases`);
+ });
+
+ it('should filter and download as CSV', () => {
+ cy.get(
+ ':nth-child(7) > .full-width > :nth-child(1) > .column > div.q-px-xs > .q-field > .q-field__inner > .q-field__control'
+ ).type('23{enter}');
+ cy.get('#subToolbar > .q-btn').click();
+ cy.checkNotification('CSV downloaded successfully');
+ });
+});
diff --git a/test/cypress/integration/invoiceOut/invoiceOutSummary.spec.js b/test/cypress/integration/invoiceOut/invoiceOutSummary.spec.js
new file mode 100644
index 000000000..b7fd11307
--- /dev/null
+++ b/test/cypress/integration/invoiceOut/invoiceOutSummary.spec.js
@@ -0,0 +1,47 @@
+///
+describe('InvoiceOut summary', () => {
+ const transferInvoice = {
+ Client: { val: 'employee', type: 'select' },
+ Type: { val: 'Error in customer data', type: 'select' },
+ };
+
+ beforeEach(() => {
+ cy.viewport(1920, 1080);
+ cy.login('developer');
+ cy.visit(`/#/invoice-out/list`);
+ cy.typeSearchbar('{enter}');
+ });
+
+ it('should generate the invoice PDF', () => {
+ cy.typeSearchbar('T1111111{enter}');
+ cy.dataCy('descriptor-more-opts').click();
+ cy.get('.q-menu > .q-list > :nth-child(6)').click();
+ cy.dataCy('VnConfirm_confirm').click();
+ cy.checkNotification('The invoice PDF document has been regenerated');
+ });
+
+ it('should refund the invoice ', () => {
+ cy.typeSearchbar('T1111111{enter}');
+ cy.dataCy('descriptor-more-opts').click();
+ cy.get('.q-menu > .q-list > :nth-child(7)').click();
+ cy.get('#q-portal--menu--3 > .q-menu > .q-list > :nth-child(2)').click();
+ cy.checkNotification('The following refund ticket have been created 1000000');
+ });
+
+ it('should delete an invoice ', () => {
+ cy.typeSearchbar('T2222222{enter}');
+ cy.dataCy('descriptor-more-opts').click();
+ cy.get('.q-menu > .q-list > :nth-child(4)').click();
+ cy.dataCy('VnConfirm_confirm').click();
+ cy.checkNotification('InvoiceOut deleted');
+ });
+
+ it('should transfer the invoice ', () => {
+ cy.typeSearchbar('T1111111{enter}');
+ cy.dataCy('descriptor-more-opts').click();
+ cy.get('.q-menu > .q-list > :nth-child(1)').click();
+ cy.fillInForm(transferInvoice);
+ cy.get('.q-mt-lg > .q-btn').click();
+ cy.checkNotification('Transferred invoice');
+ });
+});
diff --git a/test/cypress/integration/invoiceOut/invvoiceOutGlobal.spec.js b/test/cypress/integration/invoiceOut/invvoiceOutGlobal.spec.js
new file mode 100644
index 000000000..06e132b39
--- /dev/null
+++ b/test/cypress/integration/invoiceOut/invvoiceOutGlobal.spec.js
@@ -0,0 +1,28 @@
+///
+describe('InvoiceOut global invoicing', () => {
+ beforeEach(() => {
+ cy.viewport(1920, 1080);
+ cy.login('administrative');
+ cy.visit(`/#/invoice-out/global-invoicing`);
+ });
+
+ it('should invoice the client tickets', () => {
+ cy.get('.q-mb-sm > .q-radio__inner').click();
+ cy.dataCy('InvoiceOutGlobalClientSelect').type('1102');
+ cy.get('.q-menu .q-item').contains('1102').click();
+ cy.dataCy('InvoiceOutGlobalSerialSelect').click();
+ cy.get('.q-menu .q-item').contains('global').click();
+ cy.dataCy('InvoiceOutGlobalCompanySelect').type('VNL');
+ cy.get('.q-menu .q-item').contains('VNL').click();
+ cy.dataCy('InvoiceOutGlobalPrinterSelect').type('printer1');
+ cy.get('.q-menu .q-item').contains('printer1').click();
+ cy.get(
+ '[label="Invoice date"] > .q-field > .q-field__inner > .q-field__control'
+ ).click();
+ cy.get(':nth-child(5) > div > .q-btn > .q-btn__content > .block').click();
+ cy.get('.q-date__years-content > :nth-child(2) > .q-btn').click();
+ cy.get('.q-date__calendar-days > :nth-child(6) > .q-btn').click();
+ cy.get('[label="Max date ticket"]').type('01-01-2001{enter}');
+ cy.get('.q-card').should('be.visible');
+ });
+});
diff --git a/test/cypress/integration/item/ItemFixedPrice.spec.js b/test/cypress/integration/item/ItemFixedPrice.spec.js
new file mode 100644
index 000000000..edb6a63fe
--- /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.skip('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.skip('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.skip('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.skip('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/item/itemBarcodes.spec.js b/test/cypress/integration/item/itemBarcodes.spec.js
new file mode 100644
index 000000000..4d17fa260
--- /dev/null
+++ b/test/cypress/integration/item/itemBarcodes.spec.js
@@ -0,0 +1,25 @@
+///
+describe('Item shelving', () => {
+ beforeEach(() => {
+ cy.viewport(1920, 1080);
+ cy.login('developer');
+ cy.visit(`/#/item/list`);
+ cy.typeSearchbar('1{enter}');
+ });
+
+ it('should throw an error if the barcode exists', () => {
+ cy.get('[href="#/item/1/barcode"]').click();
+ cy.get('.q-card > .q-btn > .q-btn__content > .q-icon').click();
+ cy.dataCy('Code_input').eq(3).type('1111111111');
+ cy.dataCy('crudModelDefaultSaveBtn').click();
+ cy.checkNotification('Codes can not be repeated');
+ });
+
+ it('should create a new barcode', () => {
+ cy.get('[href="#/item/1/barcode"]').click();
+ cy.get('.q-card > .q-btn > .q-btn__content > .q-icon').click();
+ cy.dataCy('Code_input').eq(3).type('1231231231');
+ cy.dataCy('crudModelDefaultSaveBtn').click();
+ cy.checkNotification('Data saved');
+ });
+});
diff --git a/test/cypress/integration/item/itemBotanical.spec.js b/test/cypress/integration/item/itemBotanical.spec.js
new file mode 100644
index 000000000..08886d9a8
--- /dev/null
+++ b/test/cypress/integration/item/itemBotanical.spec.js
@@ -0,0 +1,31 @@
+///
+describe('Item botanical', () => {
+ beforeEach(() => {
+ cy.viewport(1920, 1080);
+ cy.login('developer');
+ cy.visit(`/#/item/1/botanical`);
+ });
+
+ it('should modify the botanical', () => {
+ cy.dataCy('AddGenusSelectDialog').type('Abies');
+ cy.get('.q-menu .q-item').contains('Abies').click();
+ cy.dataCy('AddSpeciesSelectDialog').type('dealbata');
+ cy.get('.q-menu .q-item').contains('dealbata').click();
+ cy.get('.q-btn-group > .q-btn--standard').click();
+ cy.checkNotification('Data saved');
+ });
+
+ it('should create a new Genus', () => {
+ cy.dataCy('Genus_icon').click();
+ cy.dataCy('Latin genus name_input').type('Test');
+ cy.dataCy('FormModelPopup_save').click();
+ cy.checkNotification('Data created');
+ });
+
+ it('should create a new specie', () => {
+ cy.dataCy('Species_icon').click();
+ cy.dataCy('Latin species name_input').type('Test specie');
+ cy.dataCy('FormModelPopup_save').click();
+ cy.checkNotification('Data created');
+ });
+});
diff --git a/test/cypress/integration/item/itemList.spec.js b/test/cypress/integration/item/itemList.spec.js
new file mode 100644
index 000000000..49e393451
--- /dev/null
+++ b/test/cypress/integration/item/itemList.spec.js
@@ -0,0 +1,34 @@
+///
+
+describe('Item list', () => {
+ beforeEach(() => {
+ cy.viewport(1920, 1080);
+ cy.login('developer');
+ cy.visit(`/#/item/list`);
+ cy.typeSearchbar('{enter}');
+ });
+
+ it('should filter the items and redirect to the summary', () => {
+ cy.dataCy('Category_select').type('Plant');
+ cy.get('.q-menu .q-item').contains('Plant').click();
+ cy.dataCy('Type_select').type('Anthurium');
+ cy.get('.q-menu .q-item').contains('Anthurium').click();
+ cy.get('.q-virtual-scroll__content > :nth-child(4) > :nth-child(4)').click();
+ });
+
+ it('should create an item', () => {
+ const data = {
+ Description: { val: `Test item` },
+ Type: { val: `Crisantemo`, type: 'select' },
+ Intrastat: { val: `Coral y materiales similares`, type: 'select' },
+ Origin: { val: `SPA`, type: 'select' },
+ };
+ cy.dataCy('vnTableCreateBtn').click();
+ cy.fillInForm(data);
+ cy.dataCy('FormModelPopup_save').click();
+ cy.checkNotification('Data created');
+ cy.get(
+ ':nth-child(2) > .q-drawer > .q-drawer__content > .q-scrollarea > .q-scrollarea__container > .q-scrollarea__content'
+ ).should('be.visible');
+ });
+});
diff --git a/test/cypress/integration/item/itemSummary.spec.js b/test/cypress/integration/item/itemSummary.spec.js
new file mode 100644
index 000000000..ad8267ecf
--- /dev/null
+++ b/test/cypress/integration/item/itemSummary.spec.js
@@ -0,0 +1,24 @@
+///
+describe('Item summary', () => {
+ beforeEach(() => {
+ cy.viewport(1920, 1080);
+ cy.login('developer');
+ cy.visit(`/#/item/1/summary`);
+ });
+
+ it('should clone the item', () => {
+ cy.dataCy('descriptor-more-opts').click();
+ cy.get('.q-menu > .q-list > :nth-child(2) > .q-item__section').click();
+ cy.dataCy('VnConfirm_confirm').click();
+ cy.waitForElement('[data-cy="itemTags"]');
+ cy.dataCy('itemTags').should('be.visible');
+ });
+
+ it('should regularize stock', () => {
+ cy.dataCy('descriptor-more-opts').click();
+ cy.get('.q-menu > .q-list > :nth-child(1) > .q-item__section').click();
+ cy.dataCy('regularizeStockInput').type('10');
+ cy.dataCy('Warehouse_select').type('Warehouse One{enter}');
+ cy.checkNotification('Data created');
+ });
+});
diff --git a/test/cypress/integration/item/itemTag.spec.js b/test/cypress/integration/item/itemTag.spec.js
new file mode 100644
index 000000000..c2de93068
--- /dev/null
+++ b/test/cypress/integration/item/itemTag.spec.js
@@ -0,0 +1,39 @@
+///
+describe('Item tag', () => {
+ beforeEach(() => {
+ cy.viewport(1920, 1080);
+ cy.login('developer');
+ cy.visit(`/#/item/1/tags`);
+ });
+
+ it('should throw an error adding an existent tag', () => {
+ cy.get('.q-page').should('be.visible');
+ cy.get('.q-page-sticky > div').click();
+ cy.get('.q-page-sticky > div').click();
+ cy.dataCy('Tag_select').eq(7).type('Tallos');
+ cy.get('.q-menu .q-item').contains('Tallos').click();
+ cy.get(
+ ':nth-child(8) > [label="Value"] > .q-field > .q-field__inner > .q-field__control > .q-field__control-container > [data-cy="Value_input"]'
+ ).type('1');
+ +cy.dataCy('crudModelDefaultSaveBtn').click();
+ cy.checkNotification("The tag or priority can't be repeated for an item");
+ });
+
+ it('should add a new tag', () => {
+ cy.get('.q-page').should('be.visible');
+ cy.get('.q-page-sticky > div').click();
+ cy.get('.q-page-sticky > div').click();
+ cy.dataCy('Tag_select').eq(7).click();
+ cy.get('.q-menu .q-item').contains('Ancho de la base').click();
+ cy.get(
+ ':nth-child(8) > [label="Value"] > .q-field > .q-field__inner > .q-field__control > .q-field__control-container > [data-cy="Value_input"]'
+ ).type('50');
+ cy.dataCy('crudModelDefaultSaveBtn').click();
+ cy.checkNotification('Data saved');
+ cy.get(
+ '[data-cy="itemTags"] > :nth-child(7) > .justify-center > .q-icon'
+ ).click();
+ cy.dataCy('VnConfirm_confirm').click();
+ cy.checkNotification('Data saved');
+ });
+});
diff --git a/test/cypress/integration/item/itemTax.spec.js b/test/cypress/integration/item/itemTax.spec.js
new file mode 100644
index 000000000..6ff147135
--- /dev/null
+++ b/test/cypress/integration/item/itemTax.spec.js
@@ -0,0 +1,14 @@
+///
+describe('Item tax', () => {
+ beforeEach(() => {
+ cy.viewport(1920, 1080);
+ cy.login('developer');
+ cy.visit(`/#/item/1/tax`);
+ });
+
+ it('should modify the tax for Spain', () => {
+ cy.dataCy('Class_select').eq(1).type('General VAT{enter}');
+ cy.dataCy('crudModelDefaultSaveBtn').click();
+ cy.checkNotification('Data saved');
+ });
+});
diff --git a/test/cypress/integration/item/itemType.spec.js b/test/cypress/integration/item/itemType.spec.js
new file mode 100644
index 000000000..b0a7b0ca9
--- /dev/null
+++ b/test/cypress/integration/item/itemType.spec.js
@@ -0,0 +1,40 @@
+///
+describe('Item type', () => {
+ beforeEach(() => {
+ cy.viewport(1920, 1080);
+ cy.login('developer');
+ cy.visit(`/#/item/item-type`);
+ });
+
+ it('should throw an error if the code already exists', () => {
+ cy.dataCy('vnTableCreateBtn').click();
+ cy.get(
+ 'div.fit > .q-field > .q-field__inner > .q-field__control > .q-field__control-container > [data-cy="Code_input"]'
+ ).type('ALS');
+ cy.get(
+ 'div.fit > .q-field > .q-field__inner > .q-field__control > .q-field__control-container > [data-cy="Name_input"]'
+ ).type('Alstroemeria');
+ cy.dataCy('Worker_select').type('employeeNick');
+ cy.get('.q-menu .q-item').contains('employeeNick').click();
+ cy.dataCy('ItemCategory_select').type('Artificial');
+ cy.get('.q-menu .q-item').contains('Artificial').click();
+ cy.dataCy('FormModelPopup_save').click();
+ cy.checkNotification('An item type with the same code already exists');
+ });
+
+ it('should create a new type', () => {
+ cy.dataCy('vnTableCreateBtn').click();
+ cy.get(
+ 'div.fit > .q-field > .q-field__inner > .q-field__control > .q-field__control-container > [data-cy="Code_input"]'
+ ).type('LIL');
+ cy.get(
+ 'div.fit > .q-field > .q-field__inner > .q-field__control > .q-field__control-container > [data-cy="Name_input"]'
+ ).type('Lilium');
+ cy.dataCy('Worker_select').type('buyerNick');
+ cy.get('.q-menu .q-item').contains('buyerNick').click();
+ cy.dataCy('ItemCategory_select').type('Flower');
+ cy.get('.q-menu .q-item').contains('Flower').click();
+ cy.dataCy('FormModelPopup_save').click();
+ cy.checkNotification('Data created');
+ });
+});
diff --git a/test/cypress/integration/outLogin/login.spec.js b/test/cypress/integration/outLogin/login.spec.js
index 3db223cdb..2bd5a8c3b 100755
--- a/test/cypress/integration/outLogin/login.spec.js
+++ b/test/cypress/integration/outLogin/login.spec.js
@@ -19,6 +19,7 @@ describe('Login', () => {
it('should fail to log in using wrong password', () => {
cy.get('input[aria-label="Username"]').type('employee');
cy.get('input[aria-label="Password"]').type('wrongPassword');
+ cy.get('.q-field__append > .q-icon');
cy.get('button[type="submit"]').click();
cy.get('.q-notification__message').should(
'have.text',
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..e273825c0 100644
--- a/test/cypress/integration/ticket/ticketList.spec.js
+++ b/test/cypress/integration/ticket/ticketList.spec.js
@@ -9,9 +9,9 @@ describe('TicketList', () => {
});
const searchResults = (search) => {
- cy.dataCy('vnSearchBar').find('input').focus();
- if (search) cy.dataCy('vnSearchBar').find('input').type(search);
- cy.dataCy('vnSearchBar').find('input').type('{enter}');
+ cy.dataCy('vn-searchbar').find('input').focus();
+ if (search) cy.dataCy('vn-searchbar').find('input').type(search);
+ cy.dataCy('vn-searchbar').find('input').type('{enter}');
cy.dataCy('ticketListTable').should('exist');
cy.get(firstRow).should('exist');
};
@@ -37,7 +37,7 @@ describe('TicketList', () => {
cy.dataCy('ticketSummary').should('exist');
});
- it('Client list create new client', () => {
+ it.skip('Client list create new client', () => {
cy.dataCy('vnTableCreateBtn').should('exist');
cy.dataCy('vnTableCreateBtn').click();
const data = {
@@ -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/ticket/ticketRequest.spec.js b/test/cypress/integration/ticket/ticketRequest.spec.js
index b9dc509ef..5a0ae636f 100644
--- a/test/cypress/integration/ticket/ticketRequest.spec.js
+++ b/test/cypress/integration/ticket/ticketRequest.spec.js
@@ -6,7 +6,7 @@ describe('TicketRequest', () => {
cy.visit('/#/ticket/31/request');
});
- it('Creates a new request', () => {
+ it.skip('Creates a new request', () => {
cy.dataCy('vnTableCreateBtn').should('exist');
cy.dataCy('vnTableCreateBtn').click();
const data = {
diff --git a/test/cypress/integration/ticket/ticketSale.spec.js b/test/cypress/integration/ticket/ticketSale.spec.js
index 60f31dbf6..7bc53f010 100644
--- a/test/cypress/integration/ticket/ticketSale.spec.js
+++ b/test/cypress/integration/ticket/ticketSale.spec.js
@@ -66,7 +66,7 @@ describe('TicketSale', () => {
cy.dataCy('ticketSaleMoreActionsDropdown').click();
cy.dataCy('createClaimItem').click();
cy.dataCy('VnConfirm_confirm').click();
- cy.url().should('match', /\/claim\/\d+\/basic-data/);
+ cy.url().should('contain', 'claim/');
// Delete created claim to avoid cluttering the database
cy.dataCy('descriptor-more-opts').click();
cy.dataCy('deleteClaim').click();
@@ -106,22 +106,15 @@ describe('TicketSale', () => {
cy.checkNotification('The following refund ticket have been created');
});
- it('transfers ticket', () => {
+ it('transfer sale to a new ticket', () => {
cy.visit('/#/ticket/32/sale');
+ cy.get('.q-item > .q-item__label').should('have.text', ' #32');
selectFirstRow();
cy.dataCy('ticketSaleTransferBtn').click();
cy.dataCy('ticketTransferPopup').should('exist');
cy.dataCy('ticketTransferNewTicketBtn').click();
- // existen 3 elementos "tbody" necesito checkear que el segundo elemento tbody tenga una row sola
- cy.get('tbody').eq(1).find('tr').should('have.length', 1);
- selectFirstRow();
- cy.dataCy('ticketSaleTransferBtn').click();
- cy.dataCy('ticketTransferPopup').should('exist');
- cy.dataCy('ticketTransferDestinationTicketInput').find('input').focus();
- cy.dataCy('ticketTransferDestinationTicketInput').find('input').type('32');
- cy.dataCy('ticketTransferTransferBtn').click();
- // checkear que la url contenga /ticket/1000002/sale
- cy.url().should('match', /\/ticket\/32\/sale/);
+ //check the new ticket has been created succesfully
+ cy.get('.q-item > .q-item__label').should('not.have.text', ' #32');
});
it('should redirect to ticket logs', () => {
diff --git a/test/cypress/integration/vnComponent/VnBreadcrumbs.spec.js b/test/cypress/integration/vnComponent/VnBreadcrumbs.spec.js
index 3c839c1c7..8e37d8c9c 100644
--- a/test/cypress/integration/vnComponent/VnBreadcrumbs.spec.js
+++ b/test/cypress/integration/vnComponent/VnBreadcrumbs.spec.js
@@ -1,8 +1,8 @@
///
describe('VnBreadcrumbs', () => {
- const firstCard = '.q-infinite-scroll > :nth-child(1)';
const lastBreadcrumb = '.q-breadcrumbs--last > .q-breadcrumbs__el';
beforeEach(() => {
+ cy.viewport(1920, 1080);
cy.login('developer');
cy.visit('/');
});
@@ -12,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/VnLocation.spec.js b/test/cypress/integration/vnComponent/VnLocation.spec.js
index b98d42fdd..14eb0f978 100644
--- a/test/cypress/integration/vnComponent/VnLocation.spec.js
+++ b/test/cypress/integration/vnComponent/VnLocation.spec.js
@@ -38,16 +38,11 @@ describe('VnLocation', () => {
const province = 'Province five';
cy.selectOption(countrySelector, country);
- cy.selectOption(
- `${createForm.prefix} > :nth-child(4) > .q-select > ${createForm.sufix}`,
- province
- );
+ cy.dataCy('locationProvince').type(`${province}{enter}`);
cy.get(
- `${createForm.prefix} > :nth-child(4) > .q-select > ${createForm.sufix} > :nth-child(3) > .q-icon`
+ `${createForm.prefix} > :nth-child(4) > .q-select > ${createForm.sufix} > :nth-child(3) `
).click();
- cy.get(
- `#q-portal--dialog--5 > .q-dialog > ${createForm.prefix} > .vn-row > .q-select > ${createForm.sufix} > :nth-child(1) input`
- ).should('have.value', province);
+ cy.dataCy('locationProvince').should('have.value', province);
});
});
describe('Worker Create', () => {
@@ -123,47 +118,36 @@ describe('VnLocation', () => {
const province = randomString({ length: 4 });
cy.get(createLocationButton).click();
cy.get(dialogInputs).eq(0).type(postCode);
- cy.get(
- `${createForm.prefix} > :nth-child(4) > .q-select > ${createForm.sufix} > :nth-child(2) > .q-icon`
- ).click();
- cy.selectOption('#q-portal--dialog--3 .q-select', 'one');
- cy.get('#q-portal--dialog--3 .q-input').type(province);
- cy.get('#q-portal--dialog--3 .q-btn--standard').click();
- cy.get('#q-portal--dialog--1 .q-btn--standard').click();
+ cy.dataCy('City_icon').click();
+ cy.selectOption('[data-cy="locationProvince"]:last', 'Province one');
+ cy.dataCy('cityName').type(province);
+ cy.dataCy('FormModelPopup_save').eq(1).click();
+ cy.dataCy('FormModelPopup_save').eq(0).click();
+
cy.waitForElement('.q-form');
checkVnLocation(postCode, province);
});
- it('Create province without country', () => {
- const provinceName = 'Saskatchew'.concat(Math.random(1 * 100));
- cy.get(createLocationButton).click();
- cy.get(
- `${createForm.prefix} > :nth-child(5) > .q-select > ${createForm.sufix} > :nth-child(2) `
- )
- .eq(0)
- .click();
- cy.selectOption('#q-portal--dialog--3 .q-select', 'one');
- cy.countSelectOptions('#q-portal--dialog--3 .q-select', 4);
- cy.get('#q-portal--dialog--3 .q-input').type(provinceName);
-
- cy.get('#q-portal--dialog--3 .q-btn--standard').click();
- });
-
it('Create city with country', () => {
const cityName = 'Saskatchew'.concat(Math.random(1 * 100));
cy.get(createLocationButton).click();
- cy.selectOption(
- `${createForm.prefix} > :nth-child(5) > :nth-child(3) `,
- 'Italia'
- );
- cy.get(
- `${createForm.prefix} > :nth-child(4) > .q-select > ${createForm.sufix} > :nth-child(2) > .q-icon`
- ).click();
- cy.selectOption('#q-portal--dialog--4 .q-select', 'Province four');
- cy.countSelectOptions('#q-portal--dialog--4 .q-select', 1);
+ cy.dataCy('locationCountry').type('Italia{enter}');
+ cy.dataCy('City_icon').click();
+ cy.selectOption('[data-cy="locationProvince"]:last', 'Province four');
- cy.get('#q-portal--dialog--4 .q-input').type(cityName);
- cy.get('#q-portal--dialog--4 .q-btn--standard').click();
+ cy.dataCy('cityName').type(cityName);
+ cy.dataCy('FormModelPopup_save').eq(1).click();
+ });
+
+ it('Create province without country', () => {
+ const provinceName = 'Saskatchew'.concat(Math.random(1 * 100));
+ cy.get(createLocationButton).click();
+ cy.dataCy('Province_icon').click();
+ cy.selectOption('[data-cy="autonomyProvince"] ', 'Autonomy one');
+ cy.countSelectOptions('[data-cy="autonomyProvince"]', 4);
+ cy.dataCy('provinceName').type(provinceName);
+
+ cy.dataCy('FormModelPopup_save').eq(1).click();
});
it('Create province with country', () => {
@@ -173,17 +157,13 @@ describe('VnLocation', () => {
`${createForm.prefix} > :nth-child(5) > :nth-child(3) `,
'España'
);
- cy.get(
- `${createForm.prefix} > :nth-child(5) > .q-select > ${createForm.sufix} > :nth-child(2) `
- )
- .eq(0)
- .click();
+ cy.dataCy('Province_icon').click();
- cy.selectOption('#q-portal--dialog--4 .q-select', 'one');
- cy.countSelectOptions('#q-portal--dialog--4 .q-select', 2);
+ cy.selectOption('[data-cy="autonomyProvince"] ', 'Autonomy one');
+ cy.countSelectOptions('[data-cy="autonomyProvince"]', 2);
- cy.get('#q-portal--dialog--4 .q-input').type(provinceName);
- cy.get('#q-portal--dialog--4 .q-btn--standard').click();
+ cy.dataCy('provinceName').type(provinceName);
+ cy.dataCy('FormModelPopup_save').eq(1).click();
});
function checkVnLocation(postCode, province) {
diff --git a/test/cypress/integration/vnComponent/VnLog.spec.js b/test/cypress/integration/vnComponent/VnLog.spec.js
index 4db724e99..10917859a 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.skip('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.skip('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..c710d5192 100644
--- a/test/cypress/integration/vnComponent/VnSearchBar.spec.js
+++ b/test/cypress/integration/vnComponent/VnSearchBar.spec.js
@@ -7,27 +7,29 @@ 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);
});
it('should stay on the list page if there are several results or none', () => {
- cy.writeSearchbar('salesA{enter}');
+ cy.typeSearchbar('salesA{enter}');
+ cy.typeSearchbar('salesA{enter}');
checkTableLength(2);
cy.clearSearchbar();
- cy.writeSearchbar('0{enter}');
+ cy.typeSearchbar('0{enter}');
checkTableLength(0);
});
const searchAndCheck = (searchTerm, expectedText) => {
cy.clearSearchbar();
- cy.writeSearchbar(`${searchTerm}{enter}`);
+ cy.typeSearchbar(`${searchTerm}{enter}`);
+ cy.typeSearchbar(`${searchTerm}{enter}`);
cy.get(idGap).should('have.text', expectedText);
};
diff --git a/test/cypress/integration/wagon/wagonCreate.spec.js b/test/cypress/integration/wagon/wagonCreate.spec.js
index cd248d1bb..501375d8c 100644
--- a/test/cypress/integration/wagon/wagonCreate.spec.js
+++ b/test/cypress/integration/wagon/wagonCreate.spec.js
@@ -2,41 +2,22 @@ describe('WagonCreate', () => {
beforeEach(() => {
cy.viewport(1280, 720);
cy.login('developer');
- cy.visit('/#/wagon/create');
+ cy.visit('/#/wagon');
});
it('should create and delete a new wagon', () => {
- cy.waitForElement('.q-card');
- cy.get('input').eq(0).type('1234');
- cy.get('input').eq(1).type('1234ABCD');
- cy.get('input').eq(2).type('100');
- cy.get('input').eq(3).click();
- cy.get('.q-select > .q-field__inner > .q-field__control').type(
- '{downarrow}{enter}'
- );
-
- // Save
- cy.get('button[type="submit"]').click();
-
- // Check data has been saved successfully
- cy.waitForElement('.q-card');
-
+ cy.dataCy('vnTableCreateBtn').click();
cy.get(
- '[to="/null/1"] > .q-card > .no-padding > .q-py-none > .cursor-text'
- ).should('have.text', '1234');
+ '.grid-create > [label="Label"] > .q-field > .q-field__inner > .q-field__control > .q-field__control-container > [data-cy="Label_input"]'
+ ).type('1234');
cy.get(
- '[to="/null/1"] > .q-card > .no-padding > .q-pr-lg > :nth-child(1) > .vn-label-value > .value > :nth-child(1) > .row > span'
- ).should('have.text', '1234ABCD');
+ '.grid-create > [label="Plate"] > .q-field > .q-field__inner > .q-field__control > .q-field__control-container > [data-cy="Plate_input"]'
+ ).type('1234ABCD');
cy.get(
- '[to="/null/1"] > .q-card > .no-padding > .q-pr-lg > :nth-child(2) > .vn-label-value > .value > :nth-child(1) > .row > span'
- ).should('have.text', '100');
- cy.get(
- '[to="/null/1"] > .q-card > .no-padding > .q-pr-lg > :nth-child(3) > .vn-label-value > .value > :nth-child(1) > .row > span'
- ).should('have.text', 'Wagon Type #1');
-
- // Delete wagon type created
- cy.get(
- '[to="/null/2"] > .q-card > .column > [title="Remove"] > .q-btn__content > .q-icon'
- ).click();
+ '.grid-create > [label="Volume"] > .q-field > .q-field__inner > .q-field__control > .q-field__control-container > [data-cy="Volume_input"]'
+ ).type('100');
+ cy.dataCy('Type_select').type('{downarrow}{enter}');
+ // // Delete wagon type created
+ cy.get('[to="/null/1"] > .q-card > .column > [title="Remove"]').click();
});
});
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/workerCreate.spec.js b/test/cypress/integration/worker/workerCreate.spec.js
index 50afe1892..7f2810395 100644
--- a/test/cypress/integration/worker/workerCreate.spec.js
+++ b/test/cypress/integration/worker/workerCreate.spec.js
@@ -1,6 +1,5 @@
describe('WorkerCreate', () => {
const externalRadio = '.q-radio:nth-child(2)';
- const notification = '.q-notification__message';
const developerBossId = 120;
const payMethodCross =
'.grid-create .full-width > :nth-child(9) .q-select .q-field__append:not(.q-anchor--skip)';
@@ -41,7 +40,7 @@ describe('WorkerCreate', () => {
cy.fillInForm(internal);
cy.get(payMethodCross).click();
cy.get(saveBtn).click();
- cy.get(notification).should('contains.text', 'Payment method is required');
+ cy.checkNotification('Payment method is required');
});
it('should create an internal', () => {
@@ -50,13 +49,13 @@ describe('WorkerCreate', () => {
'Pay method': { val: 'PayMethod one', type: 'select' },
});
cy.get(saveBtn).click();
- cy.get(notification).should('contains.text', 'Data created');
+ cy.checkNotification('Data created');
});
it('should create an external', () => {
cy.get(externalRadio).click();
cy.fillInForm(external);
cy.get(saveBtn).click();
- cy.get(notification).should('contains.text', 'Data created');
+ cy.checkNotification('Data created');
});
});
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..95a075fb3 100644
--- a/test/cypress/integration/zone/zoneBasicData.spec.js
+++ b/test/cypress/integration/zone/zoneBasicData.spec.js
@@ -1,5 +1,5 @@
describe('ZoneBasicData', () => {
- const notification = '.q-notification__message';
+ const priceBasicData = '[data-cy="Price_input"]';
beforeEach(() => {
cy.viewport(1280, 720);
@@ -8,14 +8,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");
+ cy.checkNotification("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.checkNotification('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..0f630db5d 100644
--- a/test/cypress/integration/zone/zoneCreate.spec.js
+++ b/test/cypress/integration/zone/zoneCreate.spec.js
@@ -1,6 +1,4 @@
describe('ZoneCreate', () => {
- const notification = '.q-notification__message';
-
const data = {
Name: { val: 'Zone pickup D' },
Price: { val: '3' },
@@ -22,8 +20,9 @@ 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');
+ cy.checkNotification('Agency cannot be blank');
});
it('should create a zone', () => {
@@ -32,7 +31,8 @@ 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');
+ cy.checkNotification('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 dbaa7871c..93f6d0054 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,20 +87,44 @@ 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) {
+ // 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);
});
Cypress.Commands.add('fillInForm', (obj, form = '.q-form > .q-card') => {
- cy.waitForElement('.q-form > .q-card');
+ cy.waitForElement(form);
cy.get(`${form} input`).each(([el]) => {
cy.wrap(el)
.invoke('attr', 'aria-label')
@@ -110,14 +135,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();
@@ -250,16 +274,13 @@ Cypress.Commands.add('openLeftMenu', (element) => {
Cypress.Commands.add('clearSearchbar', (element) => {
if (element) cy.waitForElement(element);
- cy.get(
- '#searchbar > form > div:nth-child(1) > label > div:nth-child(1) input'
- ).clear();
+ cy.get('[data-cy="vn-searchbar"]').clear();
});
-Cypress.Commands.add('writeSearchbar', (value) => {
- cy.get('#searchbar > form > div:nth-child(1) > label > div:nth-child(1) input').type(
- value
- );
+Cypress.Commands.add('typeSearchbar', (value) => {
+ cy.get('[data-cy="vn-searchbar"]').type(value);
});
+
Cypress.Commands.add('validateContent', (selector, expectedValue) => {
cy.get(selector).should('have.text', expectedValue);
});
@@ -281,16 +302,38 @@ Cypress.Commands.add('clickButtonsDescriptor', (id) => {
.click();
});
+Cypress.Commands.add('openActionDescriptor', (opt) => {
+ cy.openActionsDescriptor();
+ const listItem = '[role="menu"] .q-list .q-item';
+ cy.contains(listItem, opt).click();
+ 1;
+});
+
+Cypress.Commands.add('clickButtonsDescriptor', (id) => {
+ cy.get(`.actions > .q-card__actions> .q-btn:nth-child(${id})`)
+ .invoke('removeAttr', 'target')
+ .click();
+});
+
+Cypress.Commands.add('openActionDescriptor', (opt) => {
+ cy.openActionsDescriptor();
+ const listItem = '[role="menu"] .q-list .q-item';
+ cy.contains(listItem, opt).click();
+ 1;
+});
+
+Cypress.Commands.add('clickButtonsDescriptor', (id) => {
+ cy.get(`.actions > .q-card__actions> .q-btn:nth-child(${id})`)
+ .invoke('removeAttr', 'target')
+ .click();
+});
+
Cypress.Commands.add('openUserPanel', () => {
cy.get(
'.column > .q-avatar > .q-avatar__content > .q-img > .q-img__container > .q-img__image'
).click();
});
-Cypress.Commands.add('openActions', (row) => {
- cy.get('tbody > tr').eq(row).find('.actions > .q-btn').click();
-});
-
Cypress.Commands.add('checkNotification', (text) => {
cy.get('.q-notification')
.should('be.visible')
@@ -301,10 +344,14 @@ Cypress.Commands.add('checkNotification', (text) => {
});
});
+Cypress.Commands.add('openActions', (row) => {
+ cy.get('tbody > tr').eq(row).find('.actions > .q-btn').click();
+});
+
Cypress.Commands.add('checkValueForm', (id, search) => {
- cy.get(
- `.grid-create > :nth-child(${id}) > .q-field__inner > .q-field__control > .q-field__control-container > .q-field__native > .q-field__input`
- ).should('have.value', search);
+ cy.get(`.grid-create > :nth-child(${id}) `)
+ .find('input')
+ .should('have.value', search);
});
Cypress.Commands.add('checkValueSelectForm', (id, search) => {
@@ -317,6 +364,13 @@ Cypress.Commands.add('searchByLabel', (label, value) => {
cy.get(`[label="${label}"] > .q-field > .q-field__inner`).type(`${value}{enter}`);
});
-Cypress.Commands.add('dataCy', (dataTestId, attr = 'data-cy') => {
- return cy.get(`[${attr}="${dataTestId}"]`);
+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: [