Merge branch 'test' of https://gitea.verdnatura.es/verdnatura/salix-front into dev
This commit is contained in:
commit
421970ba45
|
@ -192,6 +192,7 @@ const debtWarning = computed(() => {
|
||||||
query: {
|
query: {
|
||||||
createForm: JSON.stringify({
|
createForm: JSON.stringify({
|
||||||
clientFk: entity.id,
|
clientFk: entity.id,
|
||||||
|
addressId: entity.defaultAddressFk,
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
}"
|
}"
|
||||||
|
|
|
@ -125,7 +125,7 @@ onMounted(async () => {
|
||||||
inventoriedDate.value =
|
inventoriedDate.value =
|
||||||
(await axios.get('Configs/findOne')).data?.inventoried || today;
|
(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;
|
else if (!ref.warehouseFk && user.value) ref.warehouseFk = user.value.warehouseFk;
|
||||||
if (ref.date) showWhatsBeforeInventory.value = true;
|
if (ref.date) showWhatsBeforeInventory.value = true;
|
||||||
ref.itemFk = route.params.id;
|
ref.itemFk = route.params.id;
|
||||||
|
@ -143,7 +143,7 @@ onMounted(async () => {
|
||||||
const fetchItemBalances = async () => await arrayDataItemBalances.fetch({});
|
const fetchItemBalances = async () => await arrayDataItemBalances.fetch({});
|
||||||
|
|
||||||
const getBadgeAttrs = (_date) => {
|
const getBadgeAttrs = (_date) => {
|
||||||
const isSameDate = date.isSameDate(today.value, _date);
|
const isSameDate = date.isSameDate(today, _date);
|
||||||
const attrs = {
|
const attrs = {
|
||||||
'text-color': isSameDate ? 'black' : 'white',
|
'text-color': isSameDate ? 'black' : 'white',
|
||||||
color: isSameDate ? 'warning' : 'transparent',
|
color: isSameDate ? 'warning' : 'transparent',
|
||||||
|
@ -153,8 +153,6 @@ const getBadgeAttrs = (_date) => {
|
||||||
|
|
||||||
const scrollToToday = async () => {
|
const scrollToToday = async () => {
|
||||||
await nextTick();
|
await nextTick();
|
||||||
const today = Date.vnNew();
|
|
||||||
today.setHours(0, 0, 0, 0);
|
|
||||||
const todayCell = document.querySelector(`td[data-date="${today.toISOString()}"]`);
|
const todayCell = document.querySelector(`td[data-date="${today.toISOString()}"]`);
|
||||||
if (todayCell) {
|
if (todayCell) {
|
||||||
todayCell.scrollIntoView({ behavior: 'smooth', block: 'center' });
|
todayCell.scrollIntoView({ behavior: 'smooth', block: 'center' });
|
||||||
|
|
|
@ -81,7 +81,7 @@ const columns = computed(() => [
|
||||||
label: t('module.created'),
|
label: t('module.created'),
|
||||||
component: 'date',
|
component: 'date',
|
||||||
cardVisible: true,
|
cardVisible: true,
|
||||||
format: (row) => toDateTimeFormat(row?.landed),
|
format: (row) => toDateTimeFormat(row?.created),
|
||||||
columnField: {
|
columnField: {
|
||||||
component: null,
|
component: null,
|
||||||
},
|
},
|
||||||
|
|
|
@ -62,7 +62,7 @@ describe('Client list', () => {
|
||||||
it('Client founded create order', () => {
|
it('Client founded create order', () => {
|
||||||
const search = 'Jessica Jones';
|
const search = 'Jessica Jones';
|
||||||
cy.searchByLabel('Name', search);
|
cy.searchByLabel('Name', search);
|
||||||
cy.openActionDescriptor('New order');
|
cy.clickButtonWith('icon', 'icon-basketadd');
|
||||||
cy.waitForElement('#formModel');
|
cy.waitForElement('#formModel');
|
||||||
cy.waitForElement('.q-form');
|
cy.waitForElement('.q-form');
|
||||||
cy.checkValueForm(1, search);
|
cy.checkValueForm(1, search);
|
||||||
|
|
|
@ -289,40 +289,13 @@ Cypress.Commands.add('openActionDescriptor', (opt) => {
|
||||||
cy.openActionsDescriptor();
|
cy.openActionsDescriptor();
|
||||||
const listItem = '[role="menu"] .q-list .q-item';
|
const listItem = '[role="menu"] .q-list .q-item';
|
||||||
cy.contains(listItem, opt).click();
|
cy.contains(listItem, opt).click();
|
||||||
1;
|
|
||||||
});
|
});
|
||||||
|
|
||||||
Cypress.Commands.add('openActionsDescriptor', () => {
|
Cypress.Commands.add('openActionsDescriptor', () => {
|
||||||
cy.get('[data-cy="descriptor-more-opts"]').click();
|
cy.get('[data-cy="descriptor-more-opts"]').click();
|
||||||
});
|
});
|
||||||
|
|
||||||
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();
|
|
||||||
});
|
|
||||||
|
|
||||||
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})`)
|
cy.get(`.actions > .q-card__actions> .q-btn:nth-child(${id})`)
|
||||||
.invoke('removeAttr', 'target')
|
.invoke('removeAttr', 'target')
|
||||||
.click();
|
.click();
|
||||||
|
@ -374,3 +347,21 @@ Cypress.Commands.add('addBtnClick', () => {
|
||||||
.and('be.visible')
|
.and('be.visible')
|
||||||
.click();
|
.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();
|
||||||
|
});
|
||||||
|
|
Loading…
Reference in New Issue