feat: refs #8463 update data-cy attributes in VnDescriptor for improved testing and consistency
gitea/salix-front/pipeline/pr-dev This commit is unstable
Details
gitea/salix-front/pipeline/pr-dev This commit is unstable
Details
This commit is contained in:
parent
8bdd581764
commit
944a70be47
|
@ -106,7 +106,7 @@ const toModule = computed(() => {
|
|||
</script>
|
||||
|
||||
<template>
|
||||
<div class="descriptor">
|
||||
<div class="descriptor" data-cy="vnDescriptor">
|
||||
<template v-if="entity && entity?.id">
|
||||
<div class="header bg-primary q-pa-sm justify-between">
|
||||
<slot name="header-extra-action">
|
||||
|
@ -153,7 +153,7 @@ const toModule = computed(() => {
|
|||
data-cy="goToSummaryBtn"
|
||||
>
|
||||
<QTooltip>
|
||||
{{ t('components.cardDescriptor.summary') }}
|
||||
{{ t('components.vnDescriptor.summary') }}
|
||||
</QTooltip>
|
||||
</QBtn>
|
||||
</RouterLink>
|
||||
|
@ -168,18 +168,27 @@ const toModule = computed(() => {
|
|||
<QList dense>
|
||||
<QItemLabel header class="ellipsis text-h5" :lines="1">
|
||||
<div class="title">
|
||||
<span v-if="title" :title="getValueFromPath(title)">
|
||||
<span
|
||||
v-if="title"
|
||||
:title="getValueFromPath(title)"
|
||||
:data-cy="`${$attrs['data-cy'] ?? 'vnDescriptor'}_title`"
|
||||
>
|
||||
{{ getValueFromPath(title) ?? title }}
|
||||
</span>
|
||||
<slot v-else name="description" :entity="entity">
|
||||
<span :title="entity.name">
|
||||
{{ entity.name }}
|
||||
</span>
|
||||
<span
|
||||
:title="entity.name"
|
||||
:data-cy="`${$attrs['data-cy'] ?? 'vnDescriptor'}_description`"
|
||||
v-text="entity.name"
|
||||
/>
|
||||
</slot>
|
||||
</div>
|
||||
</QItemLabel>
|
||||
<QItem>
|
||||
<QItemLabel class="subtitle">
|
||||
<QItemLabel
|
||||
class="subtitle"
|
||||
:data-cy="`${$attrs['data-cy'] ?? 'vnDescriptor'}_subtitle`"
|
||||
>
|
||||
#{{ getValueFromPath(subtitle) ?? entity.id }}
|
||||
</QItemLabel>
|
||||
<QBtn
|
||||
|
@ -197,7 +206,10 @@ const toModule = computed(() => {
|
|||
</QBtn>
|
||||
</QItem>
|
||||
</QList>
|
||||
<div class="list-box q-mt-xs">
|
||||
<div
|
||||
class="list-box q-mt-xs"
|
||||
:data-cy="`${$attrs['data-cy'] ?? 'vnDescriptor'}_listbox`"
|
||||
>
|
||||
<slot name="body" :entity="entity" />
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -371,7 +371,7 @@ Cypress.Commands.add('validateContent', (selector, expectedValue) => {
|
|||
});
|
||||
|
||||
Cypress.Commands.add('openActionsDescriptor', () => {
|
||||
cy.get('[data-cy="cardDescriptor"] [data-cy="descriptor-more-opts"]').click();
|
||||
cy.get('[data-cy="vnDescriptor"] [data-cy="descriptor-more-opts"]').click();
|
||||
});
|
||||
|
||||
Cypress.Commands.add('openUserPanel', () => {
|
||||
|
@ -466,16 +466,16 @@ Cypress.Commands.add('validateDescriptor', (toCheck = {}) => {
|
|||
|
||||
const popupSelector = popup ? '[role="menu"] ' : '';
|
||||
|
||||
if (title) cy.get(`${popupSelector}[data-cy="cardDescriptor_title"]`).contains(title);
|
||||
if (title) cy.get(`${popupSelector}[data-cy="vnDescriptor_title"]`).contains(title);
|
||||
if (description)
|
||||
cy.get(`${popupSelector}[data-cy="cardDescriptor_description"]`).contains(
|
||||
cy.get(`${popupSelector}[data-cy="vnDescriptor_description"]`).contains(
|
||||
description,
|
||||
);
|
||||
if (subtitle)
|
||||
cy.get(`${popupSelector}[data-cy="cardDescriptor_subtitle"]`).contains(subtitle);
|
||||
cy.get(`${popupSelector}[data-cy="vnDescriptor_subtitle"]`).contains(subtitle);
|
||||
|
||||
for (const index in listbox)
|
||||
cy.get(`${popupSelector}[data-cy="cardDescriptor_listbox"] > *`)
|
||||
cy.get(`${popupSelector}[data-cy="vnDescriptor_listbox"] > *`)
|
||||
.eq(index)
|
||||
.should('contain.text', listbox[index]);
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue