Merge pull request 'Hotfix[ZoneLocationsTree]: Fixed node fetching and adapted to back data' (!1589) from Hotfix-ZoneLocationsGetLeaves into master
gitea/salix-front/pipeline/head This commit looks good
Details
gitea/salix-front/pipeline/head This commit looks good
Details
Reviewed-on: #1589 Reviewed-by: Javi Gallego <jgallego@verdnatura.es> Reviewed-by: Alex Moreno <alexm@verdnatura.es>
This commit is contained in:
commit
9b2b488ca6
|
@ -30,7 +30,7 @@ export default defineConfig({
|
||||||
trashAssetsBeforeRuns: false,
|
trashAssetsBeforeRuns: false,
|
||||||
requestTimeout: 10000,
|
requestTimeout: 10000,
|
||||||
responseTimeout: 30000,
|
responseTimeout: 30000,
|
||||||
pageLoadTimeout: 60000,
|
pageLoadTimeout: 120000,
|
||||||
defaultBrowser: 'chromium',
|
defaultBrowser: 'chromium',
|
||||||
fixturesFolder: 'test/cypress/fixtures',
|
fixturesFolder: 'test/cypress/fixtures',
|
||||||
screenshotsFolder: 'test/cypress/screenshots',
|
screenshotsFolder: 'test/cypress/screenshots',
|
||||||
|
|
|
@ -25,6 +25,8 @@ RUN apt-get update \
|
||||||
libnss3 \
|
libnss3 \
|
||||||
libxss1 \
|
libxss1 \
|
||||||
libxtst6 \
|
libxtst6 \
|
||||||
|
mesa-vulkan-drivers \
|
||||||
|
vulkan-tools \
|
||||||
xauth \
|
xauth \
|
||||||
xvfb \
|
xvfb \
|
||||||
&& apt-get clean \
|
&& apt-get clean \
|
||||||
|
@ -39,7 +41,7 @@ ENV PNPM_HOME="/home/app/.local/share/pnpm"
|
||||||
ENV PATH="$PNPM_HOME:$PATH"
|
ENV PATH="$PNPM_HOME:$PATH"
|
||||||
|
|
||||||
RUN pnpm setup \
|
RUN pnpm setup \
|
||||||
&& pnpm install --global cypress@13.6.6 \
|
&& pnpm install --global cypress@14.1.0 \
|
||||||
&& cypress install
|
&& cypress install
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
|
@ -47,7 +47,7 @@
|
||||||
"@quasar/quasar-app-extension-testing-unit-vitest": "^0.4.0",
|
"@quasar/quasar-app-extension-testing-unit-vitest": "^0.4.0",
|
||||||
"@vue/test-utils": "^2.4.4",
|
"@vue/test-utils": "^2.4.4",
|
||||||
"autoprefixer": "^10.4.14",
|
"autoprefixer": "^10.4.14",
|
||||||
"cypress": "^13.6.6",
|
"cypress": "^14.1.0",
|
||||||
"cypress-mochawesome-reporter": "^3.8.2",
|
"cypress-mochawesome-reporter": "^3.8.2",
|
||||||
"eslint": "^9.18.0",
|
"eslint": "^9.18.0",
|
||||||
"eslint-config-prettier": "^10.0.1",
|
"eslint-config-prettier": "^10.0.1",
|
||||||
|
|
|
@ -71,11 +71,11 @@ devDependencies:
|
||||||
specifier: ^10.4.14
|
specifier: ^10.4.14
|
||||||
version: 10.4.20(postcss@8.5.1)
|
version: 10.4.20(postcss@8.5.1)
|
||||||
cypress:
|
cypress:
|
||||||
specifier: ^13.6.6
|
specifier: ^14.1.0
|
||||||
version: 13.17.0
|
version: 14.1.0
|
||||||
cypress-mochawesome-reporter:
|
cypress-mochawesome-reporter:
|
||||||
specifier: ^3.8.2
|
specifier: ^3.8.2
|
||||||
version: 3.8.2(cypress@13.17.0)(mocha@11.0.1)
|
version: 3.8.2(cypress@14.1.0)(mocha@11.0.1)
|
||||||
eslint:
|
eslint:
|
||||||
specifier: ^9.18.0
|
specifier: ^9.18.0
|
||||||
version: 9.18.0
|
version: 9.18.0
|
||||||
|
@ -3321,7 +3321,7 @@ packages:
|
||||||
/csstype@3.1.3:
|
/csstype@3.1.3:
|
||||||
resolution: {integrity: sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==}
|
resolution: {integrity: sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==}
|
||||||
|
|
||||||
/cypress-mochawesome-reporter@3.8.2(cypress@13.17.0)(mocha@11.0.1):
|
/cypress-mochawesome-reporter@3.8.2(cypress@14.1.0)(mocha@11.0.1):
|
||||||
resolution: {integrity: sha512-oJZkNzhNmN9ZD+LmZyFuPb8aWaIijyHyqYh52YOBvR6B6ckfJNCHP3A98a+/nG0H4t46CKTNwo+wNpMa4d2kjA==}
|
resolution: {integrity: sha512-oJZkNzhNmN9ZD+LmZyFuPb8aWaIijyHyqYh52YOBvR6B6ckfJNCHP3A98a+/nG0H4t46CKTNwo+wNpMa4d2kjA==}
|
||||||
engines: {node: '>=14'}
|
engines: {node: '>=14'}
|
||||||
hasBin: true
|
hasBin: true
|
||||||
|
@ -3329,7 +3329,7 @@ packages:
|
||||||
cypress: '>=6.2.0'
|
cypress: '>=6.2.0'
|
||||||
dependencies:
|
dependencies:
|
||||||
commander: 10.0.1
|
commander: 10.0.1
|
||||||
cypress: 13.17.0
|
cypress: 14.1.0
|
||||||
fs-extra: 10.1.0
|
fs-extra: 10.1.0
|
||||||
mochawesome: 7.1.3(mocha@11.0.1)
|
mochawesome: 7.1.3(mocha@11.0.1)
|
||||||
mochawesome-merge: 4.3.0
|
mochawesome-merge: 4.3.0
|
||||||
|
@ -3338,9 +3338,9 @@ packages:
|
||||||
- mocha
|
- mocha
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/cypress@13.17.0:
|
/cypress@14.1.0:
|
||||||
resolution: {integrity: sha512-5xWkaPurwkIljojFidhw8lFScyxhtiFHl/i/3zov+1Z5CmY4t9tjIdvSXfu82Y3w7wt0uR9KkucbhkVvJZLQSA==}
|
resolution: {integrity: sha512-pPPj8Uu9NwjaaiXAEcjYZZmgsq6v9Zs1Nw6a+zRF+ANgYSNhH4S32SjFRsvMcuOHR/8dp4GBJhBPqIPSs+TxaA==}
|
||||||
engines: {node: ^16.0.0 || ^18.0.0 || >=20.0.0}
|
engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0}
|
||||||
hasBin: true
|
hasBin: true
|
||||||
requiresBuild: true
|
requiresBuild: true
|
||||||
dependencies:
|
dependencies:
|
||||||
|
|
|
@ -72,6 +72,7 @@ const onNodeExpanded = async (nodeKeysArray) => {
|
||||||
const response = await axios.get(`Zones/${route.params.id}/getLeaves`, {
|
const response = await axios.get(`Zones/${route.params.id}/getLeaves`, {
|
||||||
params,
|
params,
|
||||||
});
|
});
|
||||||
|
response.data = JSON.parse(response.data);
|
||||||
if (response.data) {
|
if (response.data) {
|
||||||
node.childs = response.data.map((n) => {
|
node.childs = response.data.map((n) => {
|
||||||
if (n.sons > 0) n.childs = [{}];
|
if (n.sons > 0) n.childs = [{}];
|
||||||
|
@ -125,14 +126,17 @@ watch(
|
||||||
async (val) => {
|
async (val) => {
|
||||||
if (!val) return;
|
if (!val) return;
|
||||||
// // Se triggerea cuando se actualiza el store.data, el cual es el resultado del fetch de la searchbar
|
// // 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];
|
if (!nodes.value[0]) nodes.value = [defaultNode];
|
||||||
nodes.value[0].childs = [...val];
|
nodes.value[0].childs = [...val];
|
||||||
const fetchedNodeKeys = val.flatMap(getNodeIds);
|
const fetchedNodeKeys = val.flatMap(getNodeIds);
|
||||||
state.set('Tree', [...fetchedNodeKeys]);
|
state.set('Tree', [...fetchedNodeKeys]);
|
||||||
expanded.value = [null, ...fetchedNodeKeys];
|
expanded.value = [null, ...fetchedNodeKeys];
|
||||||
|
const fetchs = [];
|
||||||
for (let n of state.get('Tree')) {
|
for (let n of state.get('Tree')) {
|
||||||
await fetchNodeLeaves(n);
|
fetchs.push(fetchNodeLeaves(n));
|
||||||
}
|
}
|
||||||
|
await Promise.all(fetchs);
|
||||||
previousExpandedNodes.value = new Set(expanded.value);
|
previousExpandedNodes.value = new Set(expanded.value);
|
||||||
},
|
},
|
||||||
{ immediate: true }
|
{ immediate: true }
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
/// <reference types="cypress" />
|
/// <reference types="cypress" />
|
||||||
describe('Client balance', () => {
|
describe('Client balance', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
cy.viewport(1280, 720);
|
|
||||||
cy.login('developer');
|
cy.login('developer');
|
||||||
cy.visit('#/customer/1101/balance');
|
cy.visit('#/customer/1101/balance');
|
||||||
});
|
});
|
||||||
it('Should create a mandate', () => {
|
it('Should create a mandate', () => {
|
||||||
|
cy.waitSpinner();
|
||||||
cy.get('.q-page-sticky > div > .q-btn').click();
|
cy.get('.q-page-sticky > div > .q-btn').click();
|
||||||
cy.selectOption('[data-cy="paymentBank"]', 2);
|
cy.selectOption('[data-cy="paymentBank"]', 2);
|
||||||
cy.dataCy('paymentAmount_input').type('100');
|
cy.dataCy('paymentAmount_input').clear().type('100');
|
||||||
cy.saveCard();
|
cy.saveCard();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -92,6 +92,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
|
// Fill Inputs
|
||||||
Cypress.Commands.add('selectOption', (selector, option, timeout = 2500) => {
|
Cypress.Commands.add('selectOption', (selector, option, timeout = 2500) => {
|
||||||
cy.waitForElement(selector, timeout);
|
cy.waitForElement(selector, timeout);
|
||||||
|
@ -109,6 +117,7 @@ Cypress.Commands.add('selectOption', (selector, option, timeout = 2500) => {
|
||||||
|
|
||||||
function selectItem(selector, option, ariaControl, hasWrite = true) {
|
function selectItem(selector, option, ariaControl, hasWrite = true) {
|
||||||
if (!hasWrite) cy.wait(100);
|
if (!hasWrite) cy.wait(100);
|
||||||
|
cy.waitSpinner();
|
||||||
|
|
||||||
getItems(ariaControl).then((items) => {
|
getItems(ariaControl).then((items) => {
|
||||||
const matchingItem = items
|
const matchingItem = items
|
||||||
|
@ -128,6 +137,7 @@ function getItems(ariaControl, startTime = Cypress._.now(), timeout = 2500) {
|
||||||
.should('exist')
|
.should('exist')
|
||||||
.find('.q-item')
|
.find('.q-item')
|
||||||
.should('exist')
|
.should('exist')
|
||||||
|
.should('be.visible')
|
||||||
.then(($items) => {
|
.then(($items) => {
|
||||||
if (!$items?.length || $items.first().text().trim() === '') {
|
if (!$items?.length || $items.first().text().trim() === '') {
|
||||||
if (Cypress._.now() - startTime > timeout) {
|
if (Cypress._.now() - startTime > timeout) {
|
||||||
|
|
Loading…
Reference in New Issue