Merge branch 'test' of https://gitea.verdnatura.es/verdnatura/salix-front into dev
gitea/salix-front/pipeline/head This commit looks good Details

This commit is contained in:
Alex Moreno 2025-03-12 12:48:07 +01:00
commit d078969dd6
5 changed files with 12337 additions and 8838 deletions

View File

@ -25,6 +25,8 @@ RUN apt-get update \
libnss3 \
libxss1 \
libxtst6 \
mesa-vulkan-drivers \
vulkan-tools \
xauth \
xvfb \
&& apt-get clean \

File diff suppressed because it is too large Load Diff

View File

@ -73,6 +73,7 @@ const onNodeExpanded = async (nodeKeysArray) => {
const response = await axios.get(`Zones/${route.params.id}/getLeaves`, {
params,
});
response.data = JSON.parse(response.data);
if (response.data) {
node.childs = response.data.map((n) => {
if (n.sons > 0) n.childs = [{}];
@ -126,14 +127,17 @@ watch(
async (val) => {
if (!val) return;
// // Se triggerea cuando se actualiza el store.data, el cual es el resultado del fetch de la searchbar
val = JSON.parse(val);
if (!nodes.value[0]) nodes.value = [defaultNode];
nodes.value[0].childs = [...val];
const fetchedNodeKeys = val.flatMap(getNodeIds);
state.set('Tree', [...fetchedNodeKeys]);
expanded.value = [null, ...fetchedNodeKeys];
const fetchs = [];
for (let n of state.get('Tree')) {
await fetchNodeLeaves(n);
fetchs.push(fetchNodeLeaves(n));
}
await Promise.all(fetchs);
previousExpandedNodes.value = new Set(expanded.value);
},
{ immediate: true },

View File

@ -1,14 +1,13 @@
/// <reference types="cypress" />
describe('Client balance', () => {
beforeEach(() => {
cy.viewport(1280, 720);
cy.login('developer');
cy.visit('#/customer/1101/balance');
});
it('Should create a mandate', () => {
cy.get('.q-page-sticky > div > .q-btn').click();
cy.selectOption('[data-cy="paymentBank"]', 2);
cy.dataCy('paymentAmount_input').type('100');
cy.dataCy('paymentAmount_input').clear().type('100');
cy.saveCard();
});
});

View File

@ -62,12 +62,7 @@ Cypress.Commands.overwrite('visit', (originalFn, url, options, waitRequest = tru
originalFn(url, options);
cy.waitUntil(() => cy.document().then((doc) => doc.readyState === 'complete'));
cy.waitUntil(() => cy.get('main').should('exist'));
if (waitRequest)
cy.get('body').then(($body) => {
if ($body.find('[data-cy="loading-spinner"]').length) {
cy.get('[data-cy="loading-spinner"]').should('not.be.visible');
}
});
if (waitRequest) cy.waitSpinner();
});
Cypress.Commands.add('waitForElement', (element) => {
@ -99,6 +94,14 @@ Cypress.Commands.add('getValue', (selector) => {
});
});
Cypress.Commands.add('waitSpinner', () => {
cy.get('body').then(($body) => {
if ($body.find('[data-cy="loading-spinner"]').length) {
cy.get('[data-cy="loading-spinner"]').should('not.be.visible');
}
});
});
// Fill Inputs
Cypress.Commands.add('selectOption', (selector, option, timeout = 2500) => {
cy.waitForElement(selector, timeout);
@ -116,6 +119,7 @@ Cypress.Commands.add('selectOption', (selector, option, timeout = 2500) => {
function selectItem(selector, option, ariaControl, hasWrite = true) {
if (!hasWrite) cy.wait(100);
cy.waitSpinner();
getItems(ariaControl).then((items) => {
const matchingItem = items
@ -135,6 +139,7 @@ function getItems(ariaControl, startTime = Cypress._.now(), timeout = 2500) {
.should('exist')
.find('.q-item')
.should('exist')
.should('be.visible')
.then(($items) => {
if (!$items?.length || $items.first().text().trim() === '') {
if (Cypress._.now() - startTime > timeout) {