diff --git a/package.json b/package.json
index 17f39cad710..d23ed0cedd3 100644
--- a/package.json
+++ b/package.json
@@ -1,74 +1,74 @@
{
- "name": "salix-front",
- "version": "25.06.0",
- "description": "Salix frontend",
- "productName": "Salix",
- "author": "Verdnatura",
- "private": true,
- "packageManager": "pnpm@8.15.1",
- "type": "module",
- "scripts": {
- "resetDatabase": "cd ../salix && gulp docker",
- "lint": "eslint --ext .js,.vue ./",
- "format": "prettier --write \"**/*.{js,vue,scss,html,md,json}\" --ignore-path .gitignore",
- "test:e2e": "cypress open",
- "test:e2e:ci": "npm run resetDatabase && cd ../salix-front && cypress run",
- "test": "echo \"See package.json => scripts for available tests.\" && exit 0",
- "test:unit": "vitest",
- "test:unit:ci": "vitest run",
- "commitlint": "commitlint --edit",
- "prepare": "npx husky install",
- "addReferenceTag": "node .husky/addReferenceTag.js",
- "docs:dev": "vitepress dev docs",
- "docs:build": "vitepress build docs",
- "docs:preview": "vitepress preview docs"
- },
- "dependencies": {
- "@quasar/cli": "^2.4.1",
- "@quasar/extras": "^1.16.16",
- "axios": "^1.4.0",
- "chromium": "^3.0.3",
- "croppie": "^2.6.5",
- "moment": "^2.30.1",
- "pinia": "^2.1.3",
- "quasar": "^2.17.7",
- "validator": "^13.9.0",
- "vue": "^3.5.13",
- "vue-i18n": "^9.3.0",
- "vue-router": "^4.2.5"
- },
- "devDependencies": {
- "@commitlint/cli": "^19.2.1",
- "@commitlint/config-conventional": "^19.1.0",
- "@intlify/unplugin-vue-i18n": "^0.8.2",
- "@pinia/testing": "^0.1.2",
- "@quasar/app-vite": "^2.0.8",
- "@quasar/quasar-app-extension-qcalendar": "^4.0.2",
- "@quasar/quasar-app-extension-testing-unit-vitest": "^0.4.0",
- "@vue/test-utils": "^2.4.4",
- "autoprefixer": "^10.4.14",
- "cypress": "^13.6.6",
- "cypress-mochawesome-reporter": "^3.8.2",
- "eslint": "^9.18.0",
- "eslint-config-prettier": "^10.0.1",
- "eslint-plugin-cypress": "^4.1.0",
- "eslint-plugin-vue": "^9.32.0",
- "husky": "^8.0.0",
- "postcss": "^8.4.23",
- "prettier": "^3.4.2",
- "sass": "^1.83.4",
- "vitepress": "^1.6.3",
- "vitest": "^0.34.0"
- },
- "engines": {
- "node": "^20 || ^18 || ^16",
- "npm": ">= 8.1.2",
- "yarn": ">= 1.21.1",
- "bun": ">= 1.0.25"
- },
- "overrides": {
- "@vitejs/plugin-vue": "^5.2.1",
- "vite": "^6.0.11",
- "vitest": "^0.31.1"
- }
+ "name": "salix-front",
+ "version": "25.08.0",
+ "description": "Salix frontend",
+ "productName": "Salix",
+ "author": "Verdnatura",
+ "private": true,
+ "packageManager": "pnpm@8.15.1",
+ "type": "module",
+ "scripts": {
+ "resetDatabase": "cd ../salix && gulp docker",
+ "lint": "eslint --ext .js,.vue ./",
+ "format": "prettier --write \"**/*.{js,vue,scss,html,md,json}\" --ignore-path .gitignore",
+ "test:e2e": "cypress open",
+ "test:e2e:ci": "npm run resetDatabase && cd ../salix-front && cypress run",
+ "test": "echo \"See package.json => scripts for available tests.\" && exit 0",
+ "test:unit": "vitest",
+ "test:unit:ci": "vitest run",
+ "commitlint": "commitlint --edit",
+ "prepare": "npx husky install",
+ "addReferenceTag": "node .husky/addReferenceTag.js",
+ "docs:dev": "vitepress dev docs",
+ "docs:build": "vitepress build docs",
+ "docs:preview": "vitepress preview docs"
+ },
+ "dependencies": {
+ "@quasar/cli": "^2.4.1",
+ "@quasar/extras": "^1.16.16",
+ "axios": "^1.4.0",
+ "chromium": "^3.0.3",
+ "croppie": "^2.6.5",
+ "moment": "^2.30.1",
+ "pinia": "^2.1.3",
+ "quasar": "^2.17.7",
+ "validator": "^13.9.0",
+ "vue": "^3.5.13",
+ "vue-i18n": "^9.3.0",
+ "vue-router": "^4.2.5"
+ },
+ "devDependencies": {
+ "@commitlint/cli": "^19.2.1",
+ "@commitlint/config-conventional": "^19.1.0",
+ "@intlify/unplugin-vue-i18n": "^0.8.2",
+ "@pinia/testing": "^0.1.2",
+ "@quasar/app-vite": "^2.0.8",
+ "@quasar/quasar-app-extension-qcalendar": "^4.0.2",
+ "@quasar/quasar-app-extension-testing-unit-vitest": "^0.4.0",
+ "@vue/test-utils": "^2.4.4",
+ "autoprefixer": "^10.4.14",
+ "cypress": "^13.6.6",
+ "cypress-mochawesome-reporter": "^3.8.2",
+ "eslint": "^9.18.0",
+ "eslint-config-prettier": "^10.0.1",
+ "eslint-plugin-cypress": "^4.1.0",
+ "eslint-plugin-vue": "^9.32.0",
+ "husky": "^8.0.0",
+ "postcss": "^8.4.23",
+ "prettier": "^3.4.2",
+ "sass": "^1.83.4",
+ "vitepress": "^1.6.3",
+ "vitest": "^0.34.0"
+ },
+ "engines": {
+ "node": "^20 || ^18 || ^16",
+ "npm": ">= 8.1.2",
+ "yarn": ">= 1.21.1",
+ "bun": ">= 1.0.25"
+ },
+ "overrides": {
+ "@vitejs/plugin-vue": "^5.2.1",
+ "vite": "^6.0.11",
+ "vitest": "^0.31.1"
+ }
}
\ No newline at end of file
diff --git a/src/components/TicketProblems.vue b/src/components/TicketProblems.vue
index 2965396b116..a24735a5f33 100644
--- a/src/components/TicketProblems.vue
+++ b/src/components/TicketProblems.vue
@@ -2,26 +2,9 @@
defineProps({ row: { type: Object, required: true } });
-
+
- {{ $t('salesTicketsTable.noVerifiedData') }}
-
-
- {{ $t('salesTicketsTable.purchaseRequest') }}
-
-
- {{ $t('salesTicketsTable.notVisible') }}
-
-
- {{ $t('salesTicketsTable.clientFrozen') }}
-
-
-
+
{{ $t('salesTicketsTable.componentLack') }}
-
+
+
+ {{ $t('ticket.summary.hasItemDelay') }}
+
+
+
+
+ {{ $t('salesTicketsTable.hasItemLost') }}
+
+
+
+ {{ $t('salesTicketsTable.notVisible') }}
+
+
+
+ {{ $t('ticketList.rounding') }}
+
+
+
+ {{ $t('salesTicketsTable.purchaseRequest') }}
+
+
+ {{ $t('salesTicketsTable.noVerifiedData') }}
+
+
+ {{ $t('salesTicketsTable.clientFrozen') }}
+
+
{{ $t('salesTicketsTable.tooLittle') }}
diff --git a/src/components/__tests__/UserPanel.spec.js b/src/components/__tests__/UserPanel.spec.js
new file mode 100644
index 00000000000..ac20f911e7f
--- /dev/null
+++ b/src/components/__tests__/UserPanel.spec.js
@@ -0,0 +1,61 @@
+import { vi, describe, expect, it, beforeEach, beforeAll, afterEach } from 'vitest';
+import { createWrapper } from 'app/test/vitest/helper';
+import UserPanel from 'src/components/UserPanel.vue';
+import axios from 'axios';
+import { useState } from 'src/composables/useState';
+
+describe('UserPanel', () => {
+ let wrapper;
+ let vm;
+ let state;
+
+ beforeEach(() => {
+ wrapper = createWrapper(UserPanel, {});
+ state = useState();
+ state.setUser({
+ id: 115,
+ name: 'itmanagement',
+ nickname: 'itManagementNick',
+ lang: 'en',
+ darkMode: false,
+ companyFk: 442,
+ warehouseFk: 1,
+ });
+ wrapper = wrapper.wrapper;
+ vm = wrapper.vm;
+ });
+
+ afterEach(() => {
+ vi.clearAllMocks();
+ });
+
+ it('should fetch warehouses data on mounted', async () => {
+ const fetchData = wrapper.findComponent({ name: 'FetchData' });
+ expect(fetchData.props('url')).toBe('Warehouses');
+ expect(fetchData.props('autoLoad')).toBe(true);
+ });
+
+ it('should toggle dark mode correctly and update preferences', async () => {
+ await vm.saveDarkMode(true);
+ expect(axios.patch).toHaveBeenCalledWith('/UserConfigs/115', { darkMode: true });
+ expect(vm.user.darkMode).toBe(true);
+ vm.updatePreferences();
+ expect(vm.darkMode).toBe(true);
+ });
+
+ it('should change user language and update preferences', async () => {
+ const userLanguage = 'es';
+ await vm.saveLanguage(userLanguage);
+ expect(axios.patch).toHaveBeenCalledWith('/VnUsers/115', { lang: userLanguage });
+ expect(vm.user.lang).toBe(userLanguage);
+ vm.updatePreferences();
+ expect(vm.locale).toBe(userLanguage);
+ });
+
+ it('should update user data', async () => {
+ const key = 'name';
+ const value = 'itboss';
+ await vm.saveUserData(key, value);
+ expect(axios.post).toHaveBeenCalledWith('UserConfigs/setUserConfig', { [key]: value });
+ });
+});
diff --git a/src/pages/Customer/Card/CustomerDescriptor.vue b/src/pages/Customer/Card/CustomerDescriptor.vue
index ce402541d2f..d7a8a59a140 100644
--- a/src/pages/Customer/Card/CustomerDescriptor.vue
+++ b/src/pages/Customer/Card/CustomerDescriptor.vue
@@ -192,6 +192,7 @@ const debtWarning = computed(() => {
query: {
createForm: JSON.stringify({
clientFk: entity.id,
+ addressId: entity.defaultAddressFk,
}),
},
}"
diff --git a/src/pages/Entry/EntryBuysTableDialog.vue b/src/pages/Entry/EntryBuysTableDialog.vue
index a2d8c9117f5..86a9b018f45 100644
--- a/src/pages/Entry/EntryBuysTableDialog.vue
+++ b/src/pages/Entry/EntryBuysTableDialog.vue
@@ -134,6 +134,7 @@ function downloadCSV(rows) {
@click="
openReport(`Entries/${entityId}/labelSupplier`)
"
+ data-cy="printLabelsBtn"
/>
diff --git a/src/pages/InvoiceIn/InvoiceInList.vue b/src/pages/InvoiceIn/InvoiceInList.vue
index 202938b03f1..bcf4e0e93b2 100644
--- a/src/pages/InvoiceIn/InvoiceInList.vue
+++ b/src/pages/InvoiceIn/InvoiceInList.vue
@@ -178,7 +178,7 @@ const cols = computed(() => [
:required="true"
/>
[
:required="true"
/>
diff --git a/src/pages/Item/Card/ItemDiary.vue b/src/pages/Item/Card/ItemDiary.vue
index c2f2c19a020..4b6775183cc 100644
--- a/src/pages/Item/Card/ItemDiary.vue
+++ b/src/pages/Item/Card/ItemDiary.vue
@@ -125,7 +125,7 @@ onMounted(async () => {
inventoriedDate.value =
(await axios.get('Configs/findOne')).data?.inventoried || today;
- if (query.warehouseFk) ref.warehouseFk = query.warehouseFk;
+ if (query.warehouseFk) ref.warehouseFk = +query.warehouseFk;
else if (!ref.warehouseFk && user.value) ref.warehouseFk = user.value.warehouseFk;
if (ref.date) showWhatsBeforeInventory.value = true;
ref.itemFk = route.params.id;
@@ -143,7 +143,7 @@ onMounted(async () => {
const fetchItemBalances = async () => await arrayDataItemBalances.fetch({});
const getBadgeAttrs = (_date) => {
- const isSameDate = date.isSameDate(today.value, _date);
+ const isSameDate = date.isSameDate(today, _date);
const attrs = {
'text-color': isSameDate ? 'black' : 'white',
color: isSameDate ? 'warning' : 'transparent',
@@ -153,8 +153,6 @@ const getBadgeAttrs = (_date) => {
const scrollToToday = async () => {
await nextTick();
- const today = Date.vnNew();
- today.setHours(0, 0, 0, 0);
const todayCell = document.querySelector(`td[data-date="${today.toISOString()}"]`);
if (todayCell) {
todayCell.scrollIntoView({ behavior: 'smooth', block: 'center' });
diff --git a/src/pages/Monitor/locale/en.yml b/src/pages/Monitor/locale/en.yml
index 21324087c42..496c8761a16 100644
--- a/src/pages/Monitor/locale/en.yml
+++ b/src/pages/Monitor/locale/en.yml
@@ -38,6 +38,7 @@ salesTicketsTable:
payMethod: Pay method
department: Department
packing: ITP
+ hasItemLost: Item lost
searchBar:
label: Search tickets
info: Search tickets by id or alias
diff --git a/src/pages/Monitor/locale/es.yml b/src/pages/Monitor/locale/es.yml
index 30afb1904ba..f6a29879f08 100644
--- a/src/pages/Monitor/locale/es.yml
+++ b/src/pages/Monitor/locale/es.yml
@@ -39,6 +39,7 @@ salesTicketsTable:
payMethod: Método de pago
department: Departamento
packing: ITP
+ hasItemLost: Artículo perdido
searchBar:
label: Buscar tickets
info: Buscar tickets por identificador o alias
diff --git a/src/pages/Order/OrderList.vue b/src/pages/Order/OrderList.vue
index 1e7e39cf18f..40990f32906 100644
--- a/src/pages/Order/OrderList.vue
+++ b/src/pages/Order/OrderList.vue
@@ -82,7 +82,7 @@ const columns = computed(() => [
label: t('module.created'),
component: 'date',
cardVisible: true,
- format: (row) => toDateTimeFormat(row?.landed),
+ format: (row) => toDateTimeFormat(row?.created),
columnField: {
component: null,
},
diff --git a/src/pages/Ticket/Card/TicketDescriptor.vue b/src/pages/Ticket/Card/TicketDescriptor.vue
index c9849d631fb..25887fd39f5 100644
--- a/src/pages/Ticket/Card/TicketDescriptor.vue
+++ b/src/pages/Ticket/Card/TicketDescriptor.vue
@@ -9,6 +9,8 @@ import VnLv from 'src/components/ui/VnLv.vue';
import useCardDescription from 'src/composables/useCardDescription';
import VnUserLink from 'src/components/ui/VnUserLink.vue';
import { toDateTimeFormat } from 'src/filters/date';
+import FetchData from 'src/components/FetchData.vue';
+import TicketProblems from 'src/components/TicketProblems.vue';
const $props = defineProps({
id: {
@@ -28,6 +30,7 @@ const { t } = useI18n();
const entityId = computed(() => {
return $props.id || route.params.id;
});
+const problems = ref({});
const filter = {
include: [
@@ -113,6 +116,11 @@ const setData = (entity) => {
+ ([problems] = data)"
+ />
{
-
-
-
- {{ t('Client inactive') }}
-
-
- {{ t('Client Frozen') }}
-
-
- {{ t('Client has debt') }}
-
-
- {{ t('Client not checked') }}
-
-
- {{ t('This ticket is deleted') }}
-
+
+
+
diff --git a/src/pages/Ticket/Card/TicketSale.vue b/src/pages/Ticket/Card/TicketSale.vue
index 3ebb69319cd..adbd4ee00c4 100644
--- a/src/pages/Ticket/Card/TicketSale.vue
+++ b/src/pages/Ticket/Card/TicketSale.vue
@@ -24,6 +24,7 @@ import axios from 'axios';
import VnTable from 'src/components/VnTable/VnTable.vue';
import VnUsesMana from 'src/components/ui/VnUsesMana.vue';
import VnConfirm from 'src/components/ui/VnConfirm.vue';
+import TicketProblems from 'src/components/TicketProblems.vue';
import RightMenu from 'src/components/common/RightMenu.vue';
const route = useRoute();
@@ -56,7 +57,7 @@ const canProceed = ref();
watch(
() => route.params.id,
- () => tableRef.value.reload()
+ () => tableRef.value.reload(),
);
const columns = computed(() => [
@@ -199,7 +200,7 @@ const changeQuantity = async (sale) => {
await updateQuantity(sale);
} catch (e) {
const { quantity } = tableRef.value.CrudModelRef.originalData.find(
- (s) => s.id === sale.id
+ (s) => s.id === sale.id,
);
sale.quantity = quantity;
throw e;
@@ -503,7 +504,7 @@ async function isSalePrepared(item) {
componentProps: {
title: t('Item prepared'),
message: t(
- 'This item is already prepared. Do you want to continue?'
+ 'This item is already prepared. Do you want to continue?',
),
data: item,
},
@@ -525,7 +526,7 @@ watch(
if (newItemFk) {
updateItem(newRow.value);
}
- }
+ },
);
@@ -595,7 +596,7 @@ watch(
openConfirmationModal(
t('Continue anyway?'),
t('You are going to delete lines of the ticket'),
- removeSales
+ removeSales,
)
"
>
@@ -679,53 +680,7 @@ watch(
:disabled-attr="isTicketEditable"
>
-
-
-
- {{ t('ticketSale.claim') }}:
- {{ row.claim?.claimFk }}
-
-
-
-
-
- {{ t('ticketSale.visible') }}: {{ row.visible || 0 }}
-
-
-
-
- {{ t('ticketSale.reserved') }}
-
-
-
-
- {{ t('ticketSale.noVisible') }}
-
-
-
-
- {{ t('ticketSale.hasComponentLack') }}
-
-
+
diff --git a/src/pages/Ticket/Card/TicketSummary.vue b/src/pages/Ticket/Card/TicketSummary.vue
index bb338191b0a..151bea97ad6 100644
--- a/src/pages/Ticket/Card/TicketSummary.vue
+++ b/src/pages/Ticket/Card/TicketSummary.vue
@@ -20,6 +20,7 @@ import ZoneDescriptorProxy from 'src/pages/Zone/Card/ZoneDescriptorProxy.vue';
import VnSelect from 'src/components/common/VnSelect.vue';
import VnToSummary from 'src/components/ui/VnToSummary.vue';
import TicketDescriptorMenu from './TicketDescriptorMenu.vue';
+import TicketProblems from 'src/components/TicketProblems.vue';
const route = useRoute();
const { notify } = useNotify();
@@ -311,83 +312,7 @@ onMounted(async () => {
-
-
- {{ t('ticket.summary.claim') }}:
- {{ props.row.claim.claimFk }}
-
-
-
-
- {{ t('ticket.summary.claim') }}:
- {{ props.row.claimBeginning.claimFk }}
-
-
-
-
- {{ t('globals.visible') }}:
- {{ props.row.visible }}
-
-
-
-
- {{ t('ticket.summary.reserved') }}
-
-
-
-
- {{ t('ticket.summary.itemShortage') }}
-
-
-
-
- {{ t('ticket.summary.hasComponentLack') }}
-
-
+
diff --git a/src/pages/Ticket/locale/en.yml b/src/pages/Ticket/locale/en.yml
index f11b32c3a5e..d4bfd110362 100644
--- a/src/pages/Ticket/locale/en.yml
+++ b/src/pages/Ticket/locale/en.yml
@@ -208,3 +208,9 @@ ticketList:
toLines: Go to lines
addressNickname: Address nickname
ref: Reference
+ rounding: Rounding
+ noVerifiedData: No verified data
+ purchaseRequest: Purchase request
+ notVisible: Not visible
+ clientFrozen: Client frozen
+ componentLack: Component lack
diff --git a/src/pages/Ticket/locale/es.yml b/src/pages/Ticket/locale/es.yml
index 945da8367f8..ff68461fadb 100644
--- a/src/pages/Ticket/locale/es.yml
+++ b/src/pages/Ticket/locale/es.yml
@@ -213,3 +213,9 @@ ticketList:
toLines: Ir a lineas
addressNickname: Alias consignatario
ref: Referencia
+ rounding: Redondeo
+ noVerifiedData: Sin datos comprobados
+ purchaseRequest: Petición de compra
+ notVisible: No visible
+ clientFrozen: Cliente congelado
+ componentLack: Faltan componentes
diff --git a/src/router/modules/shelving.js b/src/router/modules/shelving.js
index cd8a2bf1570..55fb04278c6 100644
--- a/src/router/modules/shelving.js
+++ b/src/router/modules/shelving.js
@@ -44,6 +44,7 @@ const shelvingCard = {
path: ':id',
component: () => import('pages/Shelving/Card/ShelvingCard.vue'),
redirect: { name: 'ShelvingSummary' },
+ meta: { menu: ['ShelvingBasicData', 'ShelvingLog'] },
children: [
{
name: 'ShelvingSummary',
@@ -81,13 +82,10 @@ export default {
title: 'shelving',
icon: 'vn:inventory',
moduleName: 'Shelving',
+ menu: ['ShelvingList', 'ParkingMain'],
},
component: RouterView,
redirect: { name: 'ShelvingMain' },
- menus: {
- main: ['ShelvingList', 'ParkingMain'],
- card: ['ShelvingBasicData', 'ShelvingLog'],
- },
children: [
{
path: '',
diff --git a/test/cypress/integration/client/clientList.spec.js b/test/cypress/integration/client/clientList.spec.js
index dcded63b0fe..f2e3671baae 100644
--- a/test/cypress/integration/client/clientList.spec.js
+++ b/test/cypress/integration/client/clientList.spec.js
@@ -62,10 +62,9 @@ describe('Client list', () => {
it('Client founded create order', () => {
const search = 'Jessica Jones';
cy.searchByLabel('Name', search);
- cy.openActionDescriptor('New order');
+ cy.clickButtonWith('icon', 'icon-basketadd');
cy.waitForElement('#formModel');
cy.waitForElement('.q-form');
cy.checkValueForm(1, search);
- cy.checkValueForm(2, search);
});
});
diff --git a/test/cypress/integration/client/clientSms.spec.js b/test/cypress/integration/client/clientSms.spec.js
index 731522a5c60..5c82fd9a333 100644
--- a/test/cypress/integration/client/clientSms.spec.js
+++ b/test/cypress/integration/client/clientSms.spec.js
@@ -7,6 +7,5 @@ describe('Client notes', () => {
});
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/entry/myEntry.spec.js b/test/cypress/integration/entry/myEntry.spec.js
index c254764192d..49d75cf3924 100644
--- a/test/cypress/integration/entry/myEntry.spec.js
+++ b/test/cypress/integration/entry/myEntry.spec.js
@@ -8,12 +8,12 @@ describe('EntryMy when is supplier', () => {
},
});
});
- // https://redmine.verdnatura.es/issues/8418
- it.skip('should open buyLabel when is supplier', () => {
+
+ it('should open buyLabel when is supplier', () => {
cy.get(
- '[to="/null/3"] > .q-card > .column > .q-btn > .q-btn__content > .q-icon'
+ '[to="/null/3"] > .q-card > :nth-child(2) > .q-btn > .q-btn__content > .q-icon'
).click();
- cy.get('.q-card__actions > .q-btn').click();
+ cy.dataCy('printLabelsBtn').click();
cy.window().its('open').should('be.called');
});
});
diff --git a/test/cypress/integration/item/itemTag.spec.js b/test/cypress/integration/item/itemTag.spec.js
index 174910f5769..fed457a1c5b 100644
--- a/test/cypress/integration/item/itemTag.spec.js
+++ b/test/cypress/integration/item/itemTag.spec.js
@@ -12,27 +12,24 @@ describe('Item tag', () => {
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.get(':nth-child(8) > [label="Value"]').type('1');
+ +cy.dataCy('crudModelDefaultSaveBtn').click();
cy.checkNotification("The tag or priority can't be repeated for an item");
});
- // https://redmine.verdnatura.es/issues/8422
- it.skip('should add a new tag', () => {
+
+ 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.get('.q-menu .q-item').contains('Ancho de la base').type('{enter}');
+ cy.get(':nth-child(8) > [label="Value"]').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('itemTags')
+ .children(':nth-child(8)')
+ .find('.justify-center > .q-icon')
+ .click();
cy.dataCy('VnConfirm_confirm').click();
cy.checkNotification('Data saved');
});
diff --git a/test/cypress/integration/parking/parkingBasicData.spec.js b/test/cypress/integration/parking/parkingBasicData.spec.js
index b5633992c7a..0d130d335ab 100644
--- a/test/cypress/integration/parking/parkingBasicData.spec.js
+++ b/test/cypress/integration/parking/parkingBasicData.spec.js
@@ -5,7 +5,7 @@ describe('ParkingBasicData', () => {
const sectorOpt = '.q-menu .q-item';
beforeEach(() => {
cy.login('developer');
- cy.visit(`/#/parking/1/basic-data`);
+ cy.visit(`/#/shelving/parking/1/basic-data`);
});
it('should edit the code and sector', () => {
diff --git a/test/cypress/integration/parking/parkingList.spec.js b/test/cypress/integration/parking/parkingList.spec.js
index f1efaa3752e..8b7152ca43a 100644
--- a/test/cypress/integration/parking/parkingList.spec.js
+++ b/test/cypress/integration/parking/parkingList.spec.js
@@ -11,7 +11,7 @@ describe('ParkingList', () => {
beforeEach(() => {
cy.viewport(1920, 1080);
cy.login('developer');
- cy.visit(`/#/parking/list`);
+ cy.visit(`/#/shelving/parking/list`);
});
it('should redirect on clicking a parking', () => {
diff --git a/test/cypress/integration/ticket/ticketList.spec.js b/test/cypress/integration/ticket/ticketList.spec.js
index 2984a4ee493..593021e6e1b 100644
--- a/test/cypress/integration/ticket/ticketList.spec.js
+++ b/test/cypress/integration/ticket/ticketList.spec.js
@@ -53,4 +53,29 @@ describe('TicketList', () => {
cy.checkNotification('Data created');
cy.url().should('match', /\/ticket\/\d+\/summary/);
});
+
+ it('should show the corerct problems', () => {
+ cy.intercept('GET', '**/api/Tickets/filter*', (req) => {
+ req.headers['cache-control'] = 'no-cache';
+ req.headers['pragma'] = 'no-cache';
+ req.headers['expires'] = '0';
+
+ req.on('response', (res) => {
+ delete res.headers['if-none-match'];
+ delete res.headers['if-modified-since'];
+ });
+ }).as('ticket');
+
+ cy.get('[data-cy="Warehouse_select"]').type('Warehouse Five');
+ cy.get('.q-menu .q-item').contains('Warehouse Five').click();
+ cy.wait('@ticket').then((interception) => {
+ const data = interception.response.body[1];
+ expect(data.hasComponentLack).to.equal(1);
+ expect(data.isTooLittle).to.equal(1);
+ expect(data.hasItemShortage).to.equal(1);
+ });
+ cy.get('.icon-components').should('exist');
+ cy.get('.icon-unavailable').should('exist');
+ cy.get('.icon-isTooLittle').should('exist');
+ });
});
diff --git a/test/cypress/integration/wagon/wagonCreate.spec.js b/test/cypress/integration/wagon/wagonCreate.spec.js
index 501375d8cd9..ce3723e5400 100644
--- a/test/cypress/integration/wagon/wagonCreate.spec.js
+++ b/test/cypress/integration/wagon/wagonCreate.spec.js
@@ -8,16 +8,16 @@ describe('WagonCreate', () => {
it('should create and delete a new wagon', () => {
cy.dataCy('vnTableCreateBtn').click();
cy.get(
- '.grid-create > [label="Label"] > .q-field > .q-field__inner > .q-field__control > .q-field__control-container > [data-cy="Label_input"]'
+ '.grid-create > [label="Label"] > .q-field > .q-field__inner > .q-field__control > .q-field__control-container > [data-cy="Label_input"]',
).type('1234');
cy.get(
- '.grid-create > [label="Plate"] > .q-field > .q-field__inner > .q-field__control > .q-field__control-container > [data-cy="Plate_input"]'
+ '.grid-create > [label="Plate"] > .q-field > .q-field__inner > .q-field__control > .q-field__control-container > [data-cy="Plate_input"]',
).type('1234ABCD');
cy.get(
- '.grid-create > [label="Volume"] > .q-field > .q-field__inner > .q-field__control > .q-field__control-container > [data-cy="Volume_input"]'
+ '.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();
+
+ cy.get('[title="Remove"] > .q-btn__content > .q-icon').click();
});
});
diff --git a/test/cypress/integration/wagon/wagonType/wagonTypeCreate.spec.js b/test/cypress/integration/wagon/wagonType/wagonTypeCreate.spec.js
index 0ad98e5973a..343c1c1271e 100644
--- a/test/cypress/integration/wagon/wagonType/wagonTypeCreate.spec.js
+++ b/test/cypress/integration/wagon/wagonType/wagonTypeCreate.spec.js
@@ -6,14 +6,10 @@ describe('WagonTypeCreate', () => {
cy.waitForElement('.q-page', 6000);
});
- it('should create a new wagon type', () => {
+ it('should create a new wagon type and then delete it', () => {
cy.get('.q-page-sticky > div > .q-btn').click();
cy.get('input').first().type('Example for testing');
cy.get('button[type="submit"]').click();
- });
- it('delete a wagon type', () => {
- cy.get(
- '[to="/null/2"] > .q-card > .column > [title="Remove"] > .q-btn__content > .q-icon'
- ).click();
+ cy.get('[title="Remove"] > .q-btn__content > .q-icon').first().click();
});
});
diff --git a/test/cypress/support/commands.js b/test/cypress/support/commands.js
index 6a436c1eba5..2c93fbf844b 100755
--- a/test/cypress/support/commands.js
+++ b/test/cypress/support/commands.js
@@ -289,40 +289,13 @@ Cypress.Commands.add('openActionDescriptor', (opt) => {
cy.openActionsDescriptor();
const listItem = '[role="menu"] .q-list .q-item';
cy.contains(listItem, opt).click();
- 1;
});
Cypress.Commands.add('openActionsDescriptor', () => {
cy.get('[data-cy="descriptor-more-opts"]').click();
});
-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('openActionDescriptor', (opt) => {
- cy.openActionsDescriptor();
- const listItem = '[role="menu"] .q-list .q-item';
- cy.contains(listItem, opt).click();
- 1;
-});
-
-Cypress.Commands.add('clickButtonsDescriptor', (id) => {
+Cypress.Commands.add('clickButtonDescriptor', (id) => {
cy.get(`.actions > .q-card__actions> .q-btn:nth-child(${id})`)
.invoke('removeAttr', 'target')
.click();
@@ -374,3 +347,21 @@ Cypress.Commands.add('addBtnClick', () => {
.and('be.visible')
.click();
});
+
+Cypress.Commands.add('clickButtonWith', (type, value) => {
+ switch (type) {
+ case 'icon':
+ cy.clickButtonWithIcon(value);
+ break;
+
+ default:
+ cy.clickButtonWithText(value);
+ break;
+ }
+});
+Cypress.Commands.add('clickButtonWithIcon', (iconClass) => {
+ cy.get(`.q-icon.${iconClass}`).parent().click();
+});
+Cypress.Commands.add('clickButtonWithText', (buttonText) => {
+ cy.get('.q-btn').contains(buttonText).click();
+});