From 186ec609374d5d2c65191c0882072f2503d12068 Mon Sep 17 00:00:00 2001 From: wbuezas Date: Tue, 22 Oct 2024 14:49:29 -0300 Subject: [PATCH] Add news view tests --- src/components/common/VnForm.vue | 1 + src/pages/Admin/NewsDetails.vue | 3 ++ src/pages/Admin/NewsView.vue | 3 ++ .../integration/admin/NewsView.spec.js | 43 +++++++++++++++++++ .../integration/orders/OrdersView.spec.js | 4 -- 5 files changed, 50 insertions(+), 4 deletions(-) create mode 100644 src/test/cypress/integration/admin/NewsView.spec.js diff --git a/src/components/common/VnForm.vue b/src/components/common/VnForm.vue index bb78317c..cd1a329c 100644 --- a/src/components/common/VnForm.vue +++ b/src/components/common/VnForm.vue @@ -240,6 +240,7 @@ defineExpose({ flat :disabled="!showBottomActions && !updatedColumns.length" @click="submit()" + data-testid="formDefaultSaveButton" > {{ t('save') }} diff --git a/src/pages/Admin/NewsDetails.vue b/src/pages/Admin/NewsDetails.vue index 6d2cf784..d9b04c98 100644 --- a/src/pages/Admin/NewsDetails.vue +++ b/src/pages/Admin/NewsDetails.vue @@ -106,6 +106,7 @@ onMounted(async () => { v-model="data.title" :label="t('title')" :clearable="false" + data-testid="newsTitleInput" />
{ option-value="name" :options="newsTags" class="col" + data-testid="newsTagSelect" />
getNews()); :to="{ name: 'adminNewsDetails' }" rounded no-caps + data-testid="addNewBtn" > {{ t('addNew') }} @@ -74,6 +75,7 @@ onMounted(async () => getNews()); v-for="(newsItem, index) in news" :key="index" :to="{ name: 'adminNewsDetails', params: { id: newsItem.id } }" + data-testid="newsCard" >