diff --git a/src/components/TicketProblems.vue b/src/components/TicketProblems.vue
index 2965396b1..a24735a5f 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/common/VnDmsList.vue b/src/components/common/VnDmsList.vue
index 36c87bab0..59a4f9f90 100644
--- a/src/components/common/VnDmsList.vue
+++ b/src/components/common/VnDmsList.vue
@@ -17,7 +17,7 @@ import { useSession } from 'src/composables/useSession';
const route = useRoute();
const quasar = useQuasar();
const { t } = useI18n();
-const rows = ref();
+const rows = ref([]);
const dmsRef = ref();
const formDialog = ref({});
const token = useSession().getTokenMultimedia();
@@ -389,6 +389,14 @@ defineExpose({
+
+
+ {{ t('No data to display') }}
+
+
diff --git a/src/components/common/__tests__/VnNotes.spec.js b/src/components/common/__tests__/VnNotes.spec.js
index 8f24a7f14..2603bf03c 100644
--- a/src/components/common/__tests__/VnNotes.spec.js
+++ b/src/components/common/__tests__/VnNotes.spec.js
@@ -1,51 +1,78 @@
-import { describe, it, expect, vi, beforeAll, afterEach, beforeEach } from 'vitest';
+import {
+ describe,
+ it,
+ expect,
+ vi,
+ beforeAll,
+ afterEach,
+ beforeEach,
+ afterAll,
+} from 'vitest';
import { createWrapper, axios } from 'app/test/vitest/helper';
import VnNotes from 'src/components/ui/VnNotes.vue';
+import vnDate from 'src/boot/vnDate';
describe('VnNotes', () => {
let vm;
let wrapper;
let spyFetch;
let postMock;
- let expectedBody;
- const mockData= {name: 'Tony', lastName: 'Stark', text: 'Test Note', observationTypeFk: 1};
-
- function generateExpectedBody() {
- expectedBody = {...vm.$props.body, ...{ text: vm.newNote.text, observationTypeFk: vm.newNote.observationTypeFk }};
- }
-
- async function setTestParams(text, observationType, type){
- vm.newNote.text = text;
- vm.newNote.observationTypeFk = observationType;
- wrapper.setProps({ selectType: type });
- }
-
- beforeAll(async () => {
- vi.spyOn(axios, 'get').mockReturnValue({ data: [] });
-
+ let patchMock;
+ let expectedInsertBody;
+ let expectedUpdateBody;
+ const defaultOptions = {
+ url: '/test',
+ body: { name: 'Tony', lastName: 'Stark' },
+ selectType: false,
+ saveUrl: null,
+ justInput: false,
+ };
+ function generateWrapper(
+ options = defaultOptions,
+ text = null,
+ observationType = null,
+ ) {
+ vi.spyOn(axios, 'get').mockResolvedValue({ data: [] });
wrapper = createWrapper(VnNotes, {
- propsData: {
- url: '/test',
- body: { name: 'Tony', lastName: 'Stark' },
- }
+ propsData: options,
});
wrapper = wrapper.wrapper;
vm = wrapper.vm;
- });
+ vm.newNote.text = text;
+ vm.newNote.observationTypeFk = observationType;
+ }
+
+ function createSpyFetch() {
+ spyFetch = vi.spyOn(vm.$refs.vnPaginateRef, 'fetch');
+ }
+
+ function generateExpectedBody() {
+ expectedInsertBody = {
+ ...vm.$props.body,
+ ...{ text: vm.newNote.text, observationTypeFk: vm.newNote.observationTypeFk },
+ };
+ expectedUpdateBody = { ...vm.$props.body, ...{ notes: vm.newNote.text } };
+ }
beforeEach(() => {
- postMock = vi.spyOn(axios, 'post').mockResolvedValue(mockData);
- spyFetch = vi.spyOn(vm.vnPaginateRef, 'fetch').mockImplementation(() => vi.fn());
+ postMock = vi.spyOn(axios, 'post');
+ patchMock = vi.spyOn(axios, 'patch');
});
afterEach(() => {
vi.clearAllMocks();
- expectedBody = {};
+ expectedInsertBody = {};
+ expectedUpdateBody = {};
+ });
+
+ afterAll(() => {
+ vi.restoreAllMocks();
});
describe('insert', () => {
- it('should not call axios.post and vnPaginateRef.fetch if newNote.text is null', async () => {
- await setTestParams( null, null, true );
+ it('should not call axios.post and vnPaginateRef.fetch when newNote.text is null', async () => {
+ generateWrapper({ selectType: true });
+ createSpyFetch();
await vm.insert();
@@ -53,8 +80,9 @@ describe('VnNotes', () => {
expect(spyFetch).not.toHaveBeenCalled();
});
- it('should not call axios.post and vnPaginateRef.fetch if newNote.text is empty', async () => {
- await setTestParams( "", null, false );
+ it('should not call axios.post and vnPaginateRef.fetch when newNote.text is empty', async () => {
+ generateWrapper(null, '');
+ createSpyFetch();
await vm.insert();
@@ -62,8 +90,9 @@ describe('VnNotes', () => {
expect(spyFetch).not.toHaveBeenCalled();
});
- it('should not call axios.post and vnPaginateRef.fetch if observationTypeFk is missing and selectType is true', async () => {
- await setTestParams( "Test Note", null, true );
+ it('should not call axios.post and vnPaginateRef.fetch when observationTypeFk is null and selectType is true', async () => {
+ generateWrapper({ selectType: true }, 'Test Note');
+ createSpyFetch();
await vm.insert();
@@ -71,37 +100,57 @@ describe('VnNotes', () => {
expect(spyFetch).not.toHaveBeenCalled();
});
- it('should call axios.post and vnPaginateRef.fetch if observationTypeFk is missing and selectType is false', async () => {
- await setTestParams( "Test Note", null, false );
-
+ it('should call axios.post and vnPaginateRef.fetch when observationTypeFk is missing and selectType is false', async () => {
+ generateWrapper(null, 'Test Note');
+ createSpyFetch();
generateExpectedBody();
await vm.insert();
- expect(postMock).toHaveBeenCalledWith(vm.$props.url, expectedBody);
- expect(spyFetch).toHaveBeenCalled();
- });
-
- it('should call axios.post and vnPaginateRef.fetch if observationTypeFk is setted and selectType is false', async () => {
- await setTestParams( "Test Note", 1, false );
-
- generateExpectedBody();
-
- await vm.insert();
-
- expect(postMock).toHaveBeenCalledWith(vm.$props.url, expectedBody);
+ expect(postMock).toHaveBeenCalledWith(vm.$props.url, expectedInsertBody);
expect(spyFetch).toHaveBeenCalled();
});
it('should call axios.post and vnPaginateRef.fetch when newNote is valid', async () => {
- await setTestParams( "Test Note", 1, true );
-
+ generateWrapper({ selectType: true }, 'Test Note', 1);
+ createSpyFetch();
generateExpectedBody();
-
+
await vm.insert();
- expect(postMock).toHaveBeenCalledWith(vm.$props.url, expectedBody);
+ expect(postMock).toHaveBeenCalledWith(vm.$props.url, expectedInsertBody);
expect(spyFetch).toHaveBeenCalled();
});
});
-});
\ No newline at end of file
+
+ describe('update', () => {
+ it('should call axios.patch with saveUrl when saveUrl is set and justInput is true', async () => {
+ generateWrapper({
+ url: '/business',
+ justInput: true,
+ saveUrl: '/saveUrlTest',
+ });
+ generateExpectedBody();
+
+ await vm.update();
+
+ expect(patchMock).toHaveBeenCalledWith(vm.$props.saveUrl, expectedUpdateBody);
+ });
+
+ it('should call axios.patch with url when saveUrl is not set and justInput is true', async () => {
+ generateWrapper({
+ url: '/business',
+ body: { workerFk: 1110 },
+ justInput: true,
+ });
+ generateExpectedBody();
+
+ await vm.update();
+
+ expect(patchMock).toHaveBeenCalledWith(
+ `${vm.$props.url}/${vm.$props.body.workerFk}`,
+ expectedUpdateBody,
+ );
+ });
+ });
+});
diff --git a/src/components/ui/CardSummary.vue b/src/components/ui/CardSummary.vue
index f9de8e0c1..c815b8e16 100644
--- a/src/components/ui/CardSummary.vue
+++ b/src/components/ui/CardSummary.vue
@@ -15,6 +15,10 @@ const props = defineProps({
type: Object,
default: null,
},
+ userFilter: {
+ type: Object,
+ default: null,
+ },
entityId: {
type: [Number, String],
default: null,
@@ -34,6 +38,7 @@ const isSummary = ref();
const arrayData = useArrayData(props.dataKey, {
url: props.url,
filter: props.filter,
+ userFilter: props.userFilter,
skip: 0,
});
const { store } = arrayData;
diff --git a/src/components/ui/VnNotes.vue b/src/components/ui/VnNotes.vue
index 1690a94ba..5b1d6e726 100644
--- a/src/components/ui/VnNotes.vue
+++ b/src/components/ui/VnNotes.vue
@@ -1,6 +1,6 @@
{
auto-load
@on-fetch="(data) => (observationTypes = data)"
/>
-
-
+
+
+
{{ t('New note') }}
@@ -75,19 +138,19 @@ onBeforeRouteLeave((to, from, next) => {
v-model="newNote.observationTypeFk"
option-label="description"
style="flex: 0.15"
- :required="true"
+ :required="isRequired"
@keyup.enter.stop="insert"
/>
{
icon="save"
color="primary"
flat
- @click="insert"
+ @click="handleClick"
class="q-mb-xs"
dense
data-cy="saveNote"
@@ -106,6 +169,7 @@ onBeforeRouteLeave((to, from, next) => {
{
}
}
}
+.just-input {
+ padding-right: 18px;
+ margin-bottom: 2px;
+ box-shadow: none;
+}
es:
@@ -205,4 +274,6 @@ onBeforeRouteLeave((to, from, next) => {
New note: Nueva nota
Save (Enter): Guardar (Intro)
Observation type: Tipo de observación
+ New note is empty: La nueva nota esta vacia
+ Are you sure remove this note?: Estas seguro de quitar esta nota?
diff --git a/src/components/ui/VnSubToolbar.vue b/src/components/ui/VnSubToolbar.vue
index 5ded4be00..8d4126d1d 100644
--- a/src/components/ui/VnSubToolbar.vue
+++ b/src/components/ui/VnSubToolbar.vue
@@ -19,23 +19,26 @@ onMounted(() => {
const observer = new MutationObserver(
() =>
(hasContent.value =
- actions.value?.childNodes?.length + data.value?.childNodes?.length)
+ actions.value?.childNodes?.length + data.value?.childNodes?.length),
);
if (actions.value) observer.observe(actions.value, opts);
if (data.value) observer.observe(data.value, opts);
});
-onBeforeUnmount(() => stateStore.toggleSubToolbar());
+const actionsChildCount = () => !!actions.value?.childNodes?.length;
+
+onBeforeUnmount(() => stateStore.toggleSubToolbar() && hasSubToolbar);
-
+
+
diff --git a/src/composables/useArrayData.js b/src/composables/useArrayData.js
index 3268939de..bd3cecf08 100644
--- a/src/composables/useArrayData.js
+++ b/src/composables/useArrayData.js
@@ -93,6 +93,9 @@ export function useArrayData(key, userOptions) {
if (params.filter.where || exprFilter)
params.filter.where = { ...params.filter.where, ...exprFilter };
+
+ if (!params?.filter?.order?.length) delete params?.filter?.order;
+
params.filter = JSON.stringify(params.filter);
store.isLoading = true;
diff --git a/src/pages/Customer/Card/CustomerNotes.vue b/src/pages/Customer/Card/CustomerNotes.vue
index b85174696..189b59904 100644
--- a/src/pages/Customer/Card/CustomerNotes.vue
+++ b/src/pages/Customer/Card/CustomerNotes.vue
@@ -23,5 +23,6 @@ const noteFilter = computed(() => {
:body="{ clientFk: route.params.id }"
style="overflow-y: auto"
:select-type="true"
+ required
/>
diff --git a/src/pages/Monitor/Ticket/MonitorTickets.vue b/src/pages/Monitor/Ticket/MonitorTickets.vue
index e6b4631a0..3b5dccb56 100644
--- a/src/pages/Monitor/Ticket/MonitorTickets.vue
+++ b/src/pages/Monitor/Ticket/MonitorTickets.vue
@@ -293,7 +293,7 @@ const columns = computed(() => [
title: t('globals.preview'),
icon: 'preview',
color: 'primary',
- action: (row) => viewSummary(row.id, TicketSummary),
+ action: (row) => viewSummary(row.id, TicketSummary, 'lg-width'),
isPrimary: true,
attrs: {
flat: true,
diff --git a/src/pages/Monitor/locale/en.yml b/src/pages/Monitor/locale/en.yml
index 21324087c..496c8761a 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 30afb1904..f6a29879f 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/Ticket/Card/TicketDescriptor.vue b/src/pages/Ticket/Card/TicketDescriptor.vue
index c9849d631..25887fd39 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 6925738e5..de85ce40b 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();
@@ -680,53 +681,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 bb338191b..a662ef0c2 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();
@@ -243,7 +244,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 c51129ff4..fdaf11d8a 100644
--- a/src/pages/Ticket/locale/en.yml
+++ b/src/pages/Ticket/locale/en.yml
@@ -283,3 +283,9 @@ negative:
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 083789d7f..1817284b6 100644
--- a/src/pages/Ticket/locale/es.yml
+++ b/src/pages/Ticket/locale/es.yml
@@ -215,6 +215,7 @@ ticketList:
toLines: Ir a lineas
addressNickname: Alias consignatario
ref: Referencia
+<<<<<<< HEAD
negative:
hour: 'Hora'
id: 'Id Articulo'
@@ -290,3 +291,11 @@ negative:
newTicket: Ticket nuevo
status: Estado
message: Mensaje
+=======
+ rounding: Redondeo
+ noVerifiedData: Sin datos comprobados
+ purchaseRequest: Petición de compra
+ notVisible: No visible
+ clientFrozen: Cliente congelado
+ componentLack: Faltan componentes
+>>>>>>> a338dbed70ac0386f410ac76c5a8ff64228f3251
diff --git a/src/pages/Worker/Card/WorkerCalendar.vue b/src/pages/Worker/Card/WorkerCalendar.vue
index 5ca95a1a4..df4616011 100644
--- a/src/pages/Worker/Card/WorkerCalendar.vue
+++ b/src/pages/Worker/Card/WorkerCalendar.vue
@@ -1,7 +1,8 @@
@@ -181,6 +193,20 @@ watch([year, businessFk], () => refreshData());
/>
+
+ {
+ saveUrl = `Businesses/${data.id}`;
+ }
+ "
+ :body="body"
+ />
+
diff --git a/src/pages/Worker/Card/WorkerCalendarFilter.vue b/src/pages/Worker/Card/WorkerCalendarFilter.vue
index 67b7df907..48fc4094b 100644
--- a/src/pages/Worker/Card/WorkerCalendarFilter.vue
+++ b/src/pages/Worker/Card/WorkerCalendarFilter.vue
@@ -180,8 +180,6 @@ const yearList = ref(generateYears());
:is-clearable="false"
/>
-
-
import { useI18n } from 'vue-i18n';
import { useRoute } from 'vue-router';
-import { ref, computed } from 'vue';
+import { ref, computed, watch } from 'vue';
import FetchData from 'components/FetchData.vue';
import VnRow from 'components/ui/VnRow.vue';
import VnSelect from 'src/components/common/VnSelect.vue';
@@ -19,6 +19,7 @@ const trainsData = ref([]);
const machinesData = ref([]);
const route = useRoute();
const routeId = computed(() => route.params.id);
+const selected = ref([]);
const initialData = computed(() => {
return {
@@ -41,6 +42,21 @@ async function insert() {
await axios.post('Operators', initialData.value);
crudModelRef.value.reload();
}
+
+watch(
+ () => crudModelRef.value?.formData,
+ (formData) => {
+ if (formData && formData.length) {
+ if (JSON.stringify(selected.value) !== JSON.stringify(formData)) {
+ selected.value = formData;
+ }
+ } else if (selected.value.length > 0) {
+ selected.value = [];
+ }
+ },
+ { immediate: true, deep: true }
+);
+
@@ -67,6 +83,7 @@ async function insert() {
:data-required="{ workerFk: route.params.id }"
ref="crudModelRef"
search-url="operator"
+ :selected="selected"
auto-load
>
diff --git a/src/pages/Worker/Card/WorkerSummary.vue b/src/pages/Worker/Card/WorkerSummary.vue
index 98bdffe25..992f6ec71 100644
--- a/src/pages/Worker/Card/WorkerSummary.vue
+++ b/src/pages/Worker/Card/WorkerSummary.vue
@@ -12,7 +12,6 @@ import RoleDescriptorProxy from 'src/pages/Account/Role/Card/RoleDescriptorProxy
import DepartmentDescriptorProxy from 'src/pages/Department/Card/DepartmentDescriptorProxy.vue';
import { useAdvancedSummary } from 'src/composables/useAdvancedSummary';
import WorkerDescriptorMenu from './WorkerDescriptorMenu.vue';
-import axios from 'axios';
const route = useRoute();
const { t } = useI18n();
@@ -28,76 +27,6 @@ const entityId = computed(() => $props.id || route.params.id);
const basicDataUrl = ref(null);
const advancedSummary = ref();
-const filter = {
- include: [
- {
- relation: 'user',
- scope: {
- fields: ['name', 'nickname', 'roleFk'],
-
- include: [
- {
- relation: 'role',
- scope: {
- fields: ['name'],
- },
- },
- {
- relation: 'emailUser',
- scope: {
- fields: ['email'],
- },
- },
- ],
- },
- },
- {
- relation: 'department',
- scope: {
- include: {
- relation: 'department',
- scope: {
- fields: ['name'],
- },
- },
- },
- },
- {
- relation: 'boss',
- },
- {
- relation: 'client',
- },
- {
- relation: 'sip',
- },
- {
- relation: 'business',
- scope: {
- include: [
- {
- relation: 'department',
- scope: {
- fields: ['id', 'name'],
- },
- },
- {
- relation: 'reasonEnd',
- scope: {
- fields: ['id', 'reason'],
- },
- },
- {
- relation: 'workerBusinessProfessionalCategory',
- scope: {
- fields: ['id', 'description'],
- },
- },
- ],
- },
- },
- ],
-};
onBeforeMount(async () => {
advancedSummary.value = await useAdvancedSummary('Workers', entityId.value);
basicDataUrl.value = `#/worker/${entityId.value}/basic-data`;
@@ -107,8 +36,8 @@ onBeforeMount(async () => {
diff --git a/test/cypress/integration/entry/myEntry.spec.js b/test/cypress/integration/entry/myEntry.spec.js
index 492e1b491..49d75cf39 100644
--- a/test/cypress/integration/entry/myEntry.spec.js
+++ b/test/cypress/integration/entry/myEntry.spec.js
@@ -11,7 +11,7 @@ describe('EntryMy 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.dataCy('printLabelsBtn').click();
cy.window().its('open').should('be.called');
diff --git a/test/cypress/integration/ticket/ticketList.spec.js b/test/cypress/integration/ticket/ticketList.spec.js
index 2984a4ee4..593021e6e 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/vnComponent/VnSearchBar.spec.js b/test/cypress/integration/vnComponent/VnSearchBar.spec.js
index c710d5192..11d9bbe6a 100644
--- a/test/cypress/integration/vnComponent/VnSearchBar.spec.js
+++ b/test/cypress/integration/vnComponent/VnSearchBar.spec.js
@@ -1,7 +1,6 @@
///
describe('VnSearchBar', () => {
const employeeId = ' #1';
- const salesPersonId = ' #18';
const idGap = '.q-item > .q-item__label';
const vnTableRow = '.q-virtual-scroll__content';
beforeEach(() => {
@@ -12,11 +11,10 @@ describe('VnSearchBar', () => {
it('should redirect to account summary page', () => {
searchAndCheck('1', employeeId);
- searchAndCheck('salesPerson', salesPersonId);
+ searchAndCheck('employee', employeeId);
});
it('should stay on the list page if there are several results or none', () => {
- cy.typeSearchbar('salesA{enter}');
cy.typeSearchbar('salesA{enter}');
checkTableLength(2);
@@ -29,7 +27,6 @@ describe('VnSearchBar', () => {
const searchAndCheck = (searchTerm, expectedText) => {
cy.clearSearchbar();
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 501375d8c..ce3723e54 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 0ad98e597..343c1c127 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();
});
});