forked from verdnatura/salix-front
test(WorkerList): refs #7589 fix e2e
This commit is contained in:
parent
f7a6e3d471
commit
3ae523ef04
|
@ -56,11 +56,20 @@ async function fetch() {
|
||||||
}
|
}
|
||||||
|
|
||||||
const showRedirectToSummaryIcon = computed(() => {
|
const showRedirectToSummaryIcon = computed(() => {
|
||||||
const routeExists = route.matched.some(
|
const exist = existSummary(route.matched);
|
||||||
(route) => route.name === `${route.meta.moduleName}Summary`
|
return !isSummary.value && route.meta.moduleName && exist;
|
||||||
);
|
|
||||||
return !isSummary.value && route.meta.moduleName && routeExists;
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function existSummary(routes) {
|
||||||
|
const hasSummary = routes.some((r) => r.name === `${route.meta.moduleName}Summary`);
|
||||||
|
if (hasSummary) return hasSummary;
|
||||||
|
for (const current of routes) {
|
||||||
|
if (current.path != '/' && current.children) {
|
||||||
|
const exist = existSummary(current.children);
|
||||||
|
if (exist) return exist;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|
|
@ -20,6 +20,6 @@ describe('WorkerList', () => {
|
||||||
.eq(0)
|
.eq(0)
|
||||||
.invoke('text')
|
.invoke('text')
|
||||||
.should('include', 'Basic data');
|
.should('include', 'Basic data');
|
||||||
cy.get('.summary .header-link').eq(1).should('have.text', 'User data ');
|
cy.get('.summary .header-link').eq(2).should('have.text', 'User data ');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue