0
0
Fork 0

test(WorkerList): refs #7589 fix e2e

This commit is contained in:
Alex Moreno 2024-05-27 16:52:53 +02:00
parent f7a6e3d471
commit 3ae523ef04
2 changed files with 14 additions and 5 deletions

View File

@ -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>

View File

@ -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 ');
}); });
}); });