0
0
Fork 0

test: add data-cy

This commit is contained in:
Javier Segarra 2024-11-23 00:51:33 +01:00
parent 4233385267
commit 8a1a748c92
4 changed files with 12 additions and 3 deletions

View File

@ -106,6 +106,7 @@ const originalData = ref({});
const formData = computed(() => state.get(modelValue));
const defaultButtons = computed(() => ({
save: {
dataCy: 'saveDefaultBtn',
color: 'primary',
icon: 'save',
label: 'globals.save',
@ -113,6 +114,7 @@ const defaultButtons = computed(() => ({
type: 'submit',
},
reset: {
dataCy: 'resetDefaultBtn',
color: 'primary',
icon: 'restart_alt',
label: 'globals.reset',
@ -318,6 +320,7 @@ defineExpose({
:title="t(defaultButtons.reset.label)"
/>
<QBtnDropdown
data-cy="saveAndContinueDefaultBtn"
v-if="$props.goTo"
@click="saveAndGo"
:label="tMobile('globals.saveAndContinue')"

View File

@ -105,6 +105,7 @@ onBeforeRouteLeave((to, from, next) => {
@click="insert"
class="q-mb-xs"
dense
data-cy="saveNote"
/>
</template>
</VnInput>

View File

@ -51,7 +51,12 @@ function onBeforeSave(formData, originalData) {
@on-fetch="(data) => (businessTypes = data)"
auto-load
/>
<FormModel auto-load model="customer" :mapper="onBeforeSave">
<FormModel
:url="`Clients/${route.params.id}`"
auto-load
model="customer"
:mapper="onBeforeSave"
>
<template #form="{ data, validate }">
<VnRow>
<VnInput

View File

@ -7,8 +7,8 @@ import FetchData from 'src/components/FetchData.vue';
import { toCurrency, toDateHourMin } from 'src/filters';
import CustomerCloseIconTooltip from 'src/components/CustomerCloseIconTooltip.vue';
import CustomerCheckIconTooltip from 'src/components/CustomerCheckIconTooltip.vue';
import CustomerCloseIconTooltip from '../components/CustomerCloseIconTooltip.vue';
import CustomerCheckIconTooltip from '../components/CustomerCheckIconTooltip.vue';
const { t } = useI18n();
const route = useRoute();