fix: refs #8581 add data-cy attribute to QCheckbox for better testability

This commit is contained in:
Jorge Penadés 2025-02-24 17:32:16 +01:00
parent e29f82ba8c
commit 02fe39668d
2 changed files with 7 additions and 2 deletions

View File

@ -717,6 +717,7 @@ function cardClick(_, row) {
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
" "
:data-cy="`vnTableCell_${col.name}`"
> >
<slot <slot
:name="`column-${col.name}`" :name="`column-${col.name}`"
@ -751,7 +752,6 @@ function cardClick(_, row) {
: col?.style : col?.style
" "
style="bottom: 0" style="bottom: 0"
:data-cy="`vnTableCell_${col.name}`"
> >
{{ formatColumnValue(col, row, dashIfEmpty) }} {{ formatColumnValue(col, row, dashIfEmpty) }}
</span> </span>

View File

@ -27,7 +27,12 @@ const checkboxModel = computed({
</script> </script>
<template> <template>
<div> <div>
<QCheckbox v-bind="$attrs" v-on="$attrs" v-model="checkboxModel" /> <QCheckbox
v-bind="$attrs"
v-on="$attrs"
v-model="checkboxModel"
:data-cy="$attrs['data-cy'] ?? `vnCheckbox${$attrs['label'] ?? ''}`"
/>
<QIcon <QIcon
v-if="info" v-if="info"
v-bind="$attrs" v-bind="$attrs"