7525-devToTest #419

Merged
alexm merged 177 commits from 7525-devToTest into test 2024-06-04 08:06:27 +00:00
4 changed files with 14 additions and 53 deletions
Showing only changes of commit 3b3e7e7e03 - Show all commits

View File

@ -346,7 +346,7 @@ const getLink = (param) => `#/invoice-in/${entityId.value}/${param}`;
}}</QTd>
<QTd></QTd>
<QTd></QTd>
<QTd>{{
<QTd class="text-center">{{
toCurrency(getTotalTax(entity.invoiceInTax, currency))
}}</QTd>
<QTd></QTd>
@ -361,6 +361,7 @@ const getLink = (param) => `#/invoice-in/${entityId.value}/${param}`;
<template #header="dueDayProps">
<QTr :props="dueDayProps" class="bg">
<QTh
table-header-style="max-width:50%"
v-for="col in dueDayProps.cols"
:key="col.name"
:props="dueDayProps"
@ -425,22 +426,15 @@ const getLink = (param) => `#/invoice-in/${entityId.value}/${param}`;
.summaryBody {
.vat {
flex: 65%;
table th {
&:nth-child(5) {
padding: 0;
}
&:last-child {
padding: 0;
}
}
}
.due-day {
flex: 30%;
table th {
&:last-child {
padding: 0;
}
}
.vat,
.due-day {
.q-table th {
padding-right: 0;
}
}
}

View File

@ -1,6 +1,6 @@
<script setup>
import { ref, computed } from 'vue';
import { useRouter } from 'vue-router';
import { useRoute } from 'vue-router';
import { useI18n } from 'vue-i18n';
import { useQuasar } from 'quasar';
import axios from 'axios';
@ -11,13 +11,13 @@ import VnSelect from 'src/components/common/VnSelect.vue';
import CrudModel from 'src/components/CrudModel.vue';
import VnCurrency from 'src/components/common/VnCurrency.vue';
const { currentRoute } = useRouter();
const router = useRoute();
const { t } = useI18n();
const quasar = useQuasar();
const arrayData = useArrayData(currentRoute.value.meta.moduleName);
const arrayData = useArrayData(router.meta.moduleName);
const invoiceIn = computed(() => arrayData.store.data);
const invoiceId = +currentRoute.value.params.id;
const invoiceId = +router.params.id;
const currency = computed(() => invoiceIn.value?.currency?.code);
const expenses = ref([]);
const sageTaxTypes = ref([]);

View File

@ -1,5 +1,5 @@
import { vi, describe, expect, it, beforeAll } from 'vitest';
import { createWrapper, axios } from 'app/test/vitest/helper';
import { createWrapper } from 'app/test/vitest/helper';
import InvoiceInVat from 'src/pages/InvoiceIn/Card/InvoiceInVat.vue';
describe('InvoiceInVat', () => {
@ -16,41 +16,6 @@ describe('InvoiceInVat', () => {
}).vm;
});
describe('addExpense()', () => {
beforeAll(() => {
vi.spyOn(axios, 'post').mockResolvedValue({ data: [] });
vi.spyOn(axios, 'get').mockResolvedValue({ data: [] });
vi.spyOn(vm.quasar, 'notify');
});
it('should throw an error when the code property is undefined', async () => {
await vm.addExpense();
expect(vm.quasar.notify).toHaveBeenCalledWith(
expect.objectContaining({
message: `The code can't be empty`,
type: 'negative',
})
);
});
it('should correctly handle expense addition', async () => {
vm.newExpense = {
code: 123,
isWithheld: false,
description: 'Descripción del gasto',
};
await vm.addExpense();
expect(vm.quasar.notify).toHaveBeenCalledWith(
expect.objectContaining({
message: 'Data saved',
type: 'positive',
})
);
});
});
describe('taxRate()', () => {
it('should correctly compute the tax rate', () => {
const invoiceInTax = { taxableBase: 100, taxTypeSageFk: 1 };

View File

@ -24,6 +24,7 @@ vi.mock('vue-router', () => ({
params: {
id: 1,
},
meta: { moduleName: 'mockName' },
},
},
}),
@ -31,6 +32,7 @@ vi.mock('vue-router', () => ({
matched: [],
query: {},
params: {},
meta: { moduleName: 'mockName' },
}),
}));