Merge branch 'master' of https://gitea.verdnatura.es/verdnatura/salix-front
This commit is contained in:
commit
fa31c49ebd
|
@ -3,12 +3,13 @@ import { computed, ref } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
import { toCurrency, toDateHourMin } from 'src/filters';
|
import { toCurrency, toDateHourMin } from 'src/filters';
|
||||||
|
import { useArrayData } from 'composables/useArrayData';
|
||||||
import VnTable from 'components/VnTable/VnTable.vue';
|
import VnTable from 'components/VnTable/VnTable.vue';
|
||||||
import VnUserLink from 'src/components/ui/VnUserLink.vue';
|
import VnUserLink from 'src/components/ui/VnUserLink.vue';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
|
const arrayData = useArrayData('Customer');
|
||||||
const filter = computed(() => {
|
const filter = computed(() => {
|
||||||
return {
|
return {
|
||||||
include: [
|
include: [
|
||||||
|
@ -77,7 +78,10 @@ const columns = computed(() => [
|
||||||
:create="{
|
:create="{
|
||||||
urlUpdate: `Clients/${route.params.id}`,
|
urlUpdate: `Clients/${route.params.id}`,
|
||||||
title: t('New credit'),
|
title: t('New credit'),
|
||||||
onDataSaved: () => tableRef.reload(),
|
onDataSaved: () => {
|
||||||
|
arrayData.fetch({ append: false });
|
||||||
|
tableRef.reload();
|
||||||
|
},
|
||||||
formInitialData: { credit: tableData.at(0)?.amount },
|
formInitialData: { credit: tableData.at(0)?.amount },
|
||||||
}"
|
}"
|
||||||
>
|
>
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
/// <reference types="cypress" />
|
/// <reference types="cypress" />
|
||||||
describe('Client credits', () => {
|
describe('Client credits', () => {
|
||||||
|
const credit = 100;
|
||||||
|
const descriptorCreditValue = '[data-cy="vnLvCredit"] > .value > span';
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
cy.viewport(1280, 720);
|
cy.viewport(1280, 720);
|
||||||
cy.login('developer');
|
cy.login('developer');
|
||||||
|
@ -11,9 +14,19 @@ describe('Client credits', () => {
|
||||||
it('Should put a new credit', () => {
|
it('Should put a new credit', () => {
|
||||||
cy.get('.q-page').should('be.visible');
|
cy.get('.q-page').should('be.visible');
|
||||||
cy.dataCy('vnTableCreateBtn').click();
|
cy.dataCy('vnTableCreateBtn').click();
|
||||||
cy.dataCy('Credit_input').type('100');
|
cy.dataCy('Credit_input').type(credit);
|
||||||
cy.dataCy('FormModelPopup_save').click();
|
cy.dataCy('FormModelPopup_save').click();
|
||||||
cy.checkNotification('Data saved');
|
cy.checkNotification('Data saved');
|
||||||
|
cy.get(descriptorCreditValue)
|
||||||
|
.invoke('text')
|
||||||
|
.then((text) => {
|
||||||
|
const creditValue = parseInt(
|
||||||
|
text.trim().replace('€', '').split('.')[0],
|
||||||
|
10,
|
||||||
|
);
|
||||||
|
cy.log(creditValue);
|
||||||
|
expect(creditValue).to.equal(credit);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Should put a new credit with value 0 to close the client card', () => {
|
it('Should put a new credit with value 0 to close the client card', () => {
|
||||||
|
|
Loading…
Reference in New Issue